[SCEV] Scale back the test added in r294181 as it goes quadratic in

SCEV.

This test was immediately the slowest test in 'check-llvm' even in an
optimized build and was driving up the total test time by 50% for me.

Sanjoy has filed a PR about the quadratic behavior in SCEV but it is
also concerning that the test still passes given that r294181 added
a threshold at 32 to SCEV. I've followed up on the original patch to
figure out how this test should work long-term, but for now I want to
get check-llvm to be fast again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294241 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth 2017-02-06 21:27:12 +00:00
parent 6db6348785
commit 8425f92497

View File

@ -549,7 +549,11 @@ TEST_F(ScalarEvolutionsTest, SCEVAddExpr) {
Instruction *Add1 = BinaryOperator::CreateAdd(Mul1, Trunc, "", EntryBB);
Mul1 = BinaryOperator::CreateMul(Add1, Trunc, "", EntryBB);
Instruction *Add2 = BinaryOperator::CreateAdd(Mul1, Add1, "", EntryBB);
for (int i = 0; i < 1000; i++) {
// FIXME: The size of this is arbitrary and doesn't seem to change the
// result, but SCEV will do quadratic work for these so a large number here
// will be extremely slow. We should revisit what and how this is testing
// SCEV.
for (int i = 0; i < 10; i++) {
Mul1 = BinaryOperator::CreateMul(Add2, Add1, "", EntryBB);
Add1 = Add2;
Add2 = BinaryOperator::CreateAdd(Mul1, Add1, "", EntryBB);