[llvm] b06568f - [FPEnv][llvm-reduce] Correct strictfp test.

Kevin P. Neal via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 05:13:24 PST 2024


Author: Kevin P. Neal
Date: 2024-02-06T08:12:50-05:00
New Revision: b06568fa623c746d40638137504d52e19911bf32

URL: https://github.com/llvm/llvm-project/commit/b06568fa623c746d40638137504d52e19911bf32
DIFF: https://github.com/llvm/llvm-project/commit/b06568fa623c746d40638137504d52e19911bf32.diff

LOG: [FPEnv][llvm-reduce] Correct strictfp test.

Correct llvm-reduce strictfp test to follow the rules documented in the
LangRef:
https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics

This test needed the strictfp attribute added to a function call.

Note that attributes of intrinsics cannot be changed in declarations,
but attributes can be changed in call sites. Thus the changes to the
declarations. And the constrained intrinsics have strictfp attributes
by default.

Test changes verified with D146845.

Added: 
    

Modified: 
    llvm/test/tools/llvm-reduce/remove-attributes-strictfp.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-reduce/remove-attributes-strictfp.ll b/llvm/test/tools/llvm-reduce/remove-attributes-strictfp.ll
index 8607aae9dda2e..cdb17d2d5321d 100644
--- a/llvm/test/tools/llvm-reduce/remove-attributes-strictfp.ll
+++ b/llvm/test/tools/llvm-reduce/remove-attributes-strictfp.ll
@@ -28,7 +28,7 @@ define float @strictfp_declaration(float %x, float %y) #0 {
 ; CHECK-LABEL: define float @strictfp_no_constrained_ops(float %x, float %y)
 ; RESULT-SAME: [[STRICTFP_ONLY]] {
 define float @strictfp_no_constrained_ops(float %x, float %y) #0 {
-  %val = call float @llvm.copysign.f32(float %x, float %y)
+  %val = call float @llvm.copysign.f32(float %x, float %y) #1
   ret float %val
 }
 
@@ -38,11 +38,10 @@ declare float @strict.extern.func(float, float) #0
 
 declare float @extern.func(float, float)
 
-declare float @llvm.copysign.f32(float, float) #1
-declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata) #2
+declare float @llvm.copysign.f32(float, float)
+declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata)
 
 ; RESULT: attributes [[STRICTFP_ONLY]] = { strictfp }
 
 attributes #0 = { nounwind strictfp }
-attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
-attributes #2 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
+attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) strictfp }


        


More information about the llvm-commits mailing list