diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-04 19:19:10 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-04 19:19:10 +0000 |
commit | 59bc8c437a8c5bcd0663fb5599789b8896cb1b55 (patch) | |
tree | 939b4944478ec59302ea14a0cc69d64a861956b7 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 6759dd078a3748f06968415ccaa5cc738b3e8558 (diff) | |
download | bcm5719-llvm-59bc8c437a8c5bcd0663fb5599789b8896cb1b55.tar.gz bcm5719-llvm-59bc8c437a8c5bcd0663fb5599789b8896cb1b55.zip |
Stop fixing bad machine code in LiveIntervalAnalysis.
The first def of a virtual register cannot also read the register.
Assert on such bad machine code instead of trying to fix it.
TwoAddressInstructionPass should never create code like that.
llvm-svn: 152010
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 3e16efa7285..70ed1c398ba 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -187,21 +187,9 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // Get the Idx of the defining instructions. SlotIndex defIndex = MIIdx.getRegSlot(MO.isEarlyClobber()); - // Make sure the first definition is not a partial redefinition. Add an - // <imp-def> of the full register. - // FIXME: LiveIntervals shouldn't modify the code like this. Whoever - // created the machine instruction should annotate it with <undef> flags - // as needed. Then we can simply assert here. The REG_SEQUENCE lowering - // is the main suspect. - if (MO.getSubReg()) { - mi->addRegisterDefined(interval.reg); - // Mark all defs of interval.reg on this instruction as reading <undef>. - for (unsigned i = MOIdx, e = mi->getNumOperands(); i != e; ++i) { - MachineOperand &MO2 = mi->getOperand(i); - if (MO2.isReg() && MO2.getReg() == interval.reg && MO2.getSubReg()) - MO2.setIsUndef(); - } - } + // Make sure the first definition is not a partial redefinition. + assert(!MO.readsReg() && "First def cannot also read virtual register " + "missing <undef> flag?"); VNInfo *ValNo = interval.getNextValue(defIndex, VNInfoAllocator); assert(ValNo->id == 0 && "First value in interval is not 0?"); |