[llvm] [InstCombine] Simplify compare abs(X) and X. (PR #76385)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 29 04:41:27 PST 2023


================
@@ -7109,6 +7109,47 @@ Instruction *InstCombinerImpl::visitICmpInst(ICmpInst &I) {
     }
   }
 
+  {
+    Value *X;
+    Constant *C;
+    if (match(Op0, m_OneUse(m_Intrinsic<Intrinsic::abs>(m_Value(X),
----------------
dtcxzyw wrote:

I think we can drop the one-use constraint as we never create more than one instruction.
 

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


More information about the llvm-commits mailing list