[llvm] [InstSimplify] Add simplification for `({u,s}rem (mul {nuw,nsw} X, C1), C0)` (PR #97037)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 06:46:45 PDT 2024


================
@@ -1233,6 +1233,19 @@ static Value *simplifyRem(Instruction::BinaryOps Opcode, Value *Op0, Value *Op1,
         match(Op0, m_NUWShl(m_Specific(Op1), m_Value())))))
     return Constant::getNullValue(Op0->getType());
 
+  const APInt * C0;
+  if (match(Op1, m_APInt(C0))) {
----------------
nikic wrote:

Missing Q.IIQ.UseInstrInfo check.

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


More information about the llvm-commits mailing list