]> granicus.if.org Git - llvm/commit
[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): avoid constantexpr pitfai...
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 12 Aug 2019 11:28:02 +0000 (11:28 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 12 Aug 2019 11:28:02 +0000 (11:28 +0000)
commitfcd00601e2b69587ed4d0e02496c63ce4d1cd2eb
tree0e5bbf4070723c3cc380793fbc52b3c14b939aca
parent1d838d593f84c175d5bd809cef647707954a39bb
[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): avoid constantexpr pitfail (PR42962)

Instead of matching value and then blindly casting to BinaryOperator
just to get the opcode, just match instruction and do no cast.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368554 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/shift-amount-reassociation-in-bittest.ll