[llvm] [FPEnv] Add strictfp attribute to the FP environment manipulation intrinsics (PR #96093)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 01:11:29 PDT 2024


arsenm wrote:

I think there are a few problems here and we can't just do this as-is.

This is going to have actual user code just hit the IR verifier error. In the real world people do not enable strictfp before calling these type of functions (also, we really should have a warning about using these).

Target intrinsic or asm calls that can also sometimes change the rounding mode also won't be covered. It's probably best to keep these cases consistent with the standard setting intrinsics. If we really need the attribute, it can be on the call site. 

> Does or should any backend require the strictfp attribute on a call to retrieve the rounding mode or any of the other FP environment state that isn't a "status flag"?

I don't see how it could be required. It's the same as any other read-from-unspecified-memory operation 




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


More information about the llvm-commits mailing list