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

Evandro Menezes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 15:37:20 PDT 2020


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

LGTM



================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1551
       Value *FMul = B.CreateFMul(Expo, ConstantFP::get(Ty, N), "mul");
       if (Pow->doesNotAccessMemory())
         return B.CreateCall(Intrinsic::getDeclaration(Mod, Intrinsic::exp2, Ty),
----------------
foad wrote:
> lebedev.ri wrote:
> > Was this previously reachable?
> Yes whenever we try to optimize a call to the llvm.pow intrinsic on a target that also has the pow libfunc available.
This can probably be cached into a variable at the top of the function.


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