summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCameron McInally <cameron.mcinally@nyu.edu>2019-05-20 21:00:42 +0000
committerCameron McInally <cameron.mcinally@nyu.edu>2019-05-20 21:00:42 +0000
commit8bec58d5f72e1d6c6f1fe5931e49755e9eabe38f (patch)
tree7991babba08b765d50034b0fc7f018fa02e745ce /llvm/lib
parentac5c8318d76943a4667685a9940b6a5f4a035168 (diff)
downloadbcm5719-llvm-8bec58d5f72e1d6c6f1fe5931e49755e9eabe38f.tar.gz
bcm5719-llvm-8bec58d5f72e1d6c6f1fe5931e49755e9eabe38f.zip
[NFC][InstCombine] Add FIXME for one-use check on constant negation transforms.
llvm-svn: 361197
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
index 421d49fdcb7..2d608e74b69 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -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)
OpenPOWER on IntegriCloud