[llvm] r361197 - [NFC][InstCombine] Add FIXME for one-use check on constant negation transforms.

Cameron McInally via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 14:00:42 PDT 2019


Author: mcinally
Date: Mon May 20 14:00:42 2019
New Revision: 361197

URL: http://llvm.org/viewvc/llvm-project?rev=361197&view=rev
Log:
[NFC][InstCombine] Add FIXME for one-use check on constant negation transforms.

Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp?rev=361197&r1=361196&r2=361197&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp Mon May 20 14:00:42 2019
@@ -1830,6 +1830,8 @@ static Instruction *foldFNegIntoConstant
   // Fold negation into constant operand. This is limited with one-use because
   // fneg is assumed better for analysis and cheaper in codegen than fmul/fdiv.
   // -(X * C) --> X * (-C)
+  // FIXME: It's arguable whether these should be m_OneUse or not. The current
+  // belief is that the FNeg allows for better reassociation opportunities.
   if (match(&I, m_FNeg(m_OneUse(m_FMul(m_Value(X), m_Constant(C))))))
     return BinaryOperator::CreateFMulFMF(X, ConstantExpr::getFNeg(C), &I);
   // -(X / C) --> X / (-C)




More information about the llvm-commits mailing list