[all-commits] [llvm/llvm-project] ef110a: [Builtins] Do not claim most libfuncs are readnone...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Thu Aug 11 04:29:33 PDT 2022
Author: Florian Hahn <flo at fhahn.com>
Date: 2022-08-11 (Thu, 11 Aug 2022)
[Builtins] Do not claim most libfuncs are readnone with trapping math.
At the moment, Clang only considers errno when deciding if a builtin
is const. This ignores the fact that some library functions may raise
floating point exceptions, which may modify global state, e.g. when
updating FP status registers.
To model the fact that some library functions/builtins may raise
floating point exceptions, this patch adds a new 'g' modifier for
builtins. If a builtin is marked with 'g', it cannot be considered
const, unless FP exceptions are ignored.
So far I've not added CHECK lines for all calls in math-libcalls.c. I'll
do that once we agree on the overall direction.
A consequence seems to be that we fail to select some of the constrained
math builtins now, but I am not entirely sure what's going on there.
Reviewed By: john.brawn
Differential Revision: https://reviews.llvm.org/D129231
More information about the All-commits