[CIR] Move FP state tracking out of the builder
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
The initial implementation of strict FP handling followed the classic codegen model of tracking the constrained floating point state in the builder. After some discussion during review, we decided that it would be much better to maintain this state in the CIRGenFunction object but that this could be done as a follow-up change after the initial implementation was in place.
Having the state in the builder allows the codegen to passively inherit the current state, which is maintained using RAII objects. However, this state doesn't really belong in the builder and this approach leaves a significant hole in that operations can be built directly (via Op::create) and bypass the state. In order to force implementers to consider the FP state, all create functions for operations that may have an Fenv agttribute should have a required parameter that is either null or the required state.
Contributor guide
Assessment
This issue has not been assessed yet.