This patch as is depends on the addition of a write_only attribute in clang: https://reviews.llvm.org/D46313
This patch will add the write_only attribute to libm functions when we care about errno, with the intent of eventually enabling CSE and Hoisting of WriteOnly functions when it is safe to do so.
The LLVM WriteOnly attribute could be added directly without adding a write_only, though it seems beneficial to expose the attribute to users.
Can we reasonably unify these three blocks? Like maybe: