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

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 06:19:42 PDT 2015


mcrosier added a subscriber: mcrosier.
mcrosier added a comment.

Trivial nits.


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1150
@@ +1149,3 @@
+
+  // Only in fast-math mode, generate repeated fmul
+  // instead of generating pow(x, n).
----------------
Maximize 80-column here.

================
Comment at: test/Transforms/InstCombine/pow-4.ll:9
@@ +8,3 @@
+; Function Attrs: nounwind readnone
+declare double @llvm.pow.f64(double, double) #1
+declare float @llvm.pow.f32(float, float) #1
----------------
I don't see the attributes associated with #1 anywhere, so it's probably safe to drop the #1 here.

================
Comment at: test/Transforms/InstCombine/pow-4.ll:30
@@ +29,3 @@
+; CHECK-NEXT: ret double %2
+  %1 = tail call double @llvm.pow.f64(double %x, double 3.000000e+00)
+  ret double %1
----------------
I believe you can safely drop the tail marker (i.e., tail call -> call).  There are many instances of this.


http://reviews.llvm.org/D13994





More information about the llvm-commits mailing list