[PATCH] D79321: [SLC] Allow llvm.pow(2**n,x) -> llvm.exp2(n*x) even if no exp2 lib func

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 06:54:38 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1537-1538
   // pow(2.0 ** n, x) -> exp2(n * x)
-  if (hasFloatFn(TLI, Ty, LibFunc_exp2, LibFunc_exp2f, LibFunc_exp2l)) {
+  if (Pow->doesNotAccessMemory() ||
+      hasFloatFn(TLI, Ty, LibFunc_exp2, LibFunc_exp2f, LibFunc_exp2l)) {
     APFloat BaseR = APFloat(1.0);
----------------
I've always hated the way all of this code conflates library functions and intrinsics as if they're interchangeable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79321





More information about the llvm-commits mailing list