mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
[MIScheduler] Slightly better handling of constrainLocalCopy when both source and dest are local
This fixes PR21792. Differential Revision: http://reviews.llvm.org/D6823 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226433 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user