]> granicus.if.org Git - llvm/commitdiff
[NFC][InstCombine] Add FIXME for one-use check on constant negation transforms.
authorCameron McInally <cameron.mcinally@nyu.edu>
Mon, 20 May 2019 21:00:42 +0000 (21:00 +0000)
committerCameron McInally <cameron.mcinally@nyu.edu>
Mon, 20 May 2019 21:00:42 +0000 (21:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361197 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineAddSub.cpp

index 421d49fdcb7076b935ab995d2a838d39db76a3ff..2d608e74b69a229eec493cca7bb70092f0e6ac73 100644 (file)
@@ -1830,6 +1830,8 @@ static Instruction *foldFNegIntoConstant(Instruction &I) {
   // 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)