[PATCH] D28508: [NVPTX] Lower to sqrt.approx and rsqrt.approx under more circumstances.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 19:41:56 PST 2017


mehdi_amini added a comment.

In https://reviews.llvm.org/D28508#644720, @jlebar wrote:

> > Technically I don't think it is correct for your patch to lower llvm.sqrt (with the FMF) to PTX sqrt.approx, because "The maximum absolute error for sqrt.f32 is TBD."
>
> The patch only does this transformation with fastmath enabled (or if you pass a special flag to llvm that specifically asks for this transformation):


Ah, good :)

I didn't read the patch, just the discussion, and misunderstood.



================
Comment at: llvm/lib/Target/NVPTX/NVPTXInstrInfo.td:932
+// F32 rsqrt.  When do_SQRTF32_APPROX and do_DIVF32_APPROX are enabled, we can
+// transform 1.0f/sqrt(x) into rsqrt.approx.f32.
+//
----------------
I have to say that I find amazing that someone if finally documenting the backend table gen, this has always driven me crazy :)


https://reviews.llvm.org/D28508





More information about the llvm-commits mailing list