1 ; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -inline < %s | FileCheck %s
2 ; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -passes='cgscc(inline)' < %s | FileCheck %s
4 ; CHECK-LABEL: @func_no_target_cpu(
5 define i32 @func_no_target_cpu() #0 {
9 ; CHECK-LABEL: @target_cpu_call_no_target_cpu(
10 ; CHECK-NEXT: ret i32 0
11 define i32 @target_cpu_call_no_target_cpu() #1 {
12 %call = call i32 @func_no_target_cpu()
16 ; CHECK-LABEL: @target_cpu_target_features_call_no_target_cpu(
17 ; CHECK-NEXT: ret i32 0
18 define i32 @target_cpu_target_features_call_no_target_cpu() #2 {
19 %call = call i32 @func_no_target_cpu()
23 ; CHECK-LABEL: @fp32_denormals(
24 define i32 @fp32_denormals() #3 {
28 ; CHECK-LABEL: @no_fp32_denormals_call_f32_denormals(
29 ; CHECK-NEXT: call i32 @fp32_denormals()
30 define i32 @no_fp32_denormals_call_f32_denormals() #4 {
31 %call = call i32 @fp32_denormals()
35 ; Make sure gfx9 can call unspecified functions because of movrel
37 ; CHECK-LABEL: @gfx9_target_features_call_no_target_cpu(
38 ; CHECK-NEXT: ret i32 0
39 define i32 @gfx9_target_features_call_no_target_cpu() #5 {
40 %call = call i32 @func_no_target_cpu()
44 define i32 @func_no_halfrate64ops() #6 {
48 define i32 @func_with_halfrate64ops() #7 {
52 ; CHECK-LABEL: @call_func_without_halfrate64ops(
53 ; CHECK-NEXT: ret i32 0
54 define i32 @call_func_without_halfrate64ops() #7 {
55 %call = call i32 @func_no_halfrate64ops()
59 ; CHECK-LABEL: @call_func_with_halfrate64ops(
60 ; CHECK-NEXT: ret i32 0
61 define i32 @call_func_with_halfrate64ops() #6 {
62 %call = call i32 @func_with_halfrate64ops()
66 define i32 @func_no_loadstoreopt() #8 {
70 define i32 @func_with_loadstoreopt() #9 {
74 ; CHECK-LABEL: @call_func_without_loadstoreopt(
75 ; CHECK-NEXT: ret i32 0
76 define i32 @call_func_without_loadstoreopt() #9 {
77 %call = call i32 @func_no_loadstoreopt()
81 define i32 @enable_codeobjectv3() #10 {
85 ; CHECK-LABEL: @disable_codeobjectv3_call_codeobjectv3(
86 ; CHECK-NEXT: ret i32 999
87 define i32 @disable_codeobjectv3_call_codeobjectv3() #11 {
88 %call = call i32 @enable_codeobjectv3()
92 attributes #0 = { nounwind }
93 attributes #1 = { nounwind "target-cpu"="fiji" }
94 attributes #2 = { nounwind "target-cpu"="fiji" "target-features"="+fp32-denormals" }
95 attributes #3 = { nounwind "target-features"="+fp32-denormals" }
96 attributes #4 = { nounwind "target-features"="-fp32-denormals" }
97 attributes #5 = { nounwind "target-cpu"="gfx900" }
98 attributes #6 = { nounwind "target-features"="-half-rate-64-ops" }
99 attributes #7 = { nounwind "target-features"="+half-rate-64-ops" }
100 attributes #8 = { nounwind "target-features"="-load-store-opt" }
101 attributes #9 = { nounwind "target-features"="+load-store-opt" }
102 attributes #10 = { nounwind "target-features"="+code-object-v3" }
103 attributes #11 = { nounwind "target-features"="-code-object-v3" }