diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-09-20 23:08:42 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-09-20 23:08:42 +0000 |
commit | e6e2d8cd90ceb5190aa646dc06584027f7d492d0 (patch) | |
tree | 3b2ef353ba0c2496c50f8f96aa6e9fc0659cf6b6 /lib/CodeGen | |
parent | 2df8ac84ae8317b6a96f19bbc984d2bd02cff087 (diff) | |
download | llvm-e6e2d8cd90ceb5190aa646dc06584027f7d492d0.tar.gz llvm-e6e2d8cd90ceb5190aa646dc06584027f7d492d0.tar.bz2 llvm-e6e2d8cd90ceb5190aa646dc06584027f7d492d0.tar.xz |
Ignore PHI-defs for -new-coalescer interference checks.
A PHI can't create interference on its own. If two live ranges interfere
at a PHI, they must also interfere when leaving one of the PHI
predecessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/RegisterCoalescer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp index e9bfac964e..dd0f548867 100644 --- a/lib/CodeGen/RegisterCoalescer.cpp +++ b/lib/CodeGen/RegisterCoalescer.cpp @@ -1402,7 +1402,6 @@ JoinVals::analyzeValue(unsigned ValNo, JoinVals &Other) { // values should be merged into one, but not into any preceding value. // The first value defined or visited gets CR_Keep, the other gets CR_Merge. if (VNInfo *OtherVNI = OtherLRQ.valueDefined()) { - DEBUG(dbgs() << "\t\tDouble def: " << VNI->def << '\n'); assert(SlotIndex::isSameInstr(VNI->def, OtherVNI->def) && "Broken LRQ"); // One value stays, the other is merged. Keep the earlier one, or the first @@ -1420,7 +1419,11 @@ JoinVals::analyzeValue(unsigned ValNo, JoinVals &Other) { // Keep this value, check for conflicts when analyzing OtherVNI. if (!OtherV.isAnalyzed()) return CR_Keep; - // Both sides have been analyzed now. Do they conflict? + // Both sides have been analyzed now. + // Allow overlapping PHI values. Any real interference would show up in a + // predecessor, the PHI itself can't introduce any conflicts. + if (VNI->isPHIDef()) + return CR_Merge; if (V.ValidLanes & OtherV.ValidLanes) // Overlapping lanes can't be resolved. return CR_Impossible; @@ -1441,9 +1444,10 @@ JoinVals::analyzeValue(unsigned ValNo, JoinVals &Other) { Other.computeAssignment(V.OtherVNI->id, *this); const Val &OtherV = Other.Vals[V.OtherVNI->id]; - // Don't attempt resolving PHI values for now. + // Allow overlapping PHI values. Any real interference would show up in a + // predecessor, the PHI itself can't introduce any conflicts. if (VNI->isPHIDef()) - return CR_Impossible; + return CR_Replace; // Check for simple erasable conflicts. if (DefMI->isImplicitDef()) |