]> granicus.if.org Git - llvm/commit
[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)
commitc45f92289b71b36cfba2b2e8e14547b3e04f8c21
tree423ee5e1996f7b5a6ced9afe13d69a7f5d624f17
parent261b5b163a7206068857dde640a3bf5925e0f43b
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374726 91177308-0d34-0410-b5e6-96231b3b80d8
test/Transforms/InstCombine/shift-amount-reassociation-in-bittest.ll
test/Transforms/InstCombine/shift-amount-reassociation-with-truncation-ashr.ll
test/Transforms/InstCombine/shift-amount-reassociation-with-truncation-lshr.ll
test/Transforms/InstCombine/shift-amount-reassociation-with-truncation-shl.ll
test/Transforms/InstCombine/shift-amount-reassociation.ll
test/Transforms/InstCombine/sign-bit-test-via-right-shifting-all-other-bits.ll