[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:10:57 PDT 2019


xbolva00 marked 2 inline comments as done.
xbolva00 added a subscriber: lebedev.ri.
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");
----------------
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...


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

https://reviews.llvm.org/D64099





More information about the llvm-commits mailing list