[PATCH] D13994: Optimization for pow(x, n) where n is some constant

Mandeep Singh Grang via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 12:16:13 PDT 2015


mgrang marked 7 inline comments as done.

================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1157
@@ +1156,3 @@
+      for (unsigned Exp = 2; Exp <= PowerOptThreshold; ++Exp) {
+        if (Op2C->isExactlyValue(Exp) || Op2C->isExactlyValue((int)-Exp)) {
+          Value *FMul = getPow(Op1, Exp, B);
----------------
I limit the PowerOptThreshold so that we don't run into this issue. 


http://reviews.llvm.org/D13994





More information about the llvm-commits mailing list