[Attributor][FIX] Do not replace a value with a non-dominating instruction
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 24 Jun 2021 18:12:06 +0000 (13:12 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Sat, 10 Jul 2021 17:32:50 +0000 (12:32 -0500)
commitae08df87dfbae62542d2a37ecebbbc5fa04b82f4
treee3a186df6b3fee90279462c763021df2e241b0b3
parentf0628c6ff7ba2f3ceeb99791e5e34028de0c82c4
[Attributor][FIX] Do not replace a value with a non-dominating instruction

We have to be careful when we replace values to not use a non-dominating
instruction. It makes sense that simplification offers those as
"simplified values" but we can't manifest them in the IR without PHI
nodes. In the future we should consider potentially adding those PHI
nodes.
12 files changed:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll
llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll
llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll
llvm/test/Transforms/Attributor/heap_to_stack.ll
llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
llvm/test/Transforms/Attributor/memory_locations.ll
llvm/test/Transforms/Attributor/noalias.ll
llvm/test/Transforms/Attributor/nonnull.ll
llvm/test/Transforms/Attributor/value-simplify.ll