[clang] [clang] Set FPOptions at the beginning of CompoundStmt (PR #111654)
Serge Pavlov via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 18 05:55:05 PST 2024
spavloff wrote:
`FPOptions` were added to `CompoundStmt` to help code generation for `#pragma STDC FENV_ROUND`. If dynamic rounding is used, compiler should emit a code that switch it. There is no AST nodes for pragmas, so there is no a good place to emit such code. To solve this problem CompoundStmt was allowed to have FPOption, although it is not an expression.
This patch is a part of https://github.com/llvm/llvm-project/pull/89617, which only sets FPOptions for statements inside a compound statement that do not have FPOptions attached.
Now fast-math flags may be attached to SelectInst and PHINode, so at some point someone could want to attach FPOptions to, say, IfStmt or any other control statement. This solution hopefully could help preventing from adding FPOptions to the nodes that are not floating-point operations.
https://github.com/llvm/llvm-project/pull/111654
More information about the cfe-commits
mailing list