[NFC][InstCombine] More test for "sign bit test via shifts" pattern (PR43595)
authorRoman Lebedev <lebedev.ri@gmail.com>
Sun, 13 Oct 2019 17:11:16 +0000 (17:11 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sun, 13 Oct 2019 17:11:16 +0000 (17:11 +0000)
commit8e2561974d98a338bad0a75f981a9b02b672cb5e
treeb3b52693309dc487c06517a50f359a837093ea2c
parent3efafd6c38a4da25b9bbd9a7b09648249a502ebe
[NFC][InstCombine] More test for "sign bit test via shifts" pattern (PR43595)

While that pattern is indirectly handled via
reassociateShiftAmtsOfTwoSameDirectionShifts(),
that incursme one-use restriction on truncation,
which is pointless since we know that we'll produce a single instruction.

Additionally, *if* we are only looking for sign bit,
we don't need shifts to be identical,
which isn't the case in general,
and is the blocker for me in bug in question:

https://bugs.llvm.org/show_bug.cgi?id=43595

llvm-svn: 374726
llvm/test/Transforms/InstCombine/shift-amount-reassociation-in-bittest.ll
llvm/test/Transforms/InstCombine/shift-amount-reassociation-with-truncation-ashr.ll
llvm/test/Transforms/InstCombine/shift-amount-reassociation-with-truncation-lshr.ll
llvm/test/Transforms/InstCombine/shift-amount-reassociation-with-truncation-shl.ll
llvm/test/Transforms/InstCombine/shift-amount-reassociation.ll
llvm/test/Transforms/InstCombine/sign-bit-test-via-right-shifting-all-other-bits.ll