[llvm] [InstCombine] Infer exact division from a known-zero remainder (PR #221509)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 17:53:04 PDT 2026


================
@@ -1801,6 +1834,11 @@ Instruction *InstCombinerImpl::visitUDiv(BinaryOperator &I) {
                                   SQ.getWithInstruction(&I)))
     return replaceInstUsesWith(I, V);
 
+  if (!I.isExact() && isKnownExactFromRem(I, SQ)) {
----------------
ZERICO2005 wrote:

implemented in [44d6afe](https://github.com/llvm/llvm-project/pull/221509/commits/44d6afee5ac7dd69a94e99e8b65a44276bea73b4)

https://github.com/llvm/llvm-project/pull/221509


More information about the llvm-commits mailing list