[Attributor][FIX] Stabilize the state of AAReturnedValues each update
authorJohannes Doerfert <johannes@jdoerfert.de>
Wed, 13 May 2020 01:51:21 +0000 (20:51 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 13 May 2020 02:00:30 +0000 (21:00 -0500)
commitaf48351cc8fc63148e8cfd10a936b2d5d0c2f078
tree4e0bd13882abddfcd963f25c7719bb59b554e625
parent8aa2266fd8dd237c84daf12c2eec0df244558f49
[Attributor][FIX] Stabilize the state of AAReturnedValues each update

For AAReturnedValues we treated new and existing information differently
in the updateImpl. Only the latter was properly analyzed and
categorized. The former was thought to be analyzed in the subsequent
update. Since the Attributor does not support "self-updates" we need to
make sure the state is "stable" after each updateImpl invocation. That
is, if the surrounding information does not change, the state is valid.
Now we make sure all return values have been handled and properly
categorized each iteration. We might not update again if we have not
requested a non-fix attribute so we cannot "wait" for the next update to
analyze a new return value.

Bug reported by @sdmitriev.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/returned.ll