Certain math libcalls, such as acos and exp, only modify the global variable errno. This automatically adds the globalmemonly attribute to those calls. One use case is in removing unnecessary loads of the call arguments, since the calls will have no side-effects on them.
Is it safe to assume that errno is a "global value" in the LLVM sense? For example, here's how the musl implementation looks like: https://github.com/ifduyue/musl/blob/master/src/errno/__errno_location.c I believe C only requires that errno expands to a thread-local modifiable lvalue, but it does not necessarily have to correspond to a global.