Check all overlaps when looking for used registers.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 15 Nov 2011 08:20:43 +0000 (08:20 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 15 Nov 2011 08:20:43 +0000 (08:20 +0000)
A function using any RC alias is enough to enable the ExeDepsFix pass.

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

lib/CodeGen/ExecutionDepsFix.cpp

index 050edce2ec8ce6febfc5d2a9c4464f0b0037b1b3..16a8f921b3ddc3a08c2b0ebc190d5ec5ac54ecfa 100644 (file)
@@ -650,10 +650,11 @@ bool ExeDepsFix::runOnMachineFunction(MachineFunction &mf) {
   bool anyregs = false;
   for (TargetRegisterClass::const_iterator I = RC->begin(), E = RC->end();
        I != E; ++I)
-    if (MF->getRegInfo().isPhysRegUsed(*I)) {
-      anyregs = true;
-      break;
-    }
+    for (const unsigned *AI = TRI->getOverlaps(*I); *AI; ++AI)
+      if (MF->getRegInfo().isPhysRegUsed(*AI)) {
+        anyregs = true;
+        break;
+      }
   if (!anyregs) return false;
 
   // Initialize the AliasMap on the first use.