[NFC][InstCombine] More tests for "Dropping pointless masking before left shift"...
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 17 Sep 2019 19:32:11 +0000 (19:32 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 17 Sep 2019 19:32:11 +0000 (19:32 +0000)
commitbed6e08e23b36dc5ac38d675c2a705c2f41a4a94
treec114a6161b0319809e4fc281d73efae0314be1a0
parent6476d7cf0b2bc509e88a00c541f475b7676c4141
[NFC][InstCombine] More tests for "Dropping pointless masking before left shift" (PR42563)

While we already fold that pattern if the sum of shift amounts is not
smaller than bitwidth, there's painfully obvious generalization:
  https://rise4fun.com/Alive/F5R
I.e. the "sub of shift amounts" tells us how many bits will be left
in the output. If it's less than bitwidth, we simply need to
apply a mask, which is constant.

llvm-svn: 372170
llvm/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-a.ll [new file with mode: 0644]
llvm/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-b.ll [new file with mode: 0644]
llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-a.ll
llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-b.ll