[NewGVN] do phi(undef, x) -> x only if x is not poison
authorNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
Wed, 26 Jan 2022 10:34:20 +0000 (10:34 +0000)
committerNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
Sat, 29 Jan 2022 21:43:57 +0000 (21:43 +0000)
commitf1c18acb07aa40f42b87b70462a6d1ab77a4825c
tree635dae59fab5f2a0fd38a7f04be8933fddf0e0d8
parent7b2dfe1c226a4e9f193b8432c64c32c58ca9990a
[NewGVN] do phi(undef, x) -> x only if x is not poison

phi([undef, A], [x, B]) -> x is only correct x is guaranteed to be
a non-poison value.
Otherwise we would be changing an undef to poison in the branch A.

Differential Revision: https://reviews.llvm.org/D117907
llvm/lib/Transforms/Scalar/NewGVN.cpp
llvm/test/Transforms/NewGVN/completeness.ll
llvm/test/Transforms/NewGVN/phi-edge-handling.ll
llvm/test/Transforms/NewGVN/pr31682.ll
llvm/test/Transforms/NewGVN/pr32403.ll
llvm/test/Transforms/NewGVN/pr32838.ll
llvm/test/Transforms/NewGVN/pr34135.ll