[PATCH] D80702: [AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 02:41:08 PDT 2020


foad marked 2 inline comments as done.
foad added inline comments.


================
Comment at: llvm/test/Analysis/ConstantFolding/AMDGPU/sin.ll:174
+  store volatile double %ninf, double* %p
+  %nan = call double @llvm.amdgcn.sin.f64(double 0x7FF8000000000000) ; nan
+  store volatile double %nan, double* %p
----------------
arsenm wrote:
> foad wrote:
> > arsenm wrote:
> > > Also should test snan -> qnan (this also won't happen for !ieee_mode, so this case should depend on strictfp also)
> > All of the FP constant folding code is skipped for infinities and nans so there's not much to check. (I didn't really mean to add any of these inf and nan checks here, just carelessly cut n pasted from another test.)
> That would be a bug, since I would expect them to fold too
A missed optimization perhaps, but it's always been like that for all math intrinsics, so I don't plan to fix it as part of this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80702





More information about the llvm-commits mailing list