diff options
author | Andrew Trick <atrick@apple.com> | 2011-03-23 20:42:39 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-03-23 20:42:39 +0000 |
commit | 13acae040c5a9df749f009694aae0e88349d7258 (patch) | |
tree | 6212729634b3cc29656c5bdfb98d98a090b67611 /llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | |
parent | a8846e0540c72b3b4eb0f7d2664a65126dcd71bc (diff) | |
download | bcm5719-llvm-13acae040c5a9df749f009694aae0e88349d7258.tar.gz bcm5719-llvm-13acae040c5a9df749f009694aae0e88349d7258.zip |
Ensure that def-side physreg copies are scheduled above any other uses
so the scheduler can't create new interferences on the copies
themselves. Prior to this fix the scheduler could get stuck in a loop
creating copies.
Fixes PR9509.
llvm-svn: 128164
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index aa93bba29d2..f02d78f6134 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -935,6 +935,15 @@ void ScheduleDAGRRList::InsertCopiesAndMoveSuccs(SUnit *SU, unsigned Reg, AddPred(SuccSU, D); DelDeps.push_back(std::make_pair(SuccSU, *I)); } + else { + // Avoid scheduling the def-side copy before other successors. Otherwise + // we could introduce another physreg interference on the copy and + // continue inserting copies indefinitely. + SDep D(CopyFromSU, SDep::Order, /*Latency=*/0, + /*Reg=*/0, /*isNormalMemory=*/false, + /*isMustAlias=*/false, /*isArtificial=*/true); + AddPred(SuccSU, D); + } } for (unsigned i = 0, e = DelDeps.size(); i != e; ++i) RemovePred(DelDeps[i].first, DelDeps[i].second); |