Debian Codegraph @

llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-const-rv32.mir

raw
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \
3 # RUN: | FileCheck %s
4 ---
5 name: const_i7
6 body: |
7 bb.0.entry:
8 ; CHECK-LABEL: name: const_i7
9 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
10 ; CHECK-NEXT: $x10 = COPY [[C]](s32)
11 ; CHECK-NEXT: PseudoRET implicit $x10
12 %0:_(s7) = G_CONSTANT i7 15
13 %1:_(s32) = G_ANYEXT %0(s7)
14 $x10 = COPY %1(s32)
15 PseudoRET implicit $x10
16
17 ...
18 ---
19 name: const_i8
20 body: |
21 bb.0.entry:
22 ; CHECK-LABEL: name: const_i8
23 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -127
24 ; CHECK-NEXT: $x10 = COPY [[C]](s32)
25 ; CHECK-NEXT: PseudoRET implicit $x10
26 %0:_(s8) = G_CONSTANT i8 129
27 %1:_(s32) = G_ANYEXT %0(s8)
28 $x10 = COPY %1(s32)
29 PseudoRET implicit $x10
30
31 ...
32 ---
33 name: const_i16
34 body: |
35 bb.0.entry:
36 ; CHECK-LABEL: name: const_i16
37 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
38 ; CHECK-NEXT: $x10 = COPY [[C]](s32)
39 ; CHECK-NEXT: PseudoRET implicit $x10
40 %0:_(s16) = G_CONSTANT i16 -32769
41 %1:_(s32) = G_ANYEXT %0(s16)
42 $x10 = COPY %1(s32)
43 PseudoRET implicit $x10
44
45 ...
46 ---
47 name: const_i32
48 body: |
49 bb.0.entry:
50 ; CHECK-LABEL: name: const_i32
51 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483647
52 ; CHECK-NEXT: $x10 = COPY [[C]](s32)
53 ; CHECK-NEXT: PseudoRET implicit $x10
54 %0:_(s32) = G_CONSTANT i32 2147483649
55 $x10 = COPY %0(s32)
56 PseudoRET implicit $x10
57
58 ...
59 ---
60 name: const_i48
61 body: |
62 bb.0.entry:
63 ; CHECK-LABEL: name: const_i48
64 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
65 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
66 ; CHECK-NEXT: $x10 = COPY [[C]](s32)
67 ; CHECK-NEXT: $x11 = COPY [[C1]](s32)
68 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
69 %0:_(s48) = G_CONSTANT i48 2
70 %1:_(s64) = G_ANYEXT %0(s48)
71 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %1(s64)
72 $x10 = COPY %2(s32)
73 $x11 = COPY %3(s32)
74 PseudoRET implicit $x10, implicit $x11
75
76 ...
77 ---
78 name: const_i64
79 body: |
80 bb.0.entry:
81 ; CHECK-LABEL: name: const_i64
82 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483647
83 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
84 ; CHECK-NEXT: $x10 = COPY [[C]](s32)
85 ; CHECK-NEXT: $x11 = COPY [[C1]](s32)
86 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
87 %0:_(s64) = G_CONSTANT i64 2147483649
88 %1:_(s32), %2:_(s32) = G_UNMERGE_VALUES %0(s64)
89 $x10 = COPY %1(s32)
90 $x11 = COPY %2(s32)
91 PseudoRET implicit $x10, implicit $x11
92
93 ...
94 ---
95 name: const_i96
96 body: |
97 bb.0.entry:
98 ; CHECK-LABEL: name: const_i96
99 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -121
100 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -51
101 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
102 ; CHECK-NEXT: $x10 = COPY [[C]](s32)
103 ; CHECK-NEXT: $x11 = COPY [[C1]](s32)
104 ; CHECK-NEXT: $x12 = COPY [[C2]](s32)
105 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
106 %0:_(s96) = G_CONSTANT i96 -214748364921
107 %1:_(s32), %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %0(s96)
108 $x10 = COPY %1(s32)
109 $x11 = COPY %2(s32)
110 $x12 = COPY %3(s32)
111 PseudoRET implicit $x10, implicit $x11, implicit $x12
112
113 ...
114 ---
115 name: const_null
116 body: |
117 bb.0.entry:
118 ; CHECK-LABEL: name: const_null
119 ; CHECK: [[C:%[0-9]+]]:_(p0) = G_CONSTANT i32 0
120 ; CHECK-NEXT: $x10 = COPY [[C]](p0)
121 ; CHECK-NEXT: PseudoRET implicit $x10
122 %0:_(p0) = G_CONSTANT i32 0
123 $x10 = COPY %0(p0)
124 PseudoRET implicit $x10
125
126 ...