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=riscv64 -mattr=+v,+f,+d,+zfh,+experimental-zvfh -riscv-v-vector-bits-min=128 -riscv-v-fixed-length-vector-lmul-max=1 < %s | FileCheck %s
3 ; Check that we don't crash querying costs when vectors are not enabled.
4 ; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64
6 define void @select() {
7 ; CHECK-LABEL: 'select'
8 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = select i1 undef, i1 undef, i1 undef
9 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = select <1 x i1> undef, <1 x i1> undef, <1 x i1> undef
10 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %3 = select <2 x i1> undef, <2 x i1> undef, <2 x i1> undef
11 ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %4 = select <4 x i1> undef, <4 x i1> undef, <4 x i1> undef
12 ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %5 = select <8 x i1> undef, <8 x i1> undef, <8 x i1> undef
13 ; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %6 = select <16 x i1> undef, <16 x i1> undef, <16 x i1> undef
14 ; CHECK-NEXT: Cost Model: Found an estimated cost of 64 for instruction: %7 = select <32 x i1> undef, <32 x i1> undef, <32 x i1> undef
15 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %8 = select <vscale x 1 x i1> undef, <vscale x 1 x i1> undef, <vscale x 1 x i1> undef
16 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %9 = select <vscale x 2 x i1> undef, <vscale x 2 x i1> undef, <vscale x 2 x i1> undef
17 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %10 = select <vscale x 4 x i1> undef, <vscale x 4 x i1> undef, <vscale x 4 x i1> undef
18 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %11 = select <vscale x 8 x i1> undef, <vscale x 8 x i1> undef, <vscale x 8 x i1> undef
19 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %12 = select <vscale x 16 x i1> undef, <vscale x 16 x i1> undef, <vscale x 16 x i1> undef
20 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %13 = select <vscale x 32 x i1> undef, <vscale x 32 x i1> undef, <vscale x 32 x i1> undef
21 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = select i1 undef, i8 undef, i8 undef
22 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = select <1 x i1> undef, <1 x i8> undef, <1 x i8> undef
23 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = select <2 x i1> undef, <2 x i8> undef, <2 x i8> undef
24 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = select <4 x i1> undef, <4 x i8> undef, <4 x i8> undef
25 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = select <8 x i1> undef, <8 x i8> undef, <8 x i8> undef
26 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = select <16 x i1> undef, <16 x i8> undef, <16 x i8> undef
27 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %20 = select <32 x i1> undef, <32 x i8> undef, <32 x i8> undef
28 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = select <vscale x 1 x i1> undef, <vscale x 1 x i8> undef, <vscale x 1 x i8> undef
29 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = select <vscale x 2 x i1> undef, <vscale x 2 x i8> undef, <vscale x 2 x i8> undef
30 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = select <vscale x 4 x i1> undef, <vscale x 4 x i8> undef, <vscale x 4 x i8> undef
31 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = select <vscale x 8 x i1> undef, <vscale x 8 x i8> undef, <vscale x 8 x i8> undef
32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %25 = select <vscale x 16 x i1> undef, <vscale x 16 x i8> undef, <vscale x 16 x i8> undef
33 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %26 = select <vscale x 32 x i1> undef, <vscale x 32 x i8> undef, <vscale x 32 x i8> undef
34 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = select i1 undef, i16 undef, i16 undef
35 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = select <1 x i1> undef, <1 x i16> undef, <1 x i16> undef
36 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %29 = select <2 x i1> undef, <2 x i16> undef, <2 x i16> undef
37 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %30 = select <4 x i1> undef, <4 x i16> undef, <4 x i16> undef
38 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %31 = select <8 x i1> undef, <8 x i16> undef, <8 x i16> undef
39 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %32 = select <16 x i1> undef, <16 x i16> undef, <16 x i16> undef
40 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %33 = select <32 x i1> undef, <32 x i16> undef, <32 x i16> undef
41 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %34 = select <vscale x 1 x i1> undef, <vscale x 1 x i16> undef, <vscale x 1 x i16> undef
42 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %35 = select <vscale x 2 x i1> undef, <vscale x 2 x i16> undef, <vscale x 2 x i16> undef
43 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %36 = select <vscale x 4 x i1> undef, <vscale x 4 x i16> undef, <vscale x 4 x i16> undef
44 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %37 = select <vscale x 8 x i1> undef, <vscale x 8 x i16> undef, <vscale x 8 x i16> undef
45 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %38 = select <vscale x 16 x i1> undef, <vscale x 16 x i16> undef, <vscale x 16 x i16> undef
46 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %39 = select <vscale x 32 x i1> undef, <vscale x 32 x i16> undef, <vscale x 32 x i16> undef
47 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %40 = select i1 undef, i32 undef, i32 undef
48 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %41 = select <1 x i1> undef, <1 x i32> undef, <1 x i32> undef
49 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %42 = select <2 x i1> undef, <2 x i32> undef, <2 x i32> undef
50 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %43 = select <4 x i1> undef, <4 x i32> undef, <4 x i32> undef
51 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %44 = select <8 x i1> undef, <8 x i32> undef, <8 x i32> undef
52 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %45 = select <16 x i1> undef, <16 x i32> undef, <16 x i32> undef
53 ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %46 = select <32 x i1> undef, <32 x i32> undef, <32 x i32> undef
54 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %47 = select <vscale x 1 x i1> undef, <vscale x 1 x i32> undef, <vscale x 1 x i32> undef
55 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %48 = select <vscale x 2 x i1> undef, <vscale x 2 x i32> undef, <vscale x 2 x i32> undef
56 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %49 = select <vscale x 4 x i1> undef, <vscale x 4 x i32> undef, <vscale x 4 x i32> undef
57 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %50 = select <vscale x 8 x i1> undef, <vscale x 8 x i32> undef, <vscale x 8 x i32> undef
58 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %51 = select <vscale x 16 x i1> undef, <vscale x 16 x i32> undef, <vscale x 16 x i32> undef
59 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %52 = select <vscale x 32 x i1> undef, <vscale x 32 x i32> undef, <vscale x 32 x i32> undef
60 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %53 = select i1 undef, i64 undef, i64 undef
61 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %54 = select <1 x i1> undef, <1 x i64> undef, <1 x i64> undef
62 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %55 = select <2 x i1> undef, <2 x i64> undef, <2 x i64> undef
63 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %56 = select <4 x i1> undef, <4 x i64> undef, <4 x i64> undef
64 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %57 = select <8 x i1> undef, <8 x i64> undef, <8 x i64> undef
65 ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %58 = select <16 x i1> undef, <16 x i64> undef, <16 x i64> undef
66 ; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %59 = select <32 x i1> undef, <32 x i64> undef, <32 x i64> undef
67 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %60 = select <vscale x 1 x i1> undef, <vscale x 1 x i64> undef, <vscale x 1 x i64> undef
68 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %61 = select <vscale x 2 x i1> undef, <vscale x 2 x i64> undef, <vscale x 2 x i64> undef
69 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %62 = select <vscale x 4 x i1> undef, <vscale x 4 x i64> undef, <vscale x 4 x i64> undef
70 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %63 = select <vscale x 8 x i1> undef, <vscale x 8 x i64> undef, <vscale x 8 x i64> undef
71 ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %64 = select <vscale x 16 x i1> undef, <vscale x 16 x i64> undef, <vscale x 16 x i64> undef
72 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %65 = select <vscale x 32 x i1> undef, <vscale x 32 x i64> undef, <vscale x 32 x i64> undef
73 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
75 select i1 undef, i1 undef, i1 undef
76 select <1 x i1> undef, <1 x i1> undef, <1 x i1> undef
77 select <2 x i1> undef, <2 x i1> undef, <2 x i1> undef
78 select <4 x i1> undef, <4 x i1> undef, <4 x i1> undef
79 select <8 x i1> undef, <8 x i1> undef, <8 x i1> undef
80 select <16 x i1> undef, <16 x i1> undef, <16 x i1> undef
81 select <32 x i1> undef, <32 x i1> undef, <32 x i1> undef
82 select <vscale x 1 x i1> undef, <vscale x 1 x i1> undef, <vscale x 1 x i1> undef
83 select <vscale x 2 x i1> undef, <vscale x 2 x i1> undef, <vscale x 2 x i1> undef
84 select <vscale x 4 x i1> undef, <vscale x 4 x i1> undef, <vscale x 4 x i1> undef
85 select <vscale x 8 x i1> undef, <vscale x 8 x i1> undef, <vscale x 8 x i1> undef
86 select <vscale x 16 x i1> undef, <vscale x 16 x i1> undef, <vscale x 16 x i1> undef
87 select <vscale x 32 x i1> undef, <vscale x 32 x i1> undef, <vscale x 32 x i1> undef
89 select i1 undef, i8 undef, i8 undef
90 select <1 x i1> undef, <1 x i8> undef, <1 x i8> undef
91 select <2 x i1> undef, <2 x i8> undef, <2 x i8> undef
92 select <4 x i1> undef, <4 x i8> undef, <4 x i8> undef
93 select <8 x i1> undef, <8 x i8> undef, <8 x i8> undef
94 select <16 x i1> undef, <16 x i8> undef, <16 x i8> undef
95 select <32 x i1> undef, <32 x i8> undef, <32 x i8> undef
96 select <vscale x 1 x i1> undef, <vscale x 1 x i8> undef, <vscale x 1 x i8> undef
97 select <vscale x 2 x i1> undef, <vscale x 2 x i8> undef, <vscale x 2 x i8> undef
98 select <vscale x 4 x i1> undef, <vscale x 4 x i8> undef, <vscale x 4 x i8> undef
99 select <vscale x 8 x i1> undef, <vscale x 8 x i8> undef, <vscale x 8 x i8> undef
100 select <vscale x 16 x i1> undef, <vscale x 16 x i8> undef, <vscale x 16 x i8> undef
101 select <vscale x 32 x i1> undef, <vscale x 32 x i8> undef, <vscale x 32 x i8> undef
103 select i1 undef, i16 undef, i16 undef
104 select <1 x i1> undef, <1 x i16> undef, <1 x i16> undef
105 select <2 x i1> undef, <2 x i16> undef, <2 x i16> undef
106 select <4 x i1> undef, <4 x i16> undef, <4 x i16> undef
107 select <8 x i1> undef, <8 x i16> undef, <8 x i16> undef
108 select <16 x i1> undef, <16 x i16> undef, <16 x i16> undef
109 select <32 x i1> undef, <32 x i16> undef, <32 x i16> undef
110 select <vscale x 1 x i1> undef, <vscale x 1 x i16> undef, <vscale x 1 x i16> undef
111 select <vscale x 2 x i1> undef, <vscale x 2 x i16> undef, <vscale x 2 x i16> undef
112 select <vscale x 4 x i1> undef, <vscale x 4 x i16> undef, <vscale x 4 x i16> undef
113 select <vscale x 8 x i1> undef, <vscale x 8 x i16> undef, <vscale x 8 x i16> undef
114 select <vscale x 16 x i1> undef, <vscale x 16 x i16> undef, <vscale x 16 x i16> undef
115 select <vscale x 32 x i1> undef, <vscale x 32 x i16> undef, <vscale x 32 x i16> undef
117 select i1 undef, i32 undef, i32 undef
118 select <1 x i1> undef, <1 x i32> undef, <1 x i32> undef
119 select <2 x i1> undef, <2 x i32> undef, <2 x i32> undef
120 select <4 x i1> undef, <4 x i32> undef, <4 x i32> undef
121 select <8 x i1> undef, <8 x i32> undef, <8 x i32> undef
122 select <16 x i1> undef, <16 x i32> undef, <16 x i32> undef
123 select <32 x i1> undef, <32 x i32> undef, <32 x i32> undef
124 select <vscale x 1 x i1> undef, <vscale x 1 x i32> undef, <vscale x 1 x i32> undef
125 select <vscale x 2 x i1> undef, <vscale x 2 x i32> undef, <vscale x 2 x i32> undef
126 select <vscale x 4 x i1> undef, <vscale x 4 x i32> undef, <vscale x 4 x i32> undef
127 select <vscale x 8 x i1> undef, <vscale x 8 x i32> undef, <vscale x 8 x i32> undef
128 select <vscale x 16 x i1> undef, <vscale x 16 x i32> undef, <vscale x 16 x i32> undef
129 select <vscale x 32 x i1> undef, <vscale x 32 x i32> undef, <vscale x 32 x i32> undef
132 select i1 undef, i64 undef, i64 undef
133 select <1 x i1> undef, <1 x i64> undef, <1 x i64> undef
134 select <2 x i1> undef, <2 x i64> undef, <2 x i64> undef
135 select <4 x i1> undef, <4 x i64> undef, <4 x i64> undef
136 select <8 x i1> undef, <8 x i64> undef, <8 x i64> undef
137 select <16 x i1> undef, <16 x i64> undef, <16 x i64> undef
138 select <32 x i1> undef, <32 x i64> undef, <32 x i64> undef
139 select <vscale x 1 x i1> undef, <vscale x 1 x i64> undef, <vscale x 1 x i64> undef
140 select <vscale x 2 x i1> undef, <vscale x 2 x i64> undef, <vscale x 2 x i64> undef
141 select <vscale x 4 x i1> undef, <vscale x 4 x i64> undef, <vscale x 4 x i64> undef
142 select <vscale x 8 x i1> undef, <vscale x 8 x i64> undef, <vscale x 8 x i64> undef
143 select <vscale x 16 x i1> undef, <vscale x 16 x i64> undef, <vscale x 16 x i64> undef
144 select <vscale x 32 x i1> undef, <vscale x 32 x i64> undef, <vscale x 32 x i64> undef