summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-04-24 18:04:41 +0000
committerAndrew Trick <atrick@apple.com>2012-04-24 18:04:41 +0000
commit9e9a9f146541b40a7a4c4c3a61e8f5b5de1c2c13 (patch)
treea2f5abfae4bf932ca9e274d55a2813db33082155 /llvm/lib
parentc3ea00565f18ea04b23e135c44d3cdd165252db5 (diff)
downloadbcm5719-llvm-9e9a9f146541b40a7a4c4c3a61e8f5b5de1c2c13.tar.gz
bcm5719-llvm-9e9a9f146541b40a7a4c4c3a61e8f5b5de1c2c13.zip
misched: DAG builder must special case earlyclobber
llvm-svn: 155459
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/ScheduleDAGInstrs.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index e2f33aa7358..ed85963cc86 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -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.
OpenPOWER on IntegriCloud