[InstCombine] complete (X << Z) / (Y << Z) --> X / Y
authorChenbing Zheng <Chenbing.Zheng@streamcomputing.com>
Fri, 23 Dec 2022 03:51:20 +0000 (11:51 +0800)
committerBen Shi <powerman1st@163.com>
Fri, 23 Dec 2022 03:56:52 +0000 (11:56 +0800)
commitbff1f8c79beeb8f83b37be1fb23fa44330799250
tree14000aa831cf98023136d175adcf8fa6bab14ecc
parent0224bdce9263b74806b94426b33e97e030ab7a79
[InstCombine] complete (X << Z) / (Y << Z) --> X / Y

Add one more situations for this fold.
For unsigned div, 'nsw' on both shifts + 'nuw' on the dividend.

Alive2: https://alive2.llvm.org/ce/z/sELF76

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D139997
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/div-shift.ll