[InstCombine] Simplify udiv -> lshr folding
authorNikita Popov <npopov@redhat.com>
Wed, 23 Feb 2022 13:52:56 +0000 (14:52 +0100)
committerNikita Popov <npopov@redhat.com>
Wed, 23 Feb 2022 13:55:23 +0000 (14:55 +0100)
commit5ccb0582c2b199913829d75a1dbbc866a707f400
treed3e30520bdb6082b763b4d5f2d7ab66dd1facdd5
parent82951cfb8a413aab9c4b8aeecbd7475dda8f1fb1
[InstCombine] Simplify udiv -> lshr folding

What we're really doing here is converting Op0 udiv Op1 into
Op0 lshr log2(Op1), so phrase it in that way. Actually pushing
the lshr into the log2(Op1) expression should be seen as a separate
transform.
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/div-shift.ll