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
This commit is contained in:
Andrew Trick 2013-07-31 02:43:40 +00:00
parent 080cad730a
commit c3bc8b8de6
1 changed files with 3 additions and 0 deletions

View File

@ -585,6 +585,9 @@ namespace {
// Lexicographically compare n-ary expressions. // Lexicographically compare n-ary expressions.
unsigned LNumOps = LC->getNumOperands(), RNumOps = RC->getNumOperands(); unsigned LNumOps = LC->getNumOperands(), RNumOps = RC->getNumOperands();
if (LNumOps != RNumOps)
return (int)LNumOps - (int)RNumOps;
for (unsigned i = 0; i != LNumOps; ++i) { for (unsigned i = 0; i != LNumOps; ++i) {
if (i >= RNumOps) if (i >= RNumOps)
return 1; return 1;