[LVI] Remove recursion from getValueForCondition (NFCI)
authorCarl Ritson <carl.ritson@amd.com>
Thu, 24 Jun 2021 00:36:58 +0000 (09:36 +0900)
committerCarl Ritson <carl.ritson@amd.com>
Thu, 24 Jun 2021 00:58:22 +0000 (09:58 +0900)
commitae266e743c9182ebd9702ccea2afb16f470013db
treee60718cefa13d97f7c38e4facff81cb8fc5eed94
parentab244db1fa0b72f3c0ac928158569fdcc6db0236
[LVI] Remove recursion from getValueForCondition (NFCI)

Convert getValueForCondition to a worklist model instead of using
recursion.

In pathological cases getValueForCondition recurses heavily.
Stack frames are quite expensive on x86-64, and some operating
systems (e.g. Windows) have relatively low stack size limits.
Using a worklist avoids potential failures from stack overflow.

Differential Revision: https://reviews.llvm.org/D104191
llvm/lib/Analysis/LazyValueInfo.cpp