[PATCH] D50913: [FPEnv] Don't need copysign/fabs/fneg constrained intrinsics

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 07:43:41 PDT 2018


kpn added a comment.

In https://reviews.llvm.org/D50913#1205893, @cameron.mcinally wrote:

> I'm looking into the FNEG handling and found one bad xform in llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:
>
> // Expand Y = FNEG(X) ->  Y = SUB -0.0, X
>
> That's not necessarily a show-stopper though. We could change this code to do a bitwise operation instead. That may even be faster than a FSUB, depending on the target of course.


If SelectionDAG refuses to create an FNEG node when it see a constrained fsub, and the SDAG optimizations and legalizations are the same, then this shouldn't be an issue. If the fsub that led to the FNEG node was not constrained in the first place then this seems like a valid transform.


Repository:
  rL LLVM

https://reviews.llvm.org/D50913





More information about the llvm-commits mailing list