1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc -mtriple=riscv32 -mattr=+v -run-pass=legalizer %s -o - | FileCheck %s
7 ; CHECK-LABEL: name: constbarrier_i32
8 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16368
9 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s32) = G_CONSTANT_FOLD_BARRIER [[C]]
10 ; CHECK-NEXT: $x10 = COPY [[CONSTANT_FOLD_BARRIER]](s32)
11 ; CHECK-NEXT: PseudoRET implicit $x10
12 %1:_(s32) = G_CONSTANT i32 16368
13 %2:_(s32) = G_CONSTANT_FOLD_BARRIER %1
15 PseudoRET implicit $x10
19 name: constbarrier_i16
22 ; CHECK-LABEL: name: constbarrier_i16
23 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2048
24 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s32) = G_CONSTANT_FOLD_BARRIER [[C]]
25 ; CHECK-NEXT: $x10 = COPY [[CONSTANT_FOLD_BARRIER]](s32)
26 ; CHECK-NEXT: PseudoRET implicit $x10
27 %1:_(s16) = G_CONSTANT i16 2048
28 %2:_(s16) = G_CONSTANT_FOLD_BARRIER %1
29 %3:_(s32) = G_ANYEXT %2(s16)
31 PseudoRET implicit $x10
35 name: constbarrier_i128
38 ; CHECK-LABEL: name: constbarrier_i128
39 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2048
40 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s32) = G_CONSTANT_FOLD_BARRIER [[C]]
41 ; CHECK-NEXT: $x10 = COPY [[CONSTANT_FOLD_BARRIER]](s32)
42 ; CHECK-NEXT: PseudoRET implicit $x10
43 %1:_(s128) = G_CONSTANT i128 2048
44 %2:_(s128) = G_CONSTANT_FOLD_BARRIER %1
45 %3:_(s32) = G_TRUNC %2(s128)
47 PseudoRET implicit $x10
51 name: constbarrier_nxv2i1
54 ; CHECK-LABEL: name: constbarrier_nxv2i1
55 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
56 ; CHECK-NEXT: [[VMSET_VL:%[0-9]+]]:_(<vscale x 2 x s1>) = G_VMSET_VL [[C]](s32)
57 ; CHECK-NEXT: [[VMCLR_VL:%[0-9]+]]:_(<vscale x 2 x s1>) = G_VMCLR_VL [[C]](s32)
58 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(<vscale x 2 x s1>) = G_CONSTANT_FOLD_BARRIER [[VMCLR_VL]]
59 ; CHECK-NEXT: $v8 = COPY [[CONSTANT_FOLD_BARRIER]](<vscale x 2 x s1>)
60 ; CHECK-NEXT: PseudoRET implicit $v8
61 %1:_(s1) = G_CONSTANT i1 0
62 %2:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR %1(s1)
63 %3:_(<vscale x 2 x s1>) = G_CONSTANT_FOLD_BARRIER %2
64 $v8 = COPY %3(<vscale x 2 x s1>)
65 PseudoRET implicit $v8
69 name: constbarrier_nxv2i32
72 ; CHECK-LABEL: name: constbarrier_nxv2i32
73 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
74 ; CHECK-NEXT: [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[C]](s32)
75 ; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(<vscale x 2 x s32>) = G_CONSTANT_FOLD_BARRIER [[SPLAT_VECTOR]]
76 ; CHECK-NEXT: $v8 = COPY [[CONSTANT_FOLD_BARRIER]](<vscale x 2 x s32>)
77 ; CHECK-NEXT: PseudoRET implicit $v8
78 %1:_(s32) = G_CONSTANT i32 0
79 %2:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR %1(s32)
80 %3:_(<vscale x 2 x s32>) = G_CONSTANT_FOLD_BARRIER %2
81 $v8 = COPY %3(<vscale x 2 x s32>)
82 PseudoRET implicit $v8