[Attributor][FIX] Handle non-recursive but re-entrant functions properly
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 12 Jul 2022 05:38:32 +0000 (00:38 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Fri, 22 Jul 2022 05:00:56 +0000 (00:00 -0500)
commita50b9f9f1f89dcdfc163a9fcd76a6bcf20c26521
tree9c4b1573e500c826ec6d2a7d58506db9fd47b70e
parenta40af8589e88f7ebaf81d11a9aa5a4eaf1735eff
[Attributor][FIX] Handle non-recursive but re-entrant functions properly

If a function is non-recursive we only performed intra-procedural
reasoning for reachability (via AA::isPotentiallyReachable). However,
if it is re-entrant that doesn't mean we can't reach. Instead of this
problematic logic in the reachability reasoning we utilize logic in
AAPointerInfo. If a location is for sure written by a function it can
be re-entrant or recursive we know only intra-procedural reasoning is
sufficient.
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/misc.ll
llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll