[PATCH] D14045: [SimplifyLibCalls] Add a new transform: pow(exp(x), y) -> exp(x*y)

Steve Canon via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 07:28:07 PDT 2015


scanon added a comment.

As suggested by David, this should be fast-math only.  It's roughly equivalent to re-association of multiplication. Besides rounding differences, this changes overflow and underflow behavior quite dramatically.  Consider x = 1000, y = 0.001.  pow(exp(x), y) = pow(inf, 0.001) = inf, whereas exp(x*y) = exp(1).

Also, this should really be generalized to apply to exp2 and exp10 as well as exp.


http://reviews.llvm.org/D14045





More information about the llvm-commits mailing list