summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-01-19 07:30:47 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-01-19 07:30:47 +0000
commit54c61edee768a2da8e69bc8ba3a218d3bd9f018a (patch)
treeab0dc0289a984df7e950cd24069806ff6d3e2919 /llvm/lib
parentaf51993ee12e7bb729ae8fffd97c2376adc4b784 (diff)
downloadbcm5719-llvm-54c61edee768a2da8e69bc8ba3a218d3bd9f018a.tar.gz
bcm5719-llvm-54c61edee768a2da8e69bc8ba3a218d3bd9f018a.zip
[MIScheduler] Slightly better handling of constrainLocalCopy when both source and dest are local
This fixes PR21792. Differential Revision: http://reviews.llvm.org/D6823 llvm-svn: 226433
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 9fe23c5b227..a554254794a 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -1434,12 +1434,15 @@ void CopyConstrain::constrainLocalCopy(SUnit *CopySU, ScheduleDAGMILive *DAG) {
// Check if either the dest or source is local. If it's live across a back
// edge, it's not local. Note that if both vregs are live across the back
// edge, we cannot successfully contrain the copy without cyclic scheduling.
- unsigned LocalReg = DstReg;
- unsigned GlobalReg = SrcReg;
+ // If both the copy's source and dest are local live intervals, then we
+ // should treat the dest as the global for the purpose of adding
+ // constraints. This adds edges from source's other uses to the copy.
+ unsigned LocalReg = SrcReg;
+ unsigned GlobalReg = DstReg;
LiveInterval *LocalLI = &LIS->getInterval(LocalReg);
if (!LocalLI->isLocal(RegionBeginIdx, RegionEndIdx)) {
- LocalReg = SrcReg;
- GlobalReg = DstReg;
+ LocalReg = DstReg;
+ GlobalReg = SrcReg;
LocalLI = &LIS->getInterval(LocalReg);
if (!LocalLI->isLocal(RegionBeginIdx, RegionEndIdx))
return;
OpenPOWER on IntegriCloud