llvm-project
llvm-project copied to clipboard
clang is suboptimal for `log(pow(x, y))` with fast-math
Test case: https://godbolt.org/z/1fvYPxY37
#include<math.h>
double test1(double x) {
return log(pow(x, -3));
}
double test2(double x) {
return -3 * log(x);
}
My expectation is that the output of test1 will be the same as test2.
@EugeneZelenko Could I be assigned this issue? I'm adding a function to InstCombineMulDivRem.cpp (since that's where other opts relating to pow and exp live) and adding a test for it.