[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Mar 16 13:51:01 PST 2004
Changes in directory llvm/lib/Transforms/Scalar:
SCCP.cpp updated: 1.91 -> 1.92
---
Log message:
Do not try to optimize PHI nodes with incredibly high degree. This reduces SCCP
time from 615s to 1.49s on a large testcase that has a gigantic switch statement
that all of the blocks in the function go to (an intepreter).
---
Diffs of the changes: (+7 -0)
Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.91 llvm/lib/Transforms/Scalar/SCCP.cpp:1.92
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.91 Thu Mar 11 23:52:44 2004
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Tue Mar 16 13:49:59 2004
@@ -500,6 +500,13 @@
return; // Quick exit
}
+ // Super-extra-high-degree PHI nodes are unlikely to ever be marked constant,
+ // and slow us down a lot. Just mark them overdefined.
+ if (PN.getNumIncomingValues() > 64) {
+ markOverdefined(PNIV, &PN);
+ return;
+ }
+
// Look at all of the executable operands of the PHI node. If any of them
// are overdefined, the PHI becomes overdefined as well. If they are all
// constant, and they agree with each other, the PHI becomes the identical
More information about the llvm-commits
mailing list