[InstCombine] fold exact sdiv to ashr (2nd try)
The 1st attempt failed to updated the test checks as expected. Original commit message: sdiv exact X, (1<<ShAmt) --> ashr exact X, ShAmt (if shl is non-negative) https://alive2.llvm.org/ce/z/kB6VF7 It would probably be better to use ValueTracking to replace this and the existing transform above it, but the analysis does not account for the no-wrap properly, and it's not immediately clear to me how to fix it.
Loading
Please sign in to comment