Merging r368517, r368518, r368519, and r368554:

Authored by hansw on Aug 13 2019, 4:56 AM.


Merging r368517, r368518, r368519, and r368554:

r368517 | lebedevri | 2019-08-10 21:28:12 +0200 (Sat, 10 Aug 2019) | 1 line

[NFC][InstCombine] Tests for shift amount reassociation in bittest with shift of const

r368518 | lebedevri | 2019-08-10 21:28:44 +0200 (Sat, 10 Aug 2019) | 5 lines

[InstCombine] Shift amount reassociation in bittest: drop pointless one-use restriction

That one-use restriction is not needed for correctness - we have already
ensured that one of the shifts will go away, so we know we won't increase

the instruction count. So there is no need for that restriction.

r368519 | lebedevri | 2019-08-10 21:28:54 +0200 (Sat, 10 Aug 2019) | 5 lines

[InstCombine] Shift amount reassociation in bittest: relax one-use check when shifting constant

If one of the values being shifted is a constant, since the new shift
amount is known-constant, the new shift will end up being constant-folded

so, we don't need that one-use restriction then.

r368554 | lebedevri | 2019-08-12 13:28:02 +0200 (Mon, 12 Aug 2019) | 6 lines

[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

llvm-svn: 368673


hanswAug 13 2019, 4:56 AM
rG2c69b1377cb6: Merging r368581: --------------------------------------------------------------…

Event Timeline

lisa6jones6 raised a concern with this commit.Aug 13 2019, 5:26 AM
lisa6jones6 added a subscriber: lisa6jones6.
This comment was removed by asl.
This commit now has outstanding concerns.Aug 13 2019, 5:26 AM
asl added a subscriber: asl.
asl removed a subscriber: lisa6jones6.
This commit no longer requires audit.Aug 13 2019, 2:14 PM