[PATCH] D28335: [WIP] [RFC] Don't lower floating point intrinsics to libcalls which modify errno

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 16:50:16 PST 2017


hfinkel added a comment.

> sqrt(), sin(), cos(), pow(), exp(), exp2(), log(), log2(), and log10() are not available in variants which don't set errno on glibc (and maybe other more obscure platforms), so don't claim they're universally available in TargetLowering.cpp. Then fix LangRef to make it obvious that they in fact have no side-effects, and get rid of the silly sqrt() special-case.

I fully support work in this direction; we definitely need to fix this up.

We also do need to model errno, however, or provide compiler-rt wrappers,etc. so that we can really use -fno-math-errno on systems where the math functions really do set errno and not miscompile code by reordering calls to math functions with calls to other functions (e.g. open, read) that set errno and where errno is later used (e.g. by perror).


Repository:
  rL LLVM

https://reviews.llvm.org/D28335





More information about the llvm-commits mailing list