This revision was automatically updated to reflect the committed changes.
Closed by commit rG8b23b2bbd962: [CodeGen] Use CreateFNeg in buildFMulAdd
(authored by craig.topper).
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.or
rjmccall added inline comments.
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3350
+MulOp0 = Builder.CreateFNeg(MulOp0, "neg");
+ if (negAdd)
+Addend = Builder.CreateFNeg(Addend, "neg");
craig.topper wrote:
> I removed the 'else' here because logically
craig.topper marked an inline comment as done.
craig.topper added inline comments.
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3350
+MulOp0 = Builder.CreateFNeg(MulOp0, "neg");
+ if (negAdd)
+Addend = Builder.CreateFNeg(Addend, "neg");
I removed the '
craig.topper created this revision.
craig.topper added reviewers: cameron.mcinally, rjmccall, efriedma, rsmith.
We have an fneg instruction now and should use it instead of the fsub -0.0
idiom. Looks like we had no test that showed that we handled the negation cases
here so I've added new tests.