[PATCH] D28797: [LangRef] Make @llvm.sqrt(x) return undef, rather than have UB, for negative x.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 12:08:07 PST 2017


efriedma added a comment.

> We can lower it to if (x >= -0) libm_sqrt(x) else NaN?

That would be correct.  It's not particularly efficient, but that's not important as long as we aren't unconditionally transforming @sqrt() to @llvm.sqrt().


https://reviews.llvm.org/D28797





More information about the llvm-commits mailing list