[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 14:16:32 PDT 2022


efriedma added a comment.

I hate trying to reason about this stuff.

The intrinsics for sqrt/sin/cos/pow/exp/exp2/log/log2/log10 are theoretically supposed to not write to errno, but in practice they do because we call the libc implementations.  So even though this is safe in theory, in practice it could cause a miscompile (if we hoist a sqrt operation past a load from errno).  Not sure what, if anything, we should do about this.


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

https://reviews.llvm.org/D129155



More information about the llvm-commits mailing list