[llvm] [InstCombine] Handle more even/odd math functions (PR #81324)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 15:18:43 PST 2024


================
@@ -2797,6 +2797,21 @@ static bool insertSinCosCall(IRBuilderBase &B, Function *OrigCallee, Value *Arg,
   return true;
 }
 
+Value *LibCallSimplifier::optimizeSymmetric(CallInst *CI, bool IsEven,
+                                            IRBuilderBase &B) {
+  Value *X;
+  if (match(CI->getArgOperand(0), m_OneUse(m_FNeg(m_Value(X))))) {
----------------
dtcxzyw wrote:

Please add a test for the multi-use case.

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


More information about the llvm-commits mailing list