[PATCH] D34844: [AMDGPU] Always use rcp + mul with fast math

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 20:17:14 PDT 2017


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:3780
     SDNodeFlags NewFlags;
     NewFlags.setUnsafeAlgebra(true);
     SDValue Recip = DAG.getNode(AMDGPUISD::RCP, SL, VT, RHS);
----------------
arsenm wrote:
> rampitec wrote:
> > rampitec wrote:
> > > rampitec wrote:
> > > > arsenm wrote:
> > > > > This is a possible source of errors now that less-strict flags can now trigger this
> > > > That is the intent to trigger this. That is how HSAIL compiler works and we had no complaints so far. Anyway, I am running confirmance now.
> > > > 
> > > > A philosophical question though what shall preval, unsafe fp or denorm support. Once again, HSAIL favors relaxation, so I did the same.
> > > > 
> > > > In fact this implementation is stricter than one we have in HSAIL. We were applying options to library as well, while here it is only applied to user code.
> > > Actually fp denorms are not supported with 2.5 ulp fdiv even now, so there is no change in this respect.
> > JFYI. OCL conformance passed.
> Adding unsafe algebra to the node from just arcp is incorrect. I wouldn't expect this to show up in conformance, this could potentially introduce unsafe algebraic transforms in use instructions.This should at most preserve the original set of math flags, not promote them.
Strange that was not noticed when this code was written. Fixed.


https://reviews.llvm.org/D34844





More information about the llvm-commits mailing list