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 ; sram-ecc can be safely ignored when inlining, since no intrinisics
5 ; or other directly exposed operations depend on it.
7 define i32 @func_default() #0 {
11 define i32 @func_ecc_enabled() #1 {
15 define i32 @func_ecc_disabled() #2 {
19 ; CHECK-LABEL: @default_call_default(
20 ; CHECK-NEXT: ret i32 0
21 define i32 @default_call_default() #0 {
22 %call = call i32 @func_default()
26 ; CHECK-LABEL: @ecc_enabled_call_default(
27 ; CHECK-NEXT: ret i32 0
28 define i32 @ecc_enabled_call_default() #1 {
29 %call = call i32 @func_default()
33 ; CHECK-LABEL: @ecc_enabled_call_ecc_enabled(
34 ; CHECK-NEXT: ret i32 0
35 define i32 @ecc_enabled_call_ecc_enabled() #1 {
36 %call = call i32 @func_ecc_enabled()
40 ; CHECK-LABEL: @ecc_enabled_call_ecc_disabled(
41 ; CHECK-NEXT: ret i32 0
42 define i32 @ecc_enabled_call_ecc_disabled() #1 {
43 %call = call i32 @func_ecc_disabled()
47 ; CHECK-LABEL: @ecc_disabled_call_default(
48 ; CHECK-NEXT: ret i32 0
49 define i32 @ecc_disabled_call_default() #2 {
50 %call = call i32 @func_default()
54 ; CHECK-LABEL: @ecc_disabled_call_ecc_enabled(
55 ; CHECK-NEXT: ret i32 0
56 define i32 @ecc_disabled_call_ecc_enabled() #2 {
57 %call = call i32 @func_ecc_enabled()
61 ; CHECK-LABEL: @ecc_disabled_call_ecc_disabled(
62 ; CHECK-NEXT: ret i32 0
63 define i32 @ecc_disabled_call_ecc_disabled() #2 {
64 %call = call i32 @func_ecc_disabled()
68 attributes #0 = { nounwind }
69 attributes #1 = { nounwind "target-features"="+sram-ecc" }
70 attributes #2 = { nounwind "target-features"="-sram-ecc" }