[PATCH] D64099: [InstCombine] pow(C,x) -> exp2(log2(C)*x)

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 15:48:16 PDT 2019


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


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1354
+    Value *LogC =
+        emitUnaryFloatFnCall(ConstantFP::get(Ty, *BaseF), "log", B, Attrs);
+    Value *FMul = B.CreateFMul(LogC, Expo, "logmul");
----------------
xbolva00 wrote:
> efriedma wrote:
> > I'd rather explicitly fold the "log" here, so we know it actually happens; the constant folding code will not fold it in all cases.
> emitUnaryFloatFnCall automatically folds it? @spatel @lebedev.ri 
> 
> Not sure how to get log2 of APFloat...
Ah, right. It was constant folded only in “fast” mode..


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

https://reviews.llvm.org/D64099





More information about the llvm-commits mailing list