If an anti-dependence uses a non-allocatable register, set AntiDepReg
authorDan Gohman <gohman@apple.com>
Fri, 16 Jan 2009 21:57:43 +0000 (21:57 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 16 Jan 2009 21:57:43 +0000 (21:57 +0000)
to 0, to ensure that the subsequent code doesn't try to break the
dependence.

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

lib/CodeGen/PostRASchedulerList.cpp

index 12d9efa87b4c0da46dd261845868845d3fadd5d1..eef20b9386ff0112b6b447530b45eec2cd6858ba 100644 (file)
@@ -442,7 +442,9 @@ bool SchedulePostRATDList::BreakAntiDependencies() {
           AntiDepReg = Edge->getReg();
           assert(AntiDepReg != 0 && "Anti-dependence on reg0?");
           // Don't break anti-dependencies on non-allocatable registers.
-          if (AllocatableSet.test(AntiDepReg)) {
+          if (!AllocatableSet.test(AntiDepReg))
+            AntiDepReg = 0;
+          else {
             // If the SUnit has other dependencies on the SUnit that it
             // anti-depends on, don't bother breaking the anti-dependency
             // since those edges would prevent such units from being