• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3
4; sram-ecc can be safely ignored when inlining, since no intrinisics
5; or other directly exposed operations depend on it.
6
7define i32 @func_default() #0 {
8  ret i32 0
9}
10
11define i32 @func_ecc_enabled() #1 {
12  ret i32 0
13}
14
15define i32 @func_ecc_disabled() #2 {
16  ret i32 0
17}
18
19; CHECK-LABEL: @default_call_default(
20; CHECK-NEXT: ret i32 0
21define i32 @default_call_default() #0 {
22  %call = call i32 @func_default()
23  ret i32 %call
24}
25
26; CHECK-LABEL: @ecc_enabled_call_default(
27; CHECK-NEXT: ret i32 0
28define i32 @ecc_enabled_call_default() #1 {
29  %call = call i32 @func_default()
30  ret i32 %call
31}
32
33; CHECK-LABEL: @ecc_enabled_call_ecc_enabled(
34; CHECK-NEXT: ret i32 0
35define i32 @ecc_enabled_call_ecc_enabled() #1 {
36  %call = call i32 @func_ecc_enabled()
37  ret i32 %call
38}
39
40; CHECK-LABEL: @ecc_enabled_call_ecc_disabled(
41; CHECK-NEXT: ret i32 0
42define i32 @ecc_enabled_call_ecc_disabled() #1 {
43  %call = call i32 @func_ecc_disabled()
44  ret i32 %call
45}
46
47; CHECK-LABEL: @ecc_disabled_call_default(
48; CHECK-NEXT: ret i32 0
49define i32 @ecc_disabled_call_default() #2 {
50  %call = call i32 @func_default()
51  ret i32 %call
52}
53
54; CHECK-LABEL: @ecc_disabled_call_ecc_enabled(
55; CHECK-NEXT: ret i32 0
56define i32 @ecc_disabled_call_ecc_enabled() #2 {
57  %call = call i32 @func_ecc_enabled()
58  ret i32 %call
59}
60
61; CHECK-LABEL: @ecc_disabled_call_ecc_disabled(
62; CHECK-NEXT: ret i32 0
63define i32 @ecc_disabled_call_ecc_disabled() #2 {
64  %call = call i32 @func_ecc_disabled()
65  ret i32 %call
66}
67
68attributes #0 = { nounwind }
69attributes #1 = { nounwind "target-features"="+sram-ecc" }
70attributes #2 = { nounwind "target-features"="-sram-ecc" }
71