Alive2: https://alive2.llvm.org/ce/z/CBJLeP
Note that both shl and mul require nuw and already
have negtive test cases in div-shift.ll for it.
Differential D139598
[InstCombine] Fold (X << Z) / (X * Y) -> (1 << Z) / Y Chenbing.Zheng on Dec 7 2022, 6:00 PM. Authored by
Details Alive2: https://alive2.llvm.org/ce/z/CBJLeP Note that both shl and mul require nuw and already
Diff Detail
Event Timeline
|
Do you plan to handle the signed case too?
I'm not sure exactly what no-wrap is required, but there is some combination that works, so add a TODO comment:
https://alive2.llvm.org/ce/z/WrXmth