[PATCH] D129155: [InstCombine][SimplifyLibCalls] convert sqrt libcalls with "nnan" to sqrt intrinsics

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 16:01:11 PDT 2022


efriedma added a comment.

> Are we already exposed to that problem in a bigger way when the front-end creates intrinsics too?

Sort of.  clang generally won't create calls to llvm.sqrt if -fmath-errno is enabled (which is the default on targets where sqrt sets errno).  clang will create intrinsics with -ffast-math, though.  And other frontends probably just blindly call the intrinsic.

> Do you see any potential miscompiles if we use that hook to guard the transform?

That's probably safe enough.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129155/new/

https://reviews.llvm.org/D129155



More information about the llvm-commits mailing list