1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx1010 < %s | FileCheck -check-prefixes=ALL %s
3 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx90a < %s | FileCheck -check-prefixes=ALL %s
4 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=ALL %s
5 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL %s
7 ; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx1010 < %s | FileCheck -check-prefixes=ALL-SIZE %s
8 ; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx90a < %s | FileCheck -check-prefixes=ALL-SIZE %s
9 ; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 < %s | FileCheck -check-prefixes=ALL-SIZE %s
10 ; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE %s
13 %T1 = type { i32, float, <4 x i1> }
15 define void @extract_1() {
16 ; ALL-LABEL: 'extract_1'
17 ; ALL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r0 = extractvalue { i32, i32 } undef, 0
18 ; ALL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r1 = extractvalue { i32, i32 } undef, 1
19 ; ALL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r2 = extractvalue { i32, i1 } undef, 0
20 ; ALL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r3 = extractvalue { i32, i1 } undef, 1
21 ; ALL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r4 = extractvalue { i32, float } undef, 1
22 ; ALL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r5 = extractvalue { i32, [42 x i42] } undef, 1
23 ; ALL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r6 = extractvalue { i32, <42 x i42> } undef, 1
24 ; ALL-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r7 = extractvalue { i32, %T1 } undef, 1
25 ; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret void
27 ; ALL-SIZE-LABEL: 'extract_1'
28 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r0 = extractvalue { i32, i32 } undef, 0
29 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r1 = extractvalue { i32, i32 } undef, 1
30 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r2 = extractvalue { i32, i1 } undef, 0
31 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r3 = extractvalue { i32, i1 } undef, 1
32 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r4 = extractvalue { i32, float } undef, 1
33 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r5 = extractvalue { i32, [42 x i42] } undef, 1
34 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r6 = extractvalue { i32, <42 x i42> } undef, 1
35 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r7 = extractvalue { i32, %T1 } undef, 1
36 ; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
38 %r0 = extractvalue {i32, i32} undef, 0
39 %r1 = extractvalue {i32, i32} undef, 1
40 %r2 = extractvalue {i32, i1} undef, 0
41 %r3 = extractvalue {i32, i1} undef, 1
42 %r4 = extractvalue {i32, float} undef, 1
43 %r5 = extractvalue {i32, [42 x i42]} undef, 1
44 %r6 = extractvalue {i32, <42 x i42>} undef, 1
45 %r7 = extractvalue {i32, %T1} undef, 1