misched: DAG builder must special case earlyclobber

llvm-svn: 155459
This commit is contained in:
Andrew Trick 2012-04-24 18:04:41 +00:00
parent c3ea00565f
commit 9e9a9f1465
1 changed files with 9 additions and 0 deletions

View File

@ -442,6 +442,15 @@ void ScheduleDAGInstrs::addVRegUseDeps(SUnit *SU, unsigned OperIdx) {
SlotIndex UseIdx = LIS->getInstructionIndex(MI).getRegSlot();
LiveInterval *LI = &LIS->getInterval(Reg);
VNInfo *VNI = LI->getVNInfoBefore(UseIdx);
// Special case: An early-clobber tied operand reads and writes the
// register one slot early. e.g. InlineAsm.
//
// FIXME: Same special case is in shrinkToUses. Hide under an API.
if (SlotIndex::isSameInstr(VNI->def, UseIdx)) {
UseIdx = VNI->def;
VNI = LI->getVNInfoBefore(UseIdx);
}
// VNI will be valid because MachineOperand::readsReg() is checked by caller.
MachineInstr *Def = LIS->getInstructionFromIndex(VNI->def);
// Phis and other noninstructions (after coalescing) have a NULL Def.