[PATCH] D13994: Optimization for pow(x, n) where n is some constant
Mandeep Singh Grang via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 22 18:41:20 PDT 2015
mgrang added inline comments.
================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1077
@@ +1076,3 @@
+ PrevVal = Val;
+ Exp = Exp >> 1;
+ }
----------------
majnemer wrote:
> mgrang wrote:
> > majnemer wrote:
> > > Please don't strength reduce manually.
> > Can you please clarify what do you mean by "don't strength reduce manually".
> Unless I am mistaken, you can rewrite that expression as `Exp / 2`.
Yes, I can rewrite that as Exp / 2 but wouldn't that be slower than Exp >> 1 since the former case would involve generating a div instruction?
Repository:
rL LLVM
http://reviews.llvm.org/D13994
More information about the llvm-commits
mailing list