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

David Stuttard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 13 01:19:13 PDT 2018


dstuttard marked an inline comment as done.
dstuttard added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:6655
+    SDValue MulVal = DAG.getNode(ISD::FMUL, DL, VT, Arg,
+                                 DAG.getConstantFP(0.5 / M_PI, DL, VT));
+    TrigVal = DAG.getNode(AMDGPUISD::FRACT, DL, VT, MulVal);
----------------
arsenm wrote:
> Avoid repeating the same constant.
> 
> Also we should stop relying on system headers for these constants
Re system headers - why, are you concerned that M_PI may differ between compilers?
Can we defer removing reliance on system headers to a separate change that does this globally?


Repository:
  rL LLVM

https://reviews.llvm.org/D51933





More information about the llvm-commits mailing list