Avoid exponential recursion in SCEV getConstantEvolvingPHI and EvaluateExpression.
authorAndrew Trick <atrick@apple.com>
Wed, 5 Oct 2011 03:25:31 +0000 (03:25 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 5 Oct 2011 03:25:31 +0000 (03:25 +0000)
commit13d31e0368c84bc0acc9e8ac88333685cc393edb
tree5aa7393f8f12e4ec4b04465b6990414e5134cc2c
parent176965f46b9f4ca7c83746355853601c05488564
Avoid exponential recursion in SCEV getConstantEvolvingPHI and EvaluateExpression.

Note to compiler writers: never recurse on multiple instruction
operands without memoization.
Fixes rdar://10187945. Was taking 45s, now taking 5ms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141161 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp