Fix a merge bug in preRAsched for handling physreg aliases.
authorAndrew Trick <atrick@apple.com>
Tue, 7 Jun 2011 00:38:12 +0000 (00:38 +0000)
committerAndrew Trick <atrick@apple.com>
Tue, 7 Jun 2011 00:38:12 +0000 (00:38 +0000)
I've been sitting on this long enough trying to find a test case. I
think the fix should go in now, but I'll keep working on the test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132701 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

index 88bd4509b468dd5328014031ee4fa83c39931f16..14717e6406f0b40e15139f58031540a5022cdede 100644 (file)
@@ -1008,14 +1008,16 @@ static void CheckForLiveRegDef(SUnit *SU, unsigned Reg,
   for (const unsigned *AliasI = TRI->getOverlaps(Reg); *AliasI; ++AliasI) {
 
     // Check if Ref is live.
-    if (!LiveRegDefs[Reg]) continue;
+    if (!LiveRegDefs[*AliasI]) continue;
 
     // Allow multiple uses of the same def.
-    if (LiveRegDefs[Reg] == SU) continue;
+    if (LiveRegDefs[*AliasI] == SU) continue;
 
     // Add Reg to the set of interfering live regs.
-    if (RegAdded.insert(Reg))
-      LRegs.push_back(Reg);
+    if (RegAdded.insert(*AliasI)) {
+      assert(*AliasI == Reg && "alias clobber"); //!!!
+      LRegs.push_back(*AliasI);
+    }
   }
 }