[PATCH] D51933: [AMDGPU] Ensure trig range reduction only used for subtargets that require it

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 12 03:42:08 PDT 2018


nhaehnle accepted this revision.
nhaehnle added a comment.
This revision is now accepted and ready to land.

One nitpick, apart from that LGTM.



================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:6653-6661
+  if (Subtarget->hasTrigReducedRange()) {
+    TrigVal = DAG.getNode(AMDGPUISD::FRACT, DL, VT,
+                          DAG.getNode(ISD::FMUL, DL, VT, Arg,
+                                      DAG.getConstantFP(0.5 / M_PI, DL,
+                                                        VT)));
+  } else {
+    TrigVal = DAG.getNode(ISD::FMUL, DL, VT, Arg,
----------------
Factor out the FMUL part so that it's more obvious that the only difference is in the FRACT?


Repository:
  rL LLVM

https://reviews.llvm.org/D51933





More information about the llvm-commits mailing list