In CheckForLiveRegDef use TRI->getOverlaps.
authorAndrew Trick <atrick@apple.com>
Thu, 23 Dec 2010 03:43:21 +0000 (03:43 +0000)
committerAndrew Trick <atrick@apple.com>
Thu, 23 Dec 2010 03:43:21 +0000 (03:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122473 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

index 793fa3d5998eb46a5fd940f39a684a5ade57e35d..21227950d024231c742e2c9bd75ab8e7119486a2 100644 (file)
@@ -659,15 +659,18 @@ static void CheckForLiveRegDef(SUnit *SU, unsigned Reg,
                                SmallSet<unsigned, 4> &RegAdded,
                                SmallVector<unsigned, 4> &LRegs,
                                const TargetRegisterInfo *TRI) {
-  if (LiveRegDefs[Reg] && LiveRegDefs[Reg] != SU) {
+  for (const unsigned *AliasI = TRI->getOverlaps(Reg); *AliasI; ++AliasI) {
+
+    // Check if Ref is live.
+    if (!LiveRegDefs[Reg]) continue;
+
+    // Allow multiple uses of the same def.
+    if (LiveRegDefs[Reg] == SU) continue;
+
+    // Add Reg to the set of interfering live regs.
     if (RegAdded.insert(Reg))
       LRegs.push_back(Reg);
   }
-  for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias)
-    if (LiveRegDefs[*Alias] && LiveRegDefs[*Alias] != SU) {
-      if (RegAdded.insert(*Alias))
-        LRegs.push_back(*Alias);
-    }
 }
 
 /// DelayForLiveRegsBottomUp - Returns true if it is necessary to delay