summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-07-31 02:43:40 +0000
committerAndrew Trick <atrick@apple.com>2013-07-31 02:43:40 +0000
commitc3bc8b8de64b8aa2a8d3d10c5f1a0d6a56f06010 (patch)
treee96763d204994709ad8b22fabbac2f1a862324fa
parent080cad730a7c2ab4850e04be7d70537b518e3d15 (diff)
downloadbcm5719-llvm-c3bc8b8de64b8aa2a8d3d10c5f1a0d6a56f06010.tar.gz
bcm5719-llvm-c3bc8b8de64b8aa2a8d3d10c5f1a0d6a56f06010.zip
Fix a severe compile time problem when forming large SCEV expressions.
This fix is very lightweight. The same fix already existed for AddRec but was missing for NAry expressions. This is obviously an improvement and I'm unsure how to test compile time problems. Patch by Xiaoyi Guo! llvm-svn: 187475
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 85290d6e1b8..f5d095b9781 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -585,6 +585,9 @@ namespace {
// Lexicographically compare n-ary expressions.
unsigned LNumOps = LC->getNumOperands(), RNumOps = RC->getNumOperands();
+ if (LNumOps != RNumOps)
+ return (int)LNumOps - (int)RNumOps;
+
for (unsigned i = 0; i != LNumOps; ++i) {
if (i >= RNumOps)
return 1;
OpenPOWER on IntegriCloud