# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
# RUN: llc -mtriple=riscv64 -mattr=+v -run-pass=legalizer %s -o - | FileCheck %s
---
name: constbarrier_i32
body: |
bb.0.entry:
; CHECK-LABEL: name: constbarrier_i32
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16368
; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s32) = G_CONSTANT_FOLD_BARRIER [[C]]
; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[CONSTANT_FOLD_BARRIER]](s32)
; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
; CHECK-NEXT: PseudoRET implicit $x10
%1:_(s32) = G_CONSTANT i32 16368
%2:_(s32) = G_CONSTANT_FOLD_BARRIER %1
%3:_(s64) = G_ANYEXT %2(s32)
$x10 = COPY %3(s64)
PseudoRET implicit $x10
...
---
name: constbarrier_i64
body: |
bb.0.entry:
; CHECK-LABEL: name: constbarrier_i64
; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16368
; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s64) = G_CONSTANT_FOLD_BARRIER [[C]]
; CHECK-NEXT: $x10 = COPY [[CONSTANT_FOLD_BARRIER]](s64)
; CHECK-NEXT: PseudoRET implicit $x10
%1:_(s64) = G_CONSTANT i64 16368
%2:_(s64) = G_CONSTANT_FOLD_BARRIER %1
$x10 = COPY %2(s64)
PseudoRET implicit $x10
...
---
name: constbarrier_i16
body: |
bb.0.entry:
; CHECK-LABEL: name: constbarrier_i16
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2048
; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s32) = G_CONSTANT_FOLD_BARRIER [[C]]
; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[CONSTANT_FOLD_BARRIER]](s32)
; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
; CHECK-NEXT: PseudoRET implicit $x10
%1:_(s16) = G_CONSTANT i16 2048
%2:_(s16) = G_CONSTANT_FOLD_BARRIER %1
%3:_(s64) = G_ANYEXT %2(s16)
$x10 = COPY %3(s64)
PseudoRET implicit $x10
...
---
name: constbarrier_i128
body: |
bb.0.entry:
; CHECK-LABEL: name: constbarrier_i128
; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2048
; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(s64) = G_CONSTANT_FOLD_BARRIER [[C]]
; CHECK-NEXT: $x10 = COPY [[CONSTANT_FOLD_BARRIER]](s64)
; CHECK-NEXT: PseudoRET implicit $x10
%1:_(s128) = G_CONSTANT i128 2048
%2:_(s128) = G_CONSTANT_FOLD_BARRIER %1
%3:_(s64) = G_TRUNC %2(s128)
$x10 = COPY %3(s64)
PseudoRET implicit $x10
...
---
name: constbarrier_nxv2i1
body: |
bb.0.entry:
; CHECK-LABEL: name: constbarrier_nxv2i1
; CHECK: [[VMSET_VL:%[0-9]+]]:_(<vscale x 2 x s1>) = G_VMSET_VL $x0
; CHECK-NEXT: [[VMCLR_VL:%[0-9]+]]:_(<vscale x 2 x s1>) = G_VMCLR_VL $x0
; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(<vscale x 2 x s1>) = G_CONSTANT_FOLD_BARRIER [[VMCLR_VL]]
; CHECK-NEXT: $v8 = COPY [[CONSTANT_FOLD_BARRIER]](<vscale x 2 x s1>)
; CHECK-NEXT: PseudoRET implicit $v8
%1:_(s1) = G_CONSTANT i1 0
%2:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR %1(s1)
%3:_(<vscale x 2 x s1>) = G_CONSTANT_FOLD_BARRIER %2
$v8 = COPY %3(<vscale x 2 x s1>)
PseudoRET implicit $v8
...
---
name: constbarrier_nxv2i32
body: |
bb.0.entry:
; CHECK-LABEL: name: constbarrier_nxv2i32
; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[C]](s32)
; CHECK-NEXT: [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[ANYEXT]](s64)
; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(<vscale x 2 x s32>) = G_CONSTANT_FOLD_BARRIER [[SPLAT_VECTOR]]
; CHECK-NEXT: $v8 = COPY [[CONSTANT_FOLD_BARRIER]](<vscale x 2 x s32>)
; CHECK-NEXT: PseudoRET implicit $v8
%1:_(s32) = G_CONSTANT i32 0
%2:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR %1(s32)
%3:_(<vscale x 2 x s32>) = G_CONSTANT_FOLD_BARRIER %2
$v8 = COPY %3(<vscale x 2 x s32>)
PseudoRET implicit $v8
...
---
name: constbarrier_nxv2i64
body: |
bb.0.entry:
; CHECK-LABEL: name: constbarrier_nxv2i64
; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
; CHECK-NEXT: [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR [[C]](s64)
; CHECK-NEXT: [[CONSTANT_FOLD_BARRIER:%[0-9]+]]:_(<vscale x 2 x s64>) = G_CONSTANT_FOLD_BARRIER [[SPLAT_VECTOR]]
; CHECK-NEXT: $v8m2 = COPY [[CONSTANT_FOLD_BARRIER]](<vscale x 2 x s64>)
; CHECK-NEXT: PseudoRET implicit $v8m2
%0:_(<vscale x 2 x s64>) = G_IMPLICIT_DEF
%1:_(s64) = G_CONSTANT i64 0
%2:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR %1(s64)
%3:_(<vscale x 2 x s64>) = G_CONSTANT_FOLD_BARRIER %2(<vscale x 2 x s64>)
$v8m2 = COPY %3(<vscale x 2 x s64>)
PseudoRET implicit $v8m2
...