[InstCombine] fold mul with decremented "shl -1" factor
authorSanjay Patel <spatel@rotateright.com>
Mon, 31 Oct 2022 12:54:18 +0000 (08:54 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 31 Oct 2022 13:06:55 +0000 (09:06 -0400)
commitbc886e9b587b9d009f49b12eaaa9ebc1c71905a1
tree7a5d0b06f3d52947b01acb0c053e8524201e151f
parent9a96f42a75e8f091ca6ed89cdf2571d3e74ef491
[InstCombine] fold mul with decremented "shl -1" factor

This is a sibling to:
6064e92b0a84
...but we canonicalize the shl+add to shl+xor,
so the pattern is different than I expected:
https://alive2.llvm.org/ce/z/8CX16e

I have not found any patterns that are safe
to propagate no-wrap, so that is not included
here.
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/mul.ll