summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-18 22:29:44 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-18 22:29:44 +0000
commit07f4fa819807ee9ee37fff10a5354942a1af9290 (patch)
treea6b4c7b3f38ace6821b4837d82dbd3e9470c189e /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parentcf9e8a987f08488729baa5e71370327461b9d075 (diff)
downloadbcm5719-llvm-07f4fa819807ee9ee37fff10a5354942a1af9290.tar.gz
bcm5719-llvm-07f4fa819807ee9ee37fff10a5354942a1af9290.zip
TwoAddressInstructionPass::CoalesceExtSubRegs can insert INSERT_SUBREG
instructions, but it doesn't really understand live ranges, so the first INSERT_SUBREG uses an implicitly defined register. Fix it in LiveVariableAnalysis by adding the <undef> flag. llvm-svn: 106333
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 22d62524f39..7d23cd0c9dd 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -329,9 +329,16 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
MachineInstr *CopyMI = NULL;
unsigned SrcReg, DstReg, SrcSubReg, DstSubReg;
if (mi->isExtractSubreg() || mi->isInsertSubreg() || mi->isSubregToReg() ||
- tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg))
+ tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg)) {
CopyMI = mi;
+ // Some of the REG_SEQUENCE lowering in TwoAddressInstrPass creates
+ // implicit defs without really knowing. It shows up as INSERT_SUBREG
+ // using an undefined register.
+ if (mi->isInsertSubreg())
+ mi->getOperand(1).setIsUndef();
+ }
+
VNInfo *ValNo = interval.getNextValue(defIndex, CopyMI, true,
VNInfoAllocator);
assert(ValNo->id == 0 && "First value in interval is not 0?");
OpenPOWER on IntegriCloud