[PATCH] D120150: Constant folding of llvm.amdgcn.trig.preop

Ravi Korsa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 11:42:38 PDT 2022


Ravi marked 6 inline comments as done.
Ravi added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp:1013
+        Scale += 128;
+      Res = ldexp(Res, Scale);
+      return IC.replaceInstUsesWith(II, ConstantFP::get(Src->getType(), Res));
----------------
arsenm wrote:
> Ravi wrote:
> > arsenm wrote:
> > > You can use scalbn for APFloat instead of relying on host ldexp
> > Yes..will try it out and check for any precision difference. Should be good as long as the internal implementation of APFloat is within 0.5 ULP.
> Actually we should be constant folding the ldexp intrinsic too. I thought I did that before, but in the code above I don't see it handling arbitrary constants
Can be done in another patch


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120150



More information about the llvm-commits mailing list