[llvm] [InstCombine]: Eliminate redundant modulus for urem (PR #157644)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 9 06:24:28 PDT 2025


================
@@ -2473,6 +2473,18 @@ Instruction *InstCombinerImpl::visitURem(BinaryOperator &I) {
     }
   }
 
+  if (ConstantInt *Op1Cst = dyn_cast<ConstantInt>(Op1)) {
----------------
nikic wrote:

Use `m_APInt` for this one as well, and add a test with splat vectors.

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


More information about the llvm-commits mailing list