summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-18 18:56:31 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-18 18:56:31 +0000
commitb2e4b7adde3bb45bae3bf887d5185789280fe79b (patch)
tree116361b5f7d60d35d30322f0b2ced0bd50367b6b /llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
parent6bb6a55f01f6afe732b58f80ffe137b2c08fc480 (diff)
downloadbcm5719-llvm-b2e4b7adde3bb45bae3bf887d5185789280fe79b.tar.gz
bcm5719-llvm-b2e4b7adde3bb45bae3bf887d5185789280fe79b.zip
- Remove the previous check which broke coalescer-commute3.ll
- For now, conservatively ignore copy MI whose source is a physical register. Commuting its def MI can cause a physical register live interval to be live through a loop (since we know it's live coming into the def MI). llvm-svn: 47281
Diffstat (limited to 'llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 199c89ef55a..7c512ed368a 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -247,11 +247,11 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(LiveInterval &IntA,
unsigned CopyIdx = li_->getDefIndex(li_->getInstructionIndex(CopyMI));
- // FIXME: For now, only eliminate the copy by commuting its def is the source
- // does not live pass the move. Coalescing those copies may end up may simply
- // end up swapping a live interval for another. That and because usually only
- // the non-two address operand can be folded can end up pessimizing the code.
- if (CopyMI->findRegisterUseOperandIdx(IntA.reg, true) != -1)
+ // FIXME: For now, only eliminate the copy by commuting its def when the
+ // source register is a virtual register. We want to guard against cases
+ // where the copy is a back edge copy and commuting the def lengthen the
+ // live interval of the source register to the entire loop.
+ if (TargetRegisterInfo::isPhysicalRegister(IntA.reg))
return false;
// BValNo is a value number in B that is defined by a copy from A. 'B3' in
OpenPOWER on IntegriCloud