[PATCH] Handle sqrt() shrinking in SimplifyLibCalls like any other call

hfinkel at anl.gov hfinkel at anl.gov
Thu Oct 23 11:01:53 PDT 2014


> No functional change intended, but I loosened the restriction on the existing sqrt testcases to allow for this optimization even without unsafe-fp-math because that's the existing behavior.

Please don't loosen this for the function call (although leave it as-is for the intrinsic). The intrinsic is different here, especially because it is defined to have different semantics than the function call, but we should not change the function call itself without fast-math enabled. The underlying issue is that (float) sqrt(x) != sqrtf(x) in general because of rounding issues (and on some systems, the sqrtf is not exactly 1ulp accurate), and we should not alter that without fast-math enabled.

http://reviews.llvm.org/D5919






More information about the llvm-commits mailing list