[clang] [clang] Allow `ConditionalOperator` fast-math flags to be overridden by `pragma float_control` (PR #105912)

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 8 02:59:53 PDT 2024


spavloff wrote:

> Any instruction that returns a floating-point value can have fast-math flags attached to it, and because we need to check the fast-math flags on input operands, the select instruction generated by the conditional operator needs the flags set when fast-math is enabled. That's happening in the general case, but it isn't currently being modified correctly in the presence of pragmas.

Clang should not need similar workaround. FP pragmas have block scope, so their effect should be recorded in CompoundStmt. When entering this scope IRBuilder must be tuned according to FPOptions, stored in CompoundStmt. Now the code that tunes IRBuilder is absent, if we add it, it should implement the required behavior.


https://github.com/llvm/llvm-project/pull/105912


More information about the cfe-commits mailing list