[InstSimplify] allow insertelement-with-undef fold if poison-safe
authorSanjay Patel <spatel@rotateright.com>
Fri, 1 May 2020 14:34:29 +0000 (10:34 -0400)
committerSanjay Patel <spatel@rotateright.com>
Fri, 1 May 2020 14:34:29 +0000 (10:34 -0400)
commit57f0eed98d02cd684c358a45f68e716179f4bfa3
tree9a3f06c2ca6bbdaeead5da0055089164cc146087
parentc79a366ec0f87eafca123138b550b039618bf880
[InstSimplify] allow insertelement-with-undef fold if poison-safe

The more general fold was not poison-safe, so it was removed:
rG5486e00
...but it is ok to have this transform if analysis can determine
the vector contains no poison. The test shows a simple example
of that: constant integer elements are not poison.
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/insertelement.ll