1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc -mtriple=riscv64 -mattr=+v -run-pass=legalizer %s -o - | FileCheck %s
7 ; CHECK-LABEL: name: constbarrier_i32
8 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16368
9 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C]](s64)
10 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s32) = G_CONSTANT_FOLD_BARRIER [[TRUNC]]
11 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[CONSTANT_FOLD_BARRIER]](s32)
12 ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
13 ; CHECK-NEXT: PseudoRET implicit $x10
14 %1:_(s32) = G_CONSTANT i32 16368
15 %2:_(s32) = G_CONSTANT_FOLD_BARRIER %1
16 %3:_(s64) = G_ANYEXT %2(s32)
18 PseudoRET implicit $x10
22 name: constbarrier_i64
25 ; CHECK-LABEL: name: constbarrier_i64
26 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16368
27 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s64) = G_CONSTANT_FOLD_BARRIER [[C]]
28 ; CHECK-NEXT: $x10 = COPY [[CONSTANT_FOLD_BARRIER]](s64)
29 ; CHECK-NEXT: PseudoRET implicit $x10
30 %1:_(s64) = G_CONSTANT i64 16368
31 %2:_(s64) = G_CONSTANT_FOLD_BARRIER %1
33 PseudoRET implicit $x10
37 name: constbarrier_i16
40 ; CHECK-LABEL: name: constbarrier_i16
41 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2048
42 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[C]](s64)
43 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s32) = G_CONSTANT_FOLD_BARRIER [[TRUNC]]
44 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[CONSTANT_FOLD_BARRIER]](s32)
45 ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
46 ; CHECK-NEXT: PseudoRET implicit $x10
47 %1:_(s16) = G_CONSTANT i16 2048
48 %2:_(s16) = G_CONSTANT_FOLD_BARRIER %1
49 %3:_(s64) = G_ANYEXT %2(s16)
51 PseudoRET implicit $x10
55 name: constbarrier_i128
58 ; CHECK-LABEL: name: constbarrier_i128
59 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2048
60 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s64) = G_CONSTANT_FOLD_BARRIER [[C]]
61 ; CHECK-NEXT: $x10 = COPY [[CONSTANT_FOLD_BARRIER]](s64)
62 ; CHECK-NEXT: PseudoRET implicit $x10
63 %1:_(s128) = G_CONSTANT i128 2048
64 %2:_(s128) = G_CONSTANT_FOLD_BARRIER %1
65 %3:_(s64) = G_TRUNC %2(s128)
67 PseudoRET implicit $x10
71 name: constbarrier_nxv2i1
74 ; CHECK-LABEL: name: constbarrier_nxv2i1
75 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
76 ; CHECK-NEXT: [[VMSET_VL:%[0-9]+]]:_(<vscale x 2 x s1>) = G_VMSET_VL [[C]](s64)
77 ; CHECK-NEXT: [[VMCLR_VL:%[0-9]+]]:_(<vscale x 2 x s1>) = G_VMCLR_VL [[C]](s64)
78 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(<vscale x 2 x s1>) = G_CONSTANT_FOLD_BARRIER [[VMCLR_VL]]
79 ; CHECK-NEXT: $v8 = COPY [[CONSTANT_FOLD_BARRIER]](<vscale x 2 x s1>)
80 ; CHECK-NEXT: PseudoRET implicit $v8
81 %1:_(s1) = G_CONSTANT i1 0
82 %2:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR %1(s1)
83 %3:_(<vscale x 2 x s1>) = G_CONSTANT_FOLD_BARRIER %2
84 $v8 = COPY %3(<vscale x 2 x s1>)
85 PseudoRET implicit $v8
89 name: constbarrier_nxv2i32
92 ; CHECK-LABEL: name: constbarrier_nxv2i32
93 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
94 ; CHECK-NEXT: [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[C]](s64)
95 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(<vscale x 2 x s32>) = G_CONSTANT_FOLD_BARRIER [[SPLAT_VECTOR]]
96 ; CHECK-NEXT: $v8 = COPY [[CONSTANT_FOLD_BARRIER]](<vscale x 2 x s32>)
97 ; CHECK-NEXT: PseudoRET implicit $v8
98 %1:_(s32) = G_CONSTANT i32 0
99 %2:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR %1(s32)
100 %3:_(<vscale x 2 x s32>) = G_CONSTANT_FOLD_BARRIER %2
101 $v8 = COPY %3(<vscale x 2 x s32>)
102 PseudoRET implicit $v8
106 name: constbarrier_nxv2i64
109 ; CHECK-LABEL: name: constbarrier_nxv2i64
110 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
111 ; CHECK-NEXT: [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR [[C]](s64)
112 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(<vscale x 2 x s64>) = G_CONSTANT_FOLD_BARRIER [[SPLAT_VECTOR]]
113 ; CHECK-NEXT: $v8m2 = COPY [[CONSTANT_FOLD_BARRIER]](<vscale x 2 x s64>)
114 ; CHECK-NEXT: PseudoRET implicit $v8m2
115 %0:_(<vscale x 2 x s64>) = G_IMPLICIT_DEF
116 %1:_(s64) = G_CONSTANT i64 0
117 %2:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR %1(s64)
118 %3:_(<vscale x 2 x s64>) = G_CONSTANT_FOLD_BARRIER %2(<vscale x 2 x s64>)
119 $v8m2 = COPY %3(<vscale x 2 x s64>)
120 PseudoRET implicit $v8m2