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

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 13:27:12 PST 2017


Author: chandlerc
Date: Mon Feb  6 15:27:12 2017
New Revision: 294241

URL: http://llvm.org/viewvc/llvm-project?rev=294241&view=rev
Log:
[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.

Modified:
    llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp

Modified: llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp?rev=294241&r1=294240&r2=294241&view=diff
==============================================================================
--- llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp (original)
+++ llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp Mon Feb  6 15:27:12 2017
@@ -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);




More information about the llvm-commits mailing list