Can figure out some of the upper bits (similiar to udiv) if we know
the sign of the inputs.
As well, if we have the exact flag we can sometimes determine some
low-bits.
Differential D150093
[KnownBits] Add implementation for `KnownBits::sdiv` goldstein.w.n on May 7 2023, 11:57 PM. Authored by
Details Can figure out some of the upper bits (similiar to udiv) if we know As well, if we have the exact flag we can sometimes determine some
Diff Detail
Event TimelineComment Actions FWIW, if we know the sign bits of sdiv, we should really always be converting it to udiv. We actually already do this in CVP, and should also implement the same in InstCombine. It currently only handles the non-negative case, but the others can be implemented by adding the necessary negations. Comment Actions I saw that. It increases instruction count though. It's also hard to undo in the backend and results in worse codegen. I was planning to make a patch to actually stop doing it for non-constant operands because of that. Comment Actions Sorry I'm late.
Comment Actions Shoot, this has already been pushed. Would you like me to create a follow up patch? (likewise for the udiv patch). Comment Actions Sure, unless you think the changes are trivial enough not to need (pre-commit) review. |
Typo "Equivalent"