[PATCH] D87200: [SelectionDAGBuilder] Pass fast math flags to getNode calls rather than trying to set them after the fact.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 06:21:12 PDT 2020


spatel added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5010
       // error 0.0049451742, which is more than 7 bits
       SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
                                getF32Constant(DAG, 0xbeb08fe0, dl));
----------------
spatel wrote:
> craig.topper wrote:
> > spatel wrote:
> > > Should use the incoming Flags on all created nodes now.
> > Can we do that in a follow up? There's a quite a bit of code in these approximations. Adding the flags could enable FMA formation or reassociation that we weren't doing before.
> Yes - but on 2nd thought, we probably shouldn't do that on any of these expansions. IIRC, we had to undo the FMF propagation on some of the x86 cast expansions to avoid bungling the expected bit-hacks. We should just assume these expansions are the best as-is.
Could still update the TODO comments though - ie, we are now intentionally not propagating FMF because these are hand-crafted expansions, and we don't expect the code to be altered further.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87200/new/

https://reviews.llvm.org/D87200



More information about the llvm-commits mailing list