llvm / llvm/llvm-project

[CIR] Move FP state tracking out of the builder

Open
#213,370 0 comments 0 reactions 1 assignee Claimed by @andykaylor View on GitHub
ClangIR
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.