[InstCombine] convert mul with sexted bool and constant to select
authorSanjay Patel <spatel@rotateright.com>
Thu, 20 Jan 2022 19:51:45 +0000 (14:51 -0500)
committerSanjay Patel <spatel@rotateright.com>
Thu, 20 Jan 2022 20:57:01 +0000 (15:57 -0500)
commita7a2860d0eee37d9e0fd0b6a8e3d884f8ee4ec16
tree0c55a8e74b7ab232ff00140fb3100b19a7922622
parent4c1dc65015ae8ba4b7e0ac56f4d88d29e712ce25
[InstCombine] convert mul with sexted bool and constant to select

We already have the related folds for zext-of-bool, so it
should make things more consistent to have this transform
to select for sext-of-bool too:
https://alive2.llvm.org/ce/z/YikdfA

Fixes #53319
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/mul.ll