[PATCH] D50113: [SLC] Fix shrinking of pow()

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 14:23:33 PDT 2018


efriedma added a comment.

I'd like to get this right... both the CheckRetType check, and the "infinite loop" check from optimizeUnaryDoubleFP are probably relevant.  Can we share code between the two functions?

Maybe the CheckRetType check isn't critical if we're only doing this transform by default when afn is enabled, but it's still losing a lot of bits, particularly if the input is supposed to be an exact number.  `pow(2.f, 0.5f)` is a lot different from `(double)powf(2.f, 0.5f)`.

(If you want to fix the potential miscompile for 7.0, I'd accept a patch to just completely disable shrinking for pow.)


https://reviews.llvm.org/D50113





More information about the llvm-commits mailing list