[Attributor] Remove broken and duplicated load simplification
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 15 Mar 2022 17:34:28 +0000 (12:34 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 6 Apr 2022 01:49:03 +0000 (20:49 -0500)
commit857bf306d7984cb464cd0de6371df7c934c6642a
tree35e68c09526d4b9aa84c625f7335b4f742e428c4
parenta8610d752306b48f914eb21108f2d1cb1fd6b710
[Attributor] Remove broken and duplicated load simplification

We look through loads in the "generic value traversal" and we
consequently don't need to look through them again in AAValueSimplify*.
The test changes stem from the fact that we allowed any simplified
value, incl. non-dynamically unique ones, as long as the underlying
memory was an alloca. This doesn't seem to make sense as allocas do not
protect against dynamically non-unique values. We need to make the
unique check better rather than excluding allocas. That in mind, we can
remove a lot of code by simply relying on the generic value traversal
load look through.

To soften the blow some minor adjustments have been made that allow more
simplification through the now used scheme and some tests have been
given a `norecurse` for now.
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/ArgumentPromotion/alloca-as.ll
llvm/test/Transforms/Attributor/callbacks.ll
llvm/test/Transforms/Attributor/heap_to_stack.ll
llvm/test/Transforms/Attributor/norecurse.ll
llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
llvm/test/Transforms/Attributor/value-simplify.ll
llvm/test/Transforms/OpenMP/barrier_removal.ll
llvm/test/Transforms/OpenMP/custom_state_machines.ll
llvm/test/Transforms/OpenMP/parallel_region_merging.ll