summaryrefslogtreecommitdiff
path: root/lib/Analysis
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
commitd832d32f57bc6d2bebf60e0befebc955d84aae12 (patch)
treeeaa7c6ce98b77a13290cc8ecd3fa429f9a9dd05b /lib/Analysis
parent5bd1b815b360e7a5b886f58c7ca62ff124fa89eb (diff)
downloadllvm-d832d32f57bc6d2bebf60e0befebc955d84aae12.tar.gz
llvm-d832d32f57bc6d2bebf60e0befebc955d84aae12.tar.bz2
llvm-d832d32f57bc6d2bebf60e0befebc955d84aae12.tar.xz
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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 85290d6e1b..f5d095b978 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/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;