[InstCombine] Optimize ceil division idiom #95652
Labels
llvm:instcombine
missed-optimization
wontfix
Issue is real, but we can't or won't fix it. Not invalid
https://alive2.llvm.org/ce/z/Lo75y7
We could optimize
Bias = X != 0; (X - Bias) / Y + Bias
to the more efficient(X + Y - 1) / Y
if we know that the addition cannot overflow.Probably the more important case is where the udiv is a lshr instead, as that's where the relative overhead is higher.
The text was updated successfully, but these errors were encountered: