From: Chandler Carruth Date: Mon, 6 Feb 2017 21:27:12 +0000 (+0000) Subject: [SCEV] Scale back the test added in r294181 as it goes quadratic in X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8425f9249757fa16076ce6b1c269a4b6f9253291;p=llvm [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 --- diff --git a/unittests/Analysis/ScalarEvolutionTest.cpp b/unittests/Analysis/ScalarEvolutionTest.cpp index 52368a89884..a9b144c5011 100644 --- a/unittests/Analysis/ScalarEvolutionTest.cpp +++ b/unittests/Analysis/ScalarEvolutionTest.cpp @@ -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);