[PATCH] D28929: [ConstantFolding] Constant-fold llvm.sqrt(x) like other intrinsics.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 19 17:36:42 PST 2017
efriedma added inline comments.
Comment at: llvm/test/Transforms/InstCombine/constant-fold-math.ll:54
- ret double %x
> efriedma wrote:
> > Leave the test, and just update the CHECK line?
> The CHECK in this case would be checking that the sqrt is not constant-folded. (sqrt(-2) raises an fp exception, and we don't currently constant-fold intrinsics whose libm equivalents raise exceptions.) I didn't think this was an interesting test, because it's a limitation of the compiler that we don't currently constant-fold it, not a correctness issue.
Well, we'd like to know if the compiler is doing something unexpected. We can update the test when we teach the compiler that `sqrt(-1) == NaN`.
More information about the llvm-commits