[InstCombine] Transform `icmp eq/ne ({su}div exact X,Y),C` -> `icmp eq/ne X, Y*C`
We can do this if `Y*C` doesn't overflow. This is trivial if `C` is
0/1. Otherwise we actually generate a `mul` instruction iff the `div`
has one use.
Alive2 Links:
udiv: https://alive2.llvm.org/ce/z/GWPW67
sdiv: https://alive2.llvm.org/ce/z/bUoX9h
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D150091
parent
fd691fce
Please register or sign in to comment