[PATCH] During PHI elimination, split critical edges that move copies out of loops

Matthias Braun matze at braunis.de
Mon Mar 2 16:44:13 PST 2015

The change itself LGTM (but nitpick below).

As mentioned in by you on IRC we perform some unlucky choices in the coalescing order in test/CodeGen/X86/coalescer-commute4.ll with this patch. Are there more? If it's just some tests like this failing but benchmarks generally improving, then it's okay to XFAIL the tests, or trying to rewrite them in a way that we are lucky with the heuristic. If benchmarks generally regress with the changes, then we need further research on how to avoid that...

Comment at: lib/CodeGen/PHIElimination.cpp:576-577
@@ -575,7 +575,4 @@
       // If the copy would be a kill, there is no need to split the edge.
-      if (!isLiveOutPastPHIs(Reg, PreMBB) && !SplitAllCriticalEdges)
-        continue;
-      DEBUG(dbgs() << PrintReg(Reg) << " live-out before critical edge BB#"
-                   << PreMBB->getNumber() << " -> BB#" << MBB.getNumber()
-                   << ": " << *BBI);
+      // if (!isLiveOutPastPHIs(Reg, PreMBB) && !SplitAllCriticalEdges)
+      //   continue;
+      bool ShouldSplit = isLiveOutPastPHIs(Reg, PreMBB);
No need to keep the old code in a comment, it can always be found in the subversion log.



More information about the llvm-commits mailing list