[llvm] [InstCombine] Detect uadd with overflow idiom (PR #140178)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 10 14:10:20 PDT 2025
================
@@ -6515,72 +6515,76 @@ bool InstCombinerImpl::OptimizeOverflowCheck(Instruction::BinaryOps BinaryOp,
llvm_unreachable("Unexpected overflow result");
}
-/// Recognize and process idiom involving test for multiplication
+/// Recognize and process idiom involving test for unsigned
/// overflow.
///
/// The caller has matched a pattern of the form:
+/// I = cmp u (add(zext A, zext B), V
/// I = cmp u (mul(zext A, zext B), V
/// The function checks if this is a test for overflow and if so replaces
-/// multiplication with call to 'mul.with.overflow' intrinsic.
+/// addition/multiplication with call to the right intrinsic.
///
/// \param I Compare instruction.
-/// \param MulVal Result of 'mult' instruction. It is one of the arguments of
+/// \param Val Result of add/mul instruction. It is one of the arguments of
/// the compare instruction. Must be of integer type.
----------------
AZero13 wrote:
Done!
https://github.com/llvm/llvm-project/pull/140178
More information about the llvm-commits
mailing list