diff options
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp index 123f810..dd4a640 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp @@ -2719,8 +2719,10 @@ Instruction *InstCombinerImpl::hoistFNegAboveFMulFDiv(Value *FNegOp, Instruction &FMFSource) { Value *X, *Y; if (match(FNegOp, m_FMul(m_Value(X), m_Value(Y)))) { + // Push into RHS which is more likely to simplify (const or another fneg). + // FIXME: It would be better to invert the transform. return cast<Instruction>(Builder.CreateFMulFMF( - Builder.CreateFNegFMF(X, &FMFSource), Y, &FMFSource)); + X, Builder.CreateFNegFMF(Y, &FMFSource), &FMFSource)); } if (match(FNegOp, m_FDiv(m_Value(X), m_Value(Y)))) { |