summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-16 19:49:59 +0000
committerChris Lattner <sabre@nondot.org>2004-03-16 19:49:59 +0000
commit7a7b11487136487312b1da52dd44d8e43a3253cf (patch)
treead83b888afe56b1ea70bb54c1f93c352834de1e9 /llvm/lib/Transforms/Scalar/SCCP.cpp
parenta64923ad2673b3d6a4f5775b44f37c3b6d164408 (diff)
downloadbcm5719-llvm-7a7b11487136487312b1da52dd44d8e43a3253cf.tar.gz
bcm5719-llvm-7a7b11487136487312b1da52dd44d8e43a3253cf.zip
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). llvm-svn: 12442
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 26c246df000..75be39704e1 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -500,6 +500,13 @@ void SCCP::visitPHINode(PHINode &PN) {
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
OpenPOWER on IntegriCloud