[PATCH] D62629: [InstCombine] Update fptrunc (fneg x)) -> (fneg (fptrunc x) for unary FNeg
Cameron McInally via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 29 14:22:09 PDT 2019
cameron.mcinally created this revision.
cameron.mcinally added reviewers: spatel, craig.topper, arsenm, kpn, andrew.w.kaylor.
Herald added subscribers: llvm-commits, hiraditya, wdng.
Herald added a project: LLVM.
craig.topper added inline comments.
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:1625
+ Value *InnerTrunc = Builder.CreateFPTrunc(X, Ty);
+ return BinaryOperator::CreateFNegFMF(InnerTrunc, cast<Instruction>(Op));
If you started with a unary fneg, shouldn't we end up with a unary fneg?
Move the binary FNEG combine so that it also applies to unary FNeg.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5385 bytes
Desc: not available
More information about the llvm-commits