[llvm] [FPEnv] Add strictfp attribute to the FP environment manipulation intrinsics (PR #96093)
Kevin P. Neal via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 10:21:17 PDT 2024
https://github.com/kpneal created https://github.com/llvm/llvm-project/pull/96093
The constrained intrinsics already have strictfp added in the tablegen definitions. These environment manipulation intrinsics should as well since they touch the FP environment.
No change in visible behavior, and calls to them won't need the strictfp attribute because it was already added here. Existing tests don't need to be changed because calls from non-strictfp function to strictfp functions are allowed.
>From f3026fe0abd9e53eb1f2866ce73c11ffdce7efa6 Mon Sep 17 00:00:00 2001
From: "Kevin P. Neal" <kevin.neal at sas.com>
Date: Wed, 19 Jun 2024 13:04:55 -0400
Subject: [PATCH] [FPEnv] Add strictfp attribute to the FP environment
manipulation intrinsics.
The constrained intrinsics already have strictfp added in the tablegen
definitions. These environment manipulation intrinsics should as well
since they touch the FP environment.
---
llvm/include/llvm/IR/Intrinsics.td | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index ef500329d1fb9..696641ab20d6d 100644
--- a/llvm/include/llvm/IR/Intrinsics.td
+++ b/llvm/include/llvm/IR/Intrinsics.td
@@ -1093,7 +1093,11 @@ def int_objectsize : DefaultAttrsIntrinsic<[llvm_anyint_ty],
//===--------------- Access to Floating Point Environment -----------------===//
//
-let IntrProperties = [IntrInaccessibleMemOnly, IntrWillReturn] in {
+/// IntrStrictFP - The intrinsic is allowed to be used in an alternate
+/// floating point environment or touches the current one.
+def IntrStrictFP : IntrinsicProperty;
+
+let IntrProperties = [IntrInaccessibleMemOnly, IntrWillReturn, IntrStrictFP] in {
def int_get_rounding : DefaultAttrsIntrinsic<[llvm_i32_ty], []>;
def int_set_rounding : DefaultAttrsIntrinsic<[], [llvm_i32_ty]>;
def int_get_fpenv : DefaultAttrsIntrinsic<[llvm_anyint_ty], []>;
@@ -1115,10 +1119,6 @@ def int_is_fpclass
//===--------------- Constrained Floating Point Intrinsics ----------------===//
//
-/// IntrStrictFP - The intrinsic is allowed to be used in an alternate
-/// floating point environment.
-def IntrStrictFP : IntrinsicProperty;
-
let IntrProperties = [IntrInaccessibleMemOnly, IntrWillReturn, IntrStrictFP] in {
def int_experimental_constrained_fadd : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ],
[ LLVMMatchType<0>,
More information about the llvm-commits
mailing list