[InstCombine] guard against splat-mul corner case
authorSanjay Patel <spatel@rotateright.com>
Mon, 11 Apr 2022 19:44:57 +0000 (15:44 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 11 Apr 2022 19:50:13 +0000 (15:50 -0400)
commit1206a18d417aa6d9d3d6f9e25cbf0b07ed1409a4
tree5d16d9024708b7b76b3f04d07ed9b783d8b77156
parentaafb428237b4ee41f7cb1de0211a0fbdb74e1f1c
[InstCombine] guard against splat-mul corner case

The test is already simplified, and I'm not sure how
to write a test to exercise the new clause. But it
protects the 2-bit pattern from miscompiling as noted
in D123453.

https://alive2.llvm.org/ce/z/QPyVfv
(If we managed to fall into the mul transform, it
would wrongly create a zero on this pattern.)
llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
llvm/test/Transforms/InstCombine/lshr.ll