[Attributor][FIX] AAValueConstantRange should not loop unconstrained
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 20 Jan 2022 23:52:41 +0000 (17:52 -0600)
committerJohannes Doerfert <johannes@jdoerfert.de>
Fri, 21 Jan 2022 00:07:04 +0000 (18:07 -0600)
commit37e0c58559ad367f16960fd65c8efb7bb1a6414f
tree354fc8f11d3b5044e93f8c6354b86f739be73fa8
parent7bf9065ad7d9f6c908ab109fa85bbc36ae6a1130
[Attributor][FIX] AAValueConstantRange should not loop unconstrained

The old method to avoid unconstrained expansion of the constant range in
a loop did not work as soon as there were multiple instructions in
between the phi and its input. We now take a generic approach and limit
the number of updates as a fallback. The old method is kept as it
catches "the common case" early.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/range.ll