[llvm] [InstCombine] Simplification for (-a * b) / (a * b) and (a - b) / (b - a). (PR #71768)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 21:37:17 PST 2023
================
@@ -1544,6 +1544,20 @@ Instruction *InstCombinerImpl::visitSDiv(BinaryOperator &I) {
}
}
+ // -(X * Y) / (X * Y) --> -1
+ if ((match(Op0, m_Neg(m_c_Mul(m_Value(X), m_Value(Y)))) &&
----------------
dtcxzyw wrote:
Please move this simplification into `simplifySDivInst`.
https://github.com/llvm/llvm-project/pull/71768
More information about the llvm-commits
mailing list