Open bongjunj opened 4 months ago
The root cause seems to be a missing handling of partially undef
vectors when simplifying PHI nodes. This results in combining <i1 undef, i1 poison>
and <i1 poison, i1 false>
to <i1 poison, i1 false>
. A corresponding select
instruction is, however, combined to <i1 undef, i1 false>
, which Alive considers correct: https://alive2.llvm.org/ce/z/k2CEUV
https://github.com/llvm/llvm-project/blob/ce92b2f594809c39c37bf3ef3d881f2b33bd6730/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp#L7345-L7346
https://github.com/llvm/llvm-project/blob/ce92b2f594809c39c37bf3ef3d881f2b33bd6730/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp#L1310-L1325
NewPhi->addIncoming(V, Pred);
in the loopfor (auto [V, Pred] : zip(Ops, Phi->blocks()))
is executed.Alive2 report: https://alive2.llvm.org/ce/z/5IfYQ9