xref: /llvm-project/llvm/test/CodeGen/RISCV/GlobalISel/irtranslator/shufflevector.ll (revision d5c292d8ef590f64d26c16d12afebb6ad7f50373)
196049fcfSMichael Maitland; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
296049fcfSMichael Maitland; RUN: llc -mtriple=riscv32 -mattr=+v -global-isel -stop-after=irtranslator \
396049fcfSMichael Maitland; RUN:   -verify-machineinstrs < %s | FileCheck -check-prefixes=RV32 %s
496049fcfSMichael Maitland; RUN: llc -mtriple=riscv64 -mattr=+v -global-isel -stop-after=irtranslator \
596049fcfSMichael Maitland; RUN:   -verify-machineinstrs < %s | FileCheck -check-prefixes=RV64 %s
696049fcfSMichael Maitland
796049fcfSMichael Maitlanddefine <vscale x 1 x i1> @shufflevector_nxv1i1_0() {
896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i1_0
996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
1096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s1>) = G_IMPLICIT_DEF
11ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
12ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s1>), [[C]](s32)
1396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
1496049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s1>)
1596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
1696049fcfSMichael Maitland  ;
1796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i1_0
1896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
1996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s1>) = G_IMPLICIT_DEF
2096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
2196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s1>), [[C]](s64)
2296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
2396049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s1>)
2496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
2596049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i1> poison, <vscale x 1 x i1> poison, <vscale x 1 x i32> poison
2696049fcfSMichael Maitland  ret <vscale x 1 x i1> %a
2796049fcfSMichael Maitland}
2896049fcfSMichael Maitland
2996049fcfSMichael Maitlanddefine <vscale x 1 x i1> @shufflevector_nxv1i1_1() {
3096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i1_1
3196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
3296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s1>) = G_IMPLICIT_DEF
33ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
34ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s1>), [[C]](s32)
3596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
3696049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s1>)
3796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
3896049fcfSMichael Maitland  ;
3996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i1_1
4096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
4196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s1>) = G_IMPLICIT_DEF
4296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
4396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s1>), [[C]](s64)
4496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
4596049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s1>)
4696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
4796049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i1> undef, <vscale x 1 x i1> undef, <vscale x 1 x i32> undef
4896049fcfSMichael Maitland  ret <vscale x 1 x i1> %a
4996049fcfSMichael Maitland}
5096049fcfSMichael Maitland
5196049fcfSMichael Maitlanddefine <vscale x 1 x i1> @shufflevector_nxv1i1_2(<vscale x 1 x i1> %a) {
5296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i1_2
5396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
5496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v0
5596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
5696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s1>) = COPY $v0
57ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
58ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s1>), [[C]](s32)
5996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
6096049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s1>)
6196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
6296049fcfSMichael Maitland  ;
6396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i1_2
6496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
6596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v0
6696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
6796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s1>) = COPY $v0
6896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
6996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s1>), [[C]](s64)
7096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
7196049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s1>)
7296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
7396049fcfSMichael Maitland  %b = shufflevector <vscale x 1 x i1> %a , <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
7496049fcfSMichael Maitland  ret <vscale x 1 x i1> %b
7596049fcfSMichael Maitland}
7696049fcfSMichael Maitland
7796049fcfSMichael Maitlanddefine <vscale x 2 x i1> @shufflevector_nxv2i1_0() {
7896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i1_0
7996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
8096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s1>) = G_IMPLICIT_DEF
81ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
82ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s1>), [[C]](s32)
8396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
8496049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s1>)
8596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
8696049fcfSMichael Maitland  ;
8796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i1_0
8896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
8996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s1>) = G_IMPLICIT_DEF
9096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
9196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s1>), [[C]](s64)
9296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
9396049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s1>)
9496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
9596049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i1> poison, <vscale x 2 x i1> poison, <vscale x 2 x i32> poison
9696049fcfSMichael Maitland  ret <vscale x 2 x i1> %a
9796049fcfSMichael Maitland}
9896049fcfSMichael Maitland
9996049fcfSMichael Maitlanddefine <vscale x 2 x i1> @shufflevector_nxv2i1_1() {
10096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i1_1
10196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
10296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s1>) = G_IMPLICIT_DEF
103ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
104ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s1>), [[C]](s32)
10596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
10696049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s1>)
10796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
10896049fcfSMichael Maitland  ;
10996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i1_1
11096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
11196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s1>) = G_IMPLICIT_DEF
11296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
11396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s1>), [[C]](s64)
11496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
11596049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s1>)
11696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
11796049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i1> undef, <vscale x 2 x i1> undef, <vscale x 2 x i32> undef
11896049fcfSMichael Maitland  ret <vscale x 2 x i1> %a
11996049fcfSMichael Maitland}
12096049fcfSMichael Maitland
12196049fcfSMichael Maitlanddefine <vscale x 2 x i1> @shufflevector_nxv2i1_2(<vscale x 2 x i1> %a) {
12296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i1_2
12396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
12496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v0
12596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
12696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s1>) = COPY $v0
127ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
128ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s1>), [[C]](s32)
12996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
13096049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s1>)
13196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
13296049fcfSMichael Maitland  ;
13396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i1_2
13496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
13596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v0
13696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
13796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s1>) = COPY $v0
13896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
13996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s1>), [[C]](s64)
14096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
14196049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s1>)
14296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
14396049fcfSMichael Maitland  %b = shufflevector <vscale x 2 x i1> %a , <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
14496049fcfSMichael Maitland  ret <vscale x 2 x i1> %b
14596049fcfSMichael Maitland}
14696049fcfSMichael Maitland
14796049fcfSMichael Maitlanddefine <vscale x 4 x i1> @shufflevector_nxv4i1_0() {
14896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i1_0
14996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
15096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s1>) = G_IMPLICIT_DEF
151ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
152ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s1>), [[C]](s32)
15396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
15496049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s1>)
15596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
15696049fcfSMichael Maitland  ;
15796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i1_0
15896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
15996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s1>) = G_IMPLICIT_DEF
16096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
16196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s1>), [[C]](s64)
16296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
16396049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s1>)
16496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
16596049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i1> poison, <vscale x 4 x i1> poison, <vscale x 4 x i32> poison
16696049fcfSMichael Maitland  ret <vscale x 4 x i1> %a
16796049fcfSMichael Maitland}
16896049fcfSMichael Maitland
16996049fcfSMichael Maitlanddefine <vscale x 4 x i1> @shufflevector_nxv4i1_1() {
17096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i1_1
17196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
17296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s1>) = G_IMPLICIT_DEF
173ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
174ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s1>), [[C]](s32)
17596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
17696049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s1>)
17796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
17896049fcfSMichael Maitland  ;
17996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i1_1
18096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
18196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s1>) = G_IMPLICIT_DEF
18296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
18396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s1>), [[C]](s64)
18496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
18596049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s1>)
18696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
18796049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i1> undef, <vscale x 4 x i1> undef, <vscale x 4 x i32> undef
18896049fcfSMichael Maitland  ret <vscale x 4 x i1> %a
18996049fcfSMichael Maitland}
19096049fcfSMichael Maitland
19196049fcfSMichael Maitlanddefine <vscale x 4 x i1> @shufflevector_nxv4i1_2(<vscale x 4 x i1> %a) {
19296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i1_2
19396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
19496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v0
19596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
19696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s1>) = COPY $v0
197ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
198ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s1>), [[C]](s32)
19996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
20096049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s1>)
20196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
20296049fcfSMichael Maitland  ;
20396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i1_2
20496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
20596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v0
20696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
20796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s1>) = COPY $v0
20896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
20996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s1>), [[C]](s64)
21096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
21196049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s1>)
21296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
21396049fcfSMichael Maitland  %b = shufflevector <vscale x 4 x i1> %a , <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
21496049fcfSMichael Maitland  ret <vscale x 4 x i1> %b
21596049fcfSMichael Maitland}
21696049fcfSMichael Maitland
21796049fcfSMichael Maitlanddefine <vscale x 8 x i1> @shufflevector_nxv8i1_0() {
21896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i1_0
21996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
22096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s1>) = G_IMPLICIT_DEF
221ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
222ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s1>), [[C]](s32)
22396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
22496049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s1>)
22596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
22696049fcfSMichael Maitland  ;
22796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i1_0
22896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
22996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s1>) = G_IMPLICIT_DEF
23096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
23196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s1>), [[C]](s64)
23296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
23396049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s1>)
23496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
23596049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i1> poison, <vscale x 8 x i1> poison, <vscale x 8 x i32> poison
23696049fcfSMichael Maitland  ret <vscale x 8 x i1> %a
23796049fcfSMichael Maitland}
23896049fcfSMichael Maitland
23996049fcfSMichael Maitlanddefine <vscale x 8 x i1> @shufflevector_nxv8i1_1() {
24096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i1_1
24196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
24296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s1>) = G_IMPLICIT_DEF
243ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
244ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s1>), [[C]](s32)
24596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
24696049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s1>)
24796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
24896049fcfSMichael Maitland  ;
24996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i1_1
25096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
25196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s1>) = G_IMPLICIT_DEF
25296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
25396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s1>), [[C]](s64)
25496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
25596049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s1>)
25696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
25796049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i1> undef, <vscale x 8 x i1> undef, <vscale x 8 x i32> undef
25896049fcfSMichael Maitland  ret <vscale x 8 x i1> %a
25996049fcfSMichael Maitland}
26096049fcfSMichael Maitland
26196049fcfSMichael Maitlanddefine <vscale x 8 x i1> @shufflevector_nxv8i1_2(<vscale x 8 x i1> %a) {
26296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i1_2
26396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
26496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v0
26596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
26696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s1>) = COPY $v0
267ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
268ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s1>), [[C]](s32)
26996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
27096049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s1>)
27196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
27296049fcfSMichael Maitland  ;
27396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i1_2
27496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
27596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v0
27696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
27796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s1>) = COPY $v0
27896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
27996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s1>), [[C]](s64)
28096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
28196049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s1>)
28296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
28396049fcfSMichael Maitland  %b = shufflevector <vscale x 8 x i1> %a , <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
28496049fcfSMichael Maitland  ret <vscale x 8 x i1> %b
28596049fcfSMichael Maitland}
28696049fcfSMichael Maitland
28796049fcfSMichael Maitlanddefine <vscale x 16 x i1> @shufflevector_nxv16i1_0() {
28896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i1_0
28996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
29096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s1>) = G_IMPLICIT_DEF
291ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
292ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s1>), [[C]](s32)
29396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
29496049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s1>)
29596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
29696049fcfSMichael Maitland  ;
29796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i1_0
29896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
29996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s1>) = G_IMPLICIT_DEF
30096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
30196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s1>), [[C]](s64)
30296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
30396049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s1>)
30496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
30596049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i1> poison, <vscale x 16 x i1> poison, <vscale x 16 x i32> poison
30696049fcfSMichael Maitland  ret <vscale x 16 x i1> %a
30796049fcfSMichael Maitland}
30896049fcfSMichael Maitland
30996049fcfSMichael Maitlanddefine <vscale x 16 x i1> @shufflevector_nxv16i1_1() {
31096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i1_1
31196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
31296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s1>) = G_IMPLICIT_DEF
313ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
314ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s1>), [[C]](s32)
31596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
31696049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s1>)
31796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
31896049fcfSMichael Maitland  ;
31996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i1_1
32096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
32196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s1>) = G_IMPLICIT_DEF
32296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
32396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s1>), [[C]](s64)
32496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
32596049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s1>)
32696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
32796049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i1> undef, <vscale x 16 x i1> undef, <vscale x 16 x i32> undef
32896049fcfSMichael Maitland  ret <vscale x 16 x i1> %a
32996049fcfSMichael Maitland}
33096049fcfSMichael Maitland
33196049fcfSMichael Maitlanddefine <vscale x 16 x i1> @shufflevector_nxv16i1_2(<vscale x 16 x i1> %a) {
33296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i1_2
33396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
33496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v0
33596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
33696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 16 x s1>) = COPY $v0
337ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
338ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 16 x s1>), [[C]](s32)
33996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
34096049fcfSMichael Maitland  ; RV32-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s1>)
34196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v0
34296049fcfSMichael Maitland  ;
34396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i1_2
34496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
34596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v0
34696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
34796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 16 x s1>) = COPY $v0
34896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
34996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s1) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 16 x s1>), [[C]](s64)
35096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s1>) = G_SPLAT_VECTOR [[EVEC]](s1)
35196049fcfSMichael Maitland  ; RV64-NEXT:   $v0 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s1>)
35296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v0
35396049fcfSMichael Maitland  %b = shufflevector <vscale x 16 x i1> %a , <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
35496049fcfSMichael Maitland  ret <vscale x 16 x i1> %b
35596049fcfSMichael Maitland}
35696049fcfSMichael Maitland
35796049fcfSMichael Maitlanddefine <vscale x 1 x i8> @shufflevector_nxv1i8_0() {
35896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i8_0
35996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
36096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s8>) = G_IMPLICIT_DEF
361ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
362ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s8>), [[C]](s32)
36396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
36496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s8>)
36596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
36696049fcfSMichael Maitland  ;
36796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i8_0
36896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
36996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s8>) = G_IMPLICIT_DEF
37096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
37196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s8>), [[C]](s64)
37296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
37396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s8>)
37496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
37596049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i8> poison, <vscale x 1 x i8> poison, <vscale x 1 x i32> poison
37696049fcfSMichael Maitland  ret <vscale x 1 x i8> %a
37796049fcfSMichael Maitland}
37896049fcfSMichael Maitland
37996049fcfSMichael Maitlanddefine <vscale x 1 x i8> @shufflevector_nxv1i8_1() {
38096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i8_1
38196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
38296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s8>) = G_IMPLICIT_DEF
383ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
384ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s8>), [[C]](s32)
38596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
38696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s8>)
38796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
38896049fcfSMichael Maitland  ;
38996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i8_1
39096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
39196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s8>) = G_IMPLICIT_DEF
39296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
39396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s8>), [[C]](s64)
39496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
39596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s8>)
39696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
39796049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i8> undef, <vscale x 1 x i8> undef, <vscale x 1 x i32> undef
39896049fcfSMichael Maitland  ret <vscale x 1 x i8> %a
39996049fcfSMichael Maitland}
40096049fcfSMichael Maitland
40196049fcfSMichael Maitlanddefine <vscale x 1 x i8> @shufflevector_nxv1i8_2(<vscale x 1 x i8> %a) {
40296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i8_2
40396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
40496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
40596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
40696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s8>) = COPY $v8
407ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
408ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s8>), [[C]](s32)
40996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
41096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s8>)
41196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
41296049fcfSMichael Maitland  ;
41396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i8_2
41496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
41596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
41696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
41796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s8>) = COPY $v8
41896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
41996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s8>), [[C]](s64)
42096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
42196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s8>)
42296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
42396049fcfSMichael Maitland  %b = shufflevector <vscale x 1 x i8> %a , <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
42496049fcfSMichael Maitland  ret <vscale x 1 x i8> %b
42596049fcfSMichael Maitland}
42696049fcfSMichael Maitland
42796049fcfSMichael Maitlanddefine <vscale x 2 x i8> @shufflevector_nxv2i8_0() {
42896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i8_0
42996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
43096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s8>) = G_IMPLICIT_DEF
431ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
432ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s8>), [[C]](s32)
43396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
43496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s8>)
43596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
43696049fcfSMichael Maitland  ;
43796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i8_0
43896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
43996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s8>) = G_IMPLICIT_DEF
44096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
44196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s8>), [[C]](s64)
44296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
44396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s8>)
44496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
44596049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i8> poison, <vscale x 2 x i8> poison, <vscale x 2 x i32> poison
44696049fcfSMichael Maitland  ret <vscale x 2 x i8> %a
44796049fcfSMichael Maitland}
44896049fcfSMichael Maitland
44996049fcfSMichael Maitlanddefine <vscale x 2 x i8> @shufflevector_nxv2i8_1() {
45096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i8_1
45196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
45296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s8>) = G_IMPLICIT_DEF
453ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
454ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s8>), [[C]](s32)
45596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
45696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s8>)
45796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
45896049fcfSMichael Maitland  ;
45996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i8_1
46096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
46196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s8>) = G_IMPLICIT_DEF
46296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
46396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s8>), [[C]](s64)
46496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
46596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s8>)
46696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
46796049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i8> undef, <vscale x 2 x i8> undef, <vscale x 2 x i32> undef
46896049fcfSMichael Maitland  ret <vscale x 2 x i8> %a
46996049fcfSMichael Maitland}
47096049fcfSMichael Maitland
47196049fcfSMichael Maitlanddefine <vscale x 2 x i8> @shufflevector_nxv2i8_2(<vscale x 2 x i8> %a) {
47296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i8_2
47396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
47496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
47596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
47696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s8>) = COPY $v8
477ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
478ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s8>), [[C]](s32)
47996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
48096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s8>)
48196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
48296049fcfSMichael Maitland  ;
48396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i8_2
48496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
48596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
48696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
48796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s8>) = COPY $v8
48896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
48996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s8>), [[C]](s64)
49096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
49196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s8>)
49296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
49396049fcfSMichael Maitland  %b = shufflevector <vscale x 2 x i8> %a , <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
49496049fcfSMichael Maitland  ret <vscale x 2 x i8> %b
49596049fcfSMichael Maitland}
49696049fcfSMichael Maitland
49796049fcfSMichael Maitlanddefine <vscale x 4 x i8> @shufflevector_nxv4i8_0() {
49896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i8_0
49996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
50096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s8>) = G_IMPLICIT_DEF
501ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
502ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s8>), [[C]](s32)
50396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
50496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s8>)
50596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
50696049fcfSMichael Maitland  ;
50796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i8_0
50896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
50996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s8>) = G_IMPLICIT_DEF
51096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
51196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s8>), [[C]](s64)
51296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
51396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s8>)
51496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
51596049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i8> poison, <vscale x 4 x i8> poison, <vscale x 4 x i32> poison
51696049fcfSMichael Maitland  ret <vscale x 4 x i8> %a
51796049fcfSMichael Maitland}
51896049fcfSMichael Maitland
51996049fcfSMichael Maitlanddefine <vscale x 4 x i8> @shufflevector_nxv4i8_1() {
52096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i8_1
52196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
52296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s8>) = G_IMPLICIT_DEF
523ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
524ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s8>), [[C]](s32)
52596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
52696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s8>)
52796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
52896049fcfSMichael Maitland  ;
52996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i8_1
53096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
53196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s8>) = G_IMPLICIT_DEF
53296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
53396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s8>), [[C]](s64)
53496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
53596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s8>)
53696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
53796049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i8> undef, <vscale x 4 x i8> undef, <vscale x 4 x i32> undef
53896049fcfSMichael Maitland  ret <vscale x 4 x i8> %a
53996049fcfSMichael Maitland}
54096049fcfSMichael Maitland
54196049fcfSMichael Maitlanddefine <vscale x 4 x i8> @shufflevector_nxv4i8_2(<vscale x 4 x i8> %a) {
54296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i8_2
54396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
54496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
54596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
54696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s8>) = COPY $v8
547ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
548ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s8>), [[C]](s32)
54996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
55096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s8>)
55196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
55296049fcfSMichael Maitland  ;
55396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i8_2
55496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
55596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
55696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
55796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s8>) = COPY $v8
55896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
55996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s8>), [[C]](s64)
56096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
56196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s8>)
56296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
56396049fcfSMichael Maitland  %b = shufflevector <vscale x 4 x i8> %a , <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
56496049fcfSMichael Maitland  ret <vscale x 4 x i8> %b
56596049fcfSMichael Maitland}
56696049fcfSMichael Maitland
56796049fcfSMichael Maitlanddefine <vscale x 8 x i8> @shufflevector_nxv8i8_0() {
56896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i8_0
56996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
57096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s8>) = G_IMPLICIT_DEF
571ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
572ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s8>), [[C]](s32)
57396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
57496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s8>)
57596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
57696049fcfSMichael Maitland  ;
57796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i8_0
57896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
57996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s8>) = G_IMPLICIT_DEF
58096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
58196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s8>), [[C]](s64)
58296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
58396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s8>)
58496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
58596049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i8> poison, <vscale x 8 x i8> poison, <vscale x 8 x i32> poison
58696049fcfSMichael Maitland  ret <vscale x 8 x i8> %a
58796049fcfSMichael Maitland}
58896049fcfSMichael Maitland
58996049fcfSMichael Maitlanddefine <vscale x 8 x i8> @shufflevector_nxv8i8_1() {
59096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i8_1
59196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
59296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s8>) = G_IMPLICIT_DEF
593ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
594ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s8>), [[C]](s32)
59596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
59696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s8>)
59796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
59896049fcfSMichael Maitland  ;
59996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i8_1
60096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
60196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s8>) = G_IMPLICIT_DEF
60296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
60396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s8>), [[C]](s64)
60496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
60596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s8>)
60696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
60796049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i8> undef, <vscale x 8 x i8> undef, <vscale x 8 x i32> undef
60896049fcfSMichael Maitland  ret <vscale x 8 x i8> %a
60996049fcfSMichael Maitland}
61096049fcfSMichael Maitland
61196049fcfSMichael Maitlanddefine <vscale x 8 x i8> @shufflevector_nxv8i8_2(<vscale x 8 x i8> %a) {
61296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i8_2
61396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
61496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
61596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
61696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s8>) = COPY $v8
617ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
618ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s8>), [[C]](s32)
61996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
62096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s8>)
62196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
62296049fcfSMichael Maitland  ;
62396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i8_2
62496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
62596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
62696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
62796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s8>) = COPY $v8
62896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
62996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s8>), [[C]](s64)
63096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
63196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s8>)
63296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
63396049fcfSMichael Maitland  %b = shufflevector <vscale x 8 x i8> %a , <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
63496049fcfSMichael Maitland  ret <vscale x 8 x i8> %b
63596049fcfSMichael Maitland}
63696049fcfSMichael Maitland
63796049fcfSMichael Maitlanddefine <vscale x 16 x i8> @shufflevector_nxv16i8_0() {
63896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i8_0
63996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
64096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s8>) = G_IMPLICIT_DEF
641ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
642ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s8>), [[C]](s32)
64396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
64496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s8>)
64596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
64696049fcfSMichael Maitland  ;
64796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i8_0
64896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
64996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s8>) = G_IMPLICIT_DEF
65096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
65196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s8>), [[C]](s64)
65296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
65396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s8>)
65496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
65596049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i8> poison, <vscale x 16 x i8> poison, <vscale x 16 x i32> poison
65696049fcfSMichael Maitland  ret <vscale x 16 x i8> %a
65796049fcfSMichael Maitland}
65896049fcfSMichael Maitland
65996049fcfSMichael Maitlanddefine <vscale x 16 x i8> @shufflevector_nxv16i8_1() {
66096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i8_1
66196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
66296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s8>) = G_IMPLICIT_DEF
663ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
664ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s8>), [[C]](s32)
66596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
66696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s8>)
66796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
66896049fcfSMichael Maitland  ;
66996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i8_1
67096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
67196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s8>) = G_IMPLICIT_DEF
67296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
67396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s8>), [[C]](s64)
67496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
67596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s8>)
67696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
67796049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i8> undef, <vscale x 16 x i8> undef, <vscale x 16 x i32> undef
67896049fcfSMichael Maitland  ret <vscale x 16 x i8> %a
67996049fcfSMichael Maitland}
68096049fcfSMichael Maitland
68196049fcfSMichael Maitlanddefine <vscale x 16 x i8> @shufflevector_nxv16i8_2(<vscale x 16 x i8> %a) {
68296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i8_2
68396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
68496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m2
68596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
68696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 16 x s8>) = COPY $v8m2
687ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
688ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 16 x s8>), [[C]](s32)
68996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
69096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s8>)
69196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
69296049fcfSMichael Maitland  ;
69396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i8_2
69496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
69596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m2
69696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
69796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 16 x s8>) = COPY $v8m2
69896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
69996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 16 x s8>), [[C]](s64)
70096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s8>) = G_SPLAT_VECTOR [[EVEC]](s8)
70196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s8>)
70296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
70396049fcfSMichael Maitland  %b = shufflevector <vscale x 16 x i8> %a , <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
70496049fcfSMichael Maitland  ret <vscale x 16 x i8> %b
70596049fcfSMichael Maitland}
70696049fcfSMichael Maitland
70796049fcfSMichael Maitlanddefine <vscale x 1 x i16> @shufflevector_nxv1i16_0() {
70896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i16_0
70996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
71096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s16>) = G_IMPLICIT_DEF
711ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
712ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s16>), [[C]](s32)
71396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
71496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s16>)
71596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
71696049fcfSMichael Maitland  ;
71796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i16_0
71896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
71996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s16>) = G_IMPLICIT_DEF
72096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
72196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s16>), [[C]](s64)
72296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
72396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s16>)
72496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
72596049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i16> poison, <vscale x 1 x i16> poison, <vscale x 1 x i32> poison
72696049fcfSMichael Maitland  ret <vscale x 1 x i16> %a
72796049fcfSMichael Maitland}
72896049fcfSMichael Maitland
72996049fcfSMichael Maitlanddefine <vscale x 1 x i16> @shufflevector_nxv1i16_1() {
73096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i16_1
73196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
73296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s16>) = G_IMPLICIT_DEF
733ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
734ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s16>), [[C]](s32)
73596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
73696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s16>)
73796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
73896049fcfSMichael Maitland  ;
73996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i16_1
74096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
74196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s16>) = G_IMPLICIT_DEF
74296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
74396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s16>), [[C]](s64)
74496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
74596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s16>)
74696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
74796049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i16> undef, <vscale x 1 x i16> undef, <vscale x 1 x i32> undef
74896049fcfSMichael Maitland  ret <vscale x 1 x i16> %a
74996049fcfSMichael Maitland}
75096049fcfSMichael Maitland
75196049fcfSMichael Maitlanddefine <vscale x 1 x i16> @shufflevector_nxv1i16_2(<vscale x 1 x i16> %a) {
75296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i16_2
75396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
75496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
75596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
75696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s16>) = COPY $v8
757ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
758ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s16>), [[C]](s32)
75996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
76096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s16>)
76196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
76296049fcfSMichael Maitland  ;
76396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i16_2
76496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
76596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
76696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
76796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s16>) = COPY $v8
76896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
76996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s16>), [[C]](s64)
77096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
77196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s16>)
77296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
77396049fcfSMichael Maitland  %b = shufflevector <vscale x 1 x i16> %a , <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
77496049fcfSMichael Maitland  ret <vscale x 1 x i16> %b
77596049fcfSMichael Maitland}
77696049fcfSMichael Maitland
77796049fcfSMichael Maitlanddefine <vscale x 2 x i16> @shufflevector_nxv2i16_0() {
77896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i16_0
77996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
78096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s16>) = G_IMPLICIT_DEF
781ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
782ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s16>), [[C]](s32)
78396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
78496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s16>)
78596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
78696049fcfSMichael Maitland  ;
78796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i16_0
78896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
78996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s16>) = G_IMPLICIT_DEF
79096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
79196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s16>), [[C]](s64)
79296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
79396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s16>)
79496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
79596049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i16> poison, <vscale x 2 x i16> poison, <vscale x 2 x i32> poison
79696049fcfSMichael Maitland  ret <vscale x 2 x i16> %a
79796049fcfSMichael Maitland}
79896049fcfSMichael Maitland
79996049fcfSMichael Maitlanddefine <vscale x 2 x i16> @shufflevector_nxv2i16_1() {
80096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i16_1
80196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
80296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s16>) = G_IMPLICIT_DEF
803ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
804ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s16>), [[C]](s32)
80596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
80696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s16>)
80796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
80896049fcfSMichael Maitland  ;
80996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i16_1
81096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
81196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s16>) = G_IMPLICIT_DEF
81296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
81396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s16>), [[C]](s64)
81496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
81596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s16>)
81696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
81796049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i16> undef, <vscale x 2 x i16> undef, <vscale x 2 x i32> undef
81896049fcfSMichael Maitland  ret <vscale x 2 x i16> %a
81996049fcfSMichael Maitland}
82096049fcfSMichael Maitland
82196049fcfSMichael Maitlanddefine <vscale x 2 x i16> @shufflevector_nxv2i16_2(<vscale x 2 x i16> %a) {
82296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i16_2
82396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
82496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
82596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
82696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s16>) = COPY $v8
827ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
828ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s16>), [[C]](s32)
82996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
83096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s16>)
83196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
83296049fcfSMichael Maitland  ;
83396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i16_2
83496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
83596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
83696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
83796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s16>) = COPY $v8
83896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
83996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s16>), [[C]](s64)
84096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
84196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s16>)
84296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
84396049fcfSMichael Maitland  %b = shufflevector <vscale x 2 x i16> %a , <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
84496049fcfSMichael Maitland  ret <vscale x 2 x i16> %b
84596049fcfSMichael Maitland}
84696049fcfSMichael Maitland
84796049fcfSMichael Maitlanddefine <vscale x 4 x i16> @shufflevector_nxv4i16_0() {
84896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i16_0
84996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
85096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s16>) = G_IMPLICIT_DEF
851ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
852ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s16>), [[C]](s32)
85396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
85496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s16>)
85596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
85696049fcfSMichael Maitland  ;
85796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i16_0
85896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
85996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s16>) = G_IMPLICIT_DEF
86096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
86196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s16>), [[C]](s64)
86296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
86396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s16>)
86496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
86596049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i16> poison, <vscale x 4 x i16> poison, <vscale x 4 x i32> poison
86696049fcfSMichael Maitland  ret <vscale x 4 x i16> %a
86796049fcfSMichael Maitland}
86896049fcfSMichael Maitland
86996049fcfSMichael Maitlanddefine <vscale x 4 x i16> @shufflevector_nxv4i16_1() {
87096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i16_1
87196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
87296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s16>) = G_IMPLICIT_DEF
873ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
874ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s16>), [[C]](s32)
87596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
87696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s16>)
87796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
87896049fcfSMichael Maitland  ;
87996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i16_1
88096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
88196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s16>) = G_IMPLICIT_DEF
88296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
88396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s16>), [[C]](s64)
88496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
88596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s16>)
88696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
88796049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i16> undef, <vscale x 4 x i16> undef, <vscale x 4 x i32> undef
88896049fcfSMichael Maitland  ret <vscale x 4 x i16> %a
88996049fcfSMichael Maitland}
89096049fcfSMichael Maitland
89196049fcfSMichael Maitlanddefine <vscale x 4 x i16> @shufflevector_nxv4i16_2(<vscale x 4 x i16> %a) {
89296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i16_2
89396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
89496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
89596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
89696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s16>) = COPY $v8
897ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
898ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s16>), [[C]](s32)
89996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
90096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s16>)
90196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
90296049fcfSMichael Maitland  ;
90396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i16_2
90496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
90596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
90696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
90796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s16>) = COPY $v8
90896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
90996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s16>), [[C]](s64)
91096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
91196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s16>)
91296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
91396049fcfSMichael Maitland  %b = shufflevector <vscale x 4 x i16> %a , <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
91496049fcfSMichael Maitland  ret <vscale x 4 x i16> %b
91596049fcfSMichael Maitland}
91696049fcfSMichael Maitland
91796049fcfSMichael Maitlanddefine <vscale x 8 x i16> @shufflevector_nxv8i16_0() {
91896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i16_0
91996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
92096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s16>) = G_IMPLICIT_DEF
921ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
922ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s16>), [[C]](s32)
92396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
92496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s16>)
92596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
92696049fcfSMichael Maitland  ;
92796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i16_0
92896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
92996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s16>) = G_IMPLICIT_DEF
93096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
93196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s16>), [[C]](s64)
93296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
93396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s16>)
93496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
93596049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i16> poison, <vscale x 8 x i16> poison, <vscale x 8 x i32> poison
93696049fcfSMichael Maitland  ret <vscale x 8 x i16> %a
93796049fcfSMichael Maitland}
93896049fcfSMichael Maitland
93996049fcfSMichael Maitlanddefine <vscale x 8 x i16> @shufflevector_nxv8i16_1() {
94096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i16_1
94196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
94296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s16>) = G_IMPLICIT_DEF
943ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
944ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s16>), [[C]](s32)
94596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
94696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s16>)
94796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
94896049fcfSMichael Maitland  ;
94996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i16_1
95096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
95196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s16>) = G_IMPLICIT_DEF
95296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
95396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s16>), [[C]](s64)
95496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
95596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s16>)
95696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
95796049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i16> undef, <vscale x 8 x i16> undef, <vscale x 8 x i32> undef
95896049fcfSMichael Maitland  ret <vscale x 8 x i16> %a
95996049fcfSMichael Maitland}
96096049fcfSMichael Maitland
96196049fcfSMichael Maitlanddefine <vscale x 8 x i16> @shufflevector_nxv8i16_2(<vscale x 8 x i16> %a) {
96296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i16_2
96396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
96496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m2
96596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
96696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s16>) = COPY $v8m2
967ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
968ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s16>), [[C]](s32)
96996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
97096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s16>)
97196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
97296049fcfSMichael Maitland  ;
97396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i16_2
97496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
97596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m2
97696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
97796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s16>) = COPY $v8m2
97896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
97996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s16>), [[C]](s64)
98096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
98196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s16>)
98296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
98396049fcfSMichael Maitland  %b = shufflevector <vscale x 8 x i16> %a , <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
98496049fcfSMichael Maitland  ret <vscale x 8 x i16> %b
98596049fcfSMichael Maitland}
98696049fcfSMichael Maitland
98796049fcfSMichael Maitlanddefine <vscale x 16 x i16> @shufflevector_nxv16i16_0() {
98896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i16_0
98996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
99096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s16>) = G_IMPLICIT_DEF
991ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
992ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s16>), [[C]](s32)
99396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
99496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s16>)
99596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
99696049fcfSMichael Maitland  ;
99796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i16_0
99896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
99996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s16>) = G_IMPLICIT_DEF
100096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
100196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s16>), [[C]](s64)
100296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
100396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s16>)
100496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
100596049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i16> poison, <vscale x 16 x i16> poison, <vscale x 16 x i32> poison
100696049fcfSMichael Maitland  ret <vscale x 16 x i16> %a
100796049fcfSMichael Maitland}
100896049fcfSMichael Maitland
100996049fcfSMichael Maitlanddefine <vscale x 16 x i16> @shufflevector_nxv16i16_1() {
101096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i16_1
101196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
101296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s16>) = G_IMPLICIT_DEF
1013ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1014ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s16>), [[C]](s32)
101596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
101696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s16>)
101796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
101896049fcfSMichael Maitland  ;
101996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i16_1
102096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
102196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s16>) = G_IMPLICIT_DEF
102296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
102396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s16>), [[C]](s64)
102496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
102596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s16>)
102696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
102796049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i16> undef, <vscale x 16 x i16> undef, <vscale x 16 x i32> undef
102896049fcfSMichael Maitland  ret <vscale x 16 x i16> %a
102996049fcfSMichael Maitland}
103096049fcfSMichael Maitland
103196049fcfSMichael Maitlanddefine <vscale x 16 x i16> @shufflevector_nxv16i16_2(<vscale x 16 x i16> %a) {
103296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i16_2
103396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
103496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m4
103596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
103696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 16 x s16>) = COPY $v8m4
1037ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1038ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 16 x s16>), [[C]](s32)
103996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
104096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s16>)
104196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
104296049fcfSMichael Maitland  ;
104396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i16_2
104496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
104596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m4
104696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
104796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 16 x s16>) = COPY $v8m4
104896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
104996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 16 x s16>), [[C]](s64)
105096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s16>) = G_SPLAT_VECTOR [[EVEC]](s16)
105196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s16>)
105296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
105396049fcfSMichael Maitland  %b = shufflevector <vscale x 16 x i16> %a , <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
105496049fcfSMichael Maitland  ret <vscale x 16 x i16> %b
105596049fcfSMichael Maitland}
105696049fcfSMichael Maitland
105796049fcfSMichael Maitlanddefine <vscale x 1 x i32> @shufflevector_nxv1i32_0() {
105896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i32_0
105996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
106096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF
1061ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1062ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s32>), [[C]](s32)
106396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
106496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s32>)
106596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
106696049fcfSMichael Maitland  ;
106796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i32_0
106896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
106996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF
107096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
107196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s32>), [[C]](s64)
107296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
107396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s32>)
107496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
107596049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i32> poison, <vscale x 1 x i32> poison, <vscale x 1 x i32> poison
107696049fcfSMichael Maitland  ret <vscale x 1 x i32> %a
107796049fcfSMichael Maitland}
107896049fcfSMichael Maitland
107996049fcfSMichael Maitlanddefine <vscale x 1 x i32> @shufflevector_nxv1i32_1() {
108096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i32_1
108196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
108296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF
1083ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1084ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s32>), [[C]](s32)
108596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
108696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s32>)
108796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
108896049fcfSMichael Maitland  ;
108996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i32_1
109096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
109196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF
109296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
109396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s32>), [[C]](s64)
109496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
109596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s32>)
109696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
109796049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i32> undef, <vscale x 1 x i32> undef, <vscale x 1 x i32> undef
109896049fcfSMichael Maitland  ret <vscale x 1 x i32> %a
109996049fcfSMichael Maitland}
110096049fcfSMichael Maitland
110196049fcfSMichael Maitlanddefine <vscale x 1 x i32> @shufflevector_nxv1i32_2(<vscale x 1 x i32> %a) {
110296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i32_2
110396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
110496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
110596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
110696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s32>) = COPY $v8
1107ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1108ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s32>), [[C]](s32)
110996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
111096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s32>)
111196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
111296049fcfSMichael Maitland  ;
111396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i32_2
111496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
111596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
111696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
111796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s32>) = COPY $v8
111896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
111996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s32>), [[C]](s64)
112096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
112196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s32>)
112296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
112396049fcfSMichael Maitland  %b = shufflevector <vscale x 1 x i32> %a , <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
112496049fcfSMichael Maitland  ret <vscale x 1 x i32> %b
112596049fcfSMichael Maitland}
112696049fcfSMichael Maitland
112796049fcfSMichael Maitlanddefine <vscale x 2 x i32> @shufflevector_nxv2i32_0() {
112896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i32_0
112996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
113096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
1131ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1132ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s32>), [[C]](s32)
113396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
113496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s32>)
113596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
113696049fcfSMichael Maitland  ;
113796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i32_0
113896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
113996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
114096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
114196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s32>), [[C]](s64)
114296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
114396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s32>)
114496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
114596049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i32> poison, <vscale x 2 x i32> poison, <vscale x 2 x i32> poison
114696049fcfSMichael Maitland  ret <vscale x 2 x i32> %a
114796049fcfSMichael Maitland}
114896049fcfSMichael Maitland
114996049fcfSMichael Maitlanddefine <vscale x 2 x i32> @shufflevector_nxv2i32_1() {
115096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i32_1
115196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
115296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
1153ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1154ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s32>), [[C]](s32)
115596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
115696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s32>)
115796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
115896049fcfSMichael Maitland  ;
115996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i32_1
116096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
116196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
116296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
116396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s32>), [[C]](s64)
116496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
116596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s32>)
116696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
116796049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i32> undef, <vscale x 2 x i32> undef, <vscale x 2 x i32> undef
116896049fcfSMichael Maitland  ret <vscale x 2 x i32> %a
116996049fcfSMichael Maitland}
117096049fcfSMichael Maitland
117196049fcfSMichael Maitlanddefine <vscale x 2 x i32> @shufflevector_nxv2i32_2(<vscale x 2 x i32> %a) {
117296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i32_2
117396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
117496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
117596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
117696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s32>) = COPY $v8
1177ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1178ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s32>), [[C]](s32)
117996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
118096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s32>)
118196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
118296049fcfSMichael Maitland  ;
118396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i32_2
118496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
118596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
118696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
118796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s32>) = COPY $v8
118896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
118996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s32>), [[C]](s64)
119096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
119196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s32>)
119296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
119396049fcfSMichael Maitland  %b = shufflevector <vscale x 2 x i32> %a , <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
119496049fcfSMichael Maitland  ret <vscale x 2 x i32> %b
119596049fcfSMichael Maitland}
119696049fcfSMichael Maitland
119796049fcfSMichael Maitlanddefine <vscale x 4 x i32> @shufflevector_nxv4i32_0() {
119896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i32_0
119996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
120096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s32>) = G_IMPLICIT_DEF
1201ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1202ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s32>), [[C]](s32)
120396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
120496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s32>)
120596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
120696049fcfSMichael Maitland  ;
120796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i32_0
120896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
120996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s32>) = G_IMPLICIT_DEF
121096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
121196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s32>), [[C]](s64)
121296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
121396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s32>)
121496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
121596049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i32> poison, <vscale x 4 x i32> poison, <vscale x 4 x i32> poison
121696049fcfSMichael Maitland  ret <vscale x 4 x i32> %a
121796049fcfSMichael Maitland}
121896049fcfSMichael Maitland
121996049fcfSMichael Maitlanddefine <vscale x 4 x i32> @shufflevector_nxv4i32_1() {
122096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i32_1
122196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
122296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s32>) = G_IMPLICIT_DEF
1223ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1224ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s32>), [[C]](s32)
122596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
122696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s32>)
122796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
122896049fcfSMichael Maitland  ;
122996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i32_1
123096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
123196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s32>) = G_IMPLICIT_DEF
123296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
123396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s32>), [[C]](s64)
123496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
123596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s32>)
123696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
123796049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i32> undef, <vscale x 4 x i32> undef, <vscale x 4 x i32> undef
123896049fcfSMichael Maitland  ret <vscale x 4 x i32> %a
123996049fcfSMichael Maitland}
124096049fcfSMichael Maitland
124196049fcfSMichael Maitlanddefine <vscale x 4 x i32> @shufflevector_nxv4i32_2(<vscale x 4 x i32> %a) {
124296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i32_2
124396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
124496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m2
124596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
124696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s32>) = COPY $v8m2
1247ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1248ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s32>), [[C]](s32)
124996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
125096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s32>)
125196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
125296049fcfSMichael Maitland  ;
125396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i32_2
125496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
125596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m2
125696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
125796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s32>) = COPY $v8m2
125896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
125996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s32>), [[C]](s64)
126096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
126196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s32>)
126296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
126396049fcfSMichael Maitland  %b = shufflevector <vscale x 4 x i32> %a , <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
126496049fcfSMichael Maitland  ret <vscale x 4 x i32> %b
126596049fcfSMichael Maitland}
126696049fcfSMichael Maitland
126796049fcfSMichael Maitlanddefine <vscale x 8 x i32> @shufflevector_nxv8i32_0() {
126896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i32_0
126996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
127096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s32>) = G_IMPLICIT_DEF
1271ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1272ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s32>), [[C]](s32)
127396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
127496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s32>)
127596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
127696049fcfSMichael Maitland  ;
127796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i32_0
127896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
127996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s32>) = G_IMPLICIT_DEF
128096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
128196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s32>), [[C]](s64)
128296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
128396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s32>)
128496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
128596049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i32> poison, <vscale x 8 x i32> poison, <vscale x 8 x i32> poison
128696049fcfSMichael Maitland  ret <vscale x 8 x i32> %a
128796049fcfSMichael Maitland}
128896049fcfSMichael Maitland
128996049fcfSMichael Maitlanddefine <vscale x 8 x i32> @shufflevector_nxv8i32_1() {
129096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i32_1
129196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
129296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s32>) = G_IMPLICIT_DEF
1293ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1294ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s32>), [[C]](s32)
129596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
129696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s32>)
129796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
129896049fcfSMichael Maitland  ;
129996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i32_1
130096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
130196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s32>) = G_IMPLICIT_DEF
130296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
130396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s32>), [[C]](s64)
130496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
130596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s32>)
130696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
130796049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i32> undef, <vscale x 8 x i32> undef, <vscale x 8 x i32> undef
130896049fcfSMichael Maitland  ret <vscale x 8 x i32> %a
130996049fcfSMichael Maitland}
131096049fcfSMichael Maitland
131196049fcfSMichael Maitlanddefine <vscale x 8 x i32> @shufflevector_nxv8i32_2(<vscale x 8 x i32> %a) {
131296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i32_2
131396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
131496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m4
131596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
131696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s32>) = COPY $v8m4
1317ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1318ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s32>), [[C]](s32)
131996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
132096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s32>)
132196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
132296049fcfSMichael Maitland  ;
132396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i32_2
132496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
132596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m4
132696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
132796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s32>) = COPY $v8m4
132896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
132996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s32>), [[C]](s64)
133096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
133196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s32>)
133296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
133396049fcfSMichael Maitland  %b = shufflevector <vscale x 8 x i32> %a , <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
133496049fcfSMichael Maitland  ret <vscale x 8 x i32> %b
133596049fcfSMichael Maitland}
133696049fcfSMichael Maitland
133796049fcfSMichael Maitlanddefine <vscale x 16 x i32> @shufflevector_nxv16i32_0() {
133896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i32_0
133996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
134096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s32>) = G_IMPLICIT_DEF
1341ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1342ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s32>), [[C]](s32)
134396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
134496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s32>)
134596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8
134696049fcfSMichael Maitland  ;
134796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i32_0
134896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
134996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s32>) = G_IMPLICIT_DEF
135096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
135196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s32>), [[C]](s64)
135296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
135396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s32>)
135496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8
135596049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i32> poison, <vscale x 16 x i32> poison, <vscale x 16 x i32> poison
135696049fcfSMichael Maitland  ret <vscale x 16 x i32> %a
135796049fcfSMichael Maitland}
135896049fcfSMichael Maitland
135996049fcfSMichael Maitlanddefine <vscale x 16 x i32> @shufflevector_nxv16i32_1() {
136096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i32_1
136196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
136296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s32>) = G_IMPLICIT_DEF
1363ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1364ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s32>), [[C]](s32)
136596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
136696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s32>)
136796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8
136896049fcfSMichael Maitland  ;
136996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i32_1
137096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
137196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s32>) = G_IMPLICIT_DEF
137296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
137396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s32>), [[C]](s64)
137496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
137596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s32>)
137696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8
137796049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i32> undef, <vscale x 16 x i32> undef, <vscale x 16 x i32> undef
137896049fcfSMichael Maitland  ret <vscale x 16 x i32> %a
137996049fcfSMichael Maitland}
138096049fcfSMichael Maitland
138196049fcfSMichael Maitlanddefine <vscale x 16 x i32> @shufflevector_nxv16i32_2(<vscale x 16 x i32> %a) {
138296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i32_2
138396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
138496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m8
138596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
138696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 16 x s32>) = COPY $v8m8
1387ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1388ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 16 x s32>), [[C]](s32)
138996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
139096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s32>)
139196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8
139296049fcfSMichael Maitland  ;
139396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i32_2
139496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
139596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m8
139696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
139796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 16 x s32>) = COPY $v8m8
139896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
139996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 16 x s32>), [[C]](s64)
140096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s32>) = G_SPLAT_VECTOR [[EVEC]](s32)
140196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 16 x s32>)
140296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8
140396049fcfSMichael Maitland  %b = shufflevector <vscale x 16 x i32> %a , <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
140496049fcfSMichael Maitland  ret <vscale x 16 x i32> %b
140596049fcfSMichael Maitland}
140696049fcfSMichael Maitland
140796049fcfSMichael Maitlanddefine <vscale x 1 x i64> @shufflevector_nxv1i64_0() {
140896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i64_0
140996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
141096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s64>) = G_IMPLICIT_DEF
1411ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1412ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s64>), [[C]](s32)
141396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
141496049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s64>)
141596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
141696049fcfSMichael Maitland  ;
141796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i64_0
141896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
141996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s64>) = G_IMPLICIT_DEF
142096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
142196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s64>), [[C]](s64)
142296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
142396049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s64>)
142496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
142596049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i64> poison, <vscale x 1 x i64> poison, <vscale x 1 x i32> poison
142696049fcfSMichael Maitland  ret <vscale x 1 x i64> %a
142796049fcfSMichael Maitland}
142896049fcfSMichael Maitland
142996049fcfSMichael Maitlanddefine <vscale x 1 x i64> @shufflevector_nxv1i64_1() {
143096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i64_1
143196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
143296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s64>) = G_IMPLICIT_DEF
1433ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1434ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s64>), [[C]](s32)
143596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
143696049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s64>)
143796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
143896049fcfSMichael Maitland  ;
143996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i64_1
144096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
144196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x s64>) = G_IMPLICIT_DEF
144296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
144396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x s64>), [[C]](s64)
144496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
144596049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s64>)
144696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
144796049fcfSMichael Maitland  %a = shufflevector <vscale x 1 x i64> undef, <vscale x 1 x i64> undef, <vscale x 1 x i32> undef
144896049fcfSMichael Maitland  ret <vscale x 1 x i64> %a
144996049fcfSMichael Maitland}
145096049fcfSMichael Maitland
145196049fcfSMichael Maitlanddefine <vscale x 1 x i64> @shufflevector_nxv1i64_2(<vscale x 1 x i64> %a) {
145296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv1i64_2
145396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
145496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8
145596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
145696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s64>) = COPY $v8
1457ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1458ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s64>), [[C]](s32)
145996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
146096049fcfSMichael Maitland  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s64>)
146196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8
146296049fcfSMichael Maitland  ;
146396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv1i64_2
146496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
146596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8
146696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
146796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 1 x s64>) = COPY $v8
146896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
146996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 1 x s64>), [[C]](s64)
147096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
147196049fcfSMichael Maitland  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x s64>)
147296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8
147396049fcfSMichael Maitland  %b = shufflevector <vscale x 1 x i64> %a , <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
147496049fcfSMichael Maitland  ret <vscale x 1 x i64> %b
147596049fcfSMichael Maitland}
147696049fcfSMichael Maitland
147796049fcfSMichael Maitlanddefine <vscale x 2 x i64> @shufflevector_nxv2i64_0() {
147896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i64_0
147996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
148096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s64>) = G_IMPLICIT_DEF
1481ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1482ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s64>), [[C]](s32)
148396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
148496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s64>)
148596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
148696049fcfSMichael Maitland  ;
148796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i64_0
148896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
148996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s64>) = G_IMPLICIT_DEF
149096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
149196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s64>), [[C]](s64)
149296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
149396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s64>)
149496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
149596049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i64> poison, <vscale x 2 x i64> poison, <vscale x 2 x i32> poison
149696049fcfSMichael Maitland  ret <vscale x 2 x i64> %a
149796049fcfSMichael Maitland}
149896049fcfSMichael Maitland
149996049fcfSMichael Maitlanddefine <vscale x 2 x i64> @shufflevector_nxv2i64_1() {
150096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i64_1
150196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
150296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s64>) = G_IMPLICIT_DEF
1503ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1504ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s64>), [[C]](s32)
150596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
150696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s64>)
150796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
150896049fcfSMichael Maitland  ;
150996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i64_1
151096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
151196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 2 x s64>) = G_IMPLICIT_DEF
151296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
151396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 2 x s64>), [[C]](s64)
151496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
151596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s64>)
151696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
151796049fcfSMichael Maitland  %a = shufflevector <vscale x 2 x i64> undef, <vscale x 2 x i64> undef, <vscale x 2 x i32> undef
151896049fcfSMichael Maitland  ret <vscale x 2 x i64> %a
151996049fcfSMichael Maitland}
152096049fcfSMichael Maitland
152196049fcfSMichael Maitlanddefine <vscale x 2 x i64> @shufflevector_nxv2i64_2(<vscale x 2 x i64> %a) {
152296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv2i64_2
152396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
152496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m2
152596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
152696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s64>) = COPY $v8m2
1527ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1528ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s64>), [[C]](s32)
152996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
153096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s64>)
153196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m2
153296049fcfSMichael Maitland  ;
153396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv2i64_2
153496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
153596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m2
153696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
153796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 2 x s64>) = COPY $v8m2
153896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
153996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 2 x s64>), [[C]](s64)
154096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 2 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
154196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m2 = COPY [[SPLAT_VECTOR]](<vscale x 2 x s64>)
154296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m2
154396049fcfSMichael Maitland  %b = shufflevector <vscale x 2 x i64> %a , <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
154496049fcfSMichael Maitland  ret <vscale x 2 x i64> %b
154596049fcfSMichael Maitland}
154696049fcfSMichael Maitland
154796049fcfSMichael Maitlanddefine <vscale x 4 x i64> @shufflevector_nxv4i64_0() {
154896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i64_0
154996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
155096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s64>) = G_IMPLICIT_DEF
1551ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1552ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s64>), [[C]](s32)
155396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
155496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s64>)
155596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
155696049fcfSMichael Maitland  ;
155796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i64_0
155896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
155996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s64>) = G_IMPLICIT_DEF
156096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
156196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s64>), [[C]](s64)
156296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
156396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s64>)
156496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
156596049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i64> poison, <vscale x 4 x i64> poison, <vscale x 4 x i32> poison
156696049fcfSMichael Maitland  ret <vscale x 4 x i64> %a
156796049fcfSMichael Maitland}
156896049fcfSMichael Maitland
156996049fcfSMichael Maitlanddefine <vscale x 4 x i64> @shufflevector_nxv4i64_1() {
157096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i64_1
157196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
157296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s64>) = G_IMPLICIT_DEF
1573ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1574ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s64>), [[C]](s32)
157596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
157696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s64>)
157796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
157896049fcfSMichael Maitland  ;
157996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i64_1
158096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
158196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 4 x s64>) = G_IMPLICIT_DEF
158296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
158396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 4 x s64>), [[C]](s64)
158496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
158596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s64>)
158696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
158796049fcfSMichael Maitland  %a = shufflevector <vscale x 4 x i64> undef, <vscale x 4 x i64> undef, <vscale x 4 x i32> undef
158896049fcfSMichael Maitland  ret <vscale x 4 x i64> %a
158996049fcfSMichael Maitland}
159096049fcfSMichael Maitland
159196049fcfSMichael Maitlanddefine <vscale x 4 x i64> @shufflevector_nxv4i64_2(<vscale x 4 x i64> %a) {
159296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv4i64_2
159396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
159496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m4
159596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
159696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s64>) = COPY $v8m4
1597ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1598ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s64>), [[C]](s32)
159996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
160096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s64>)
160196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m4
160296049fcfSMichael Maitland  ;
160396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv4i64_2
160496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
160596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m4
160696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
160796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 4 x s64>) = COPY $v8m4
160896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
160996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 4 x s64>), [[C]](s64)
161096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 4 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
161196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m4 = COPY [[SPLAT_VECTOR]](<vscale x 4 x s64>)
161296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m4
161396049fcfSMichael Maitland  %b = shufflevector <vscale x 4 x i64> %a , <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
161496049fcfSMichael Maitland  ret <vscale x 4 x i64> %b
161596049fcfSMichael Maitland}
161696049fcfSMichael Maitland
161796049fcfSMichael Maitlanddefine <vscale x 8 x i64> @shufflevector_nxv8i64_0() {
161896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i64_0
161996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
162096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s64>) = G_IMPLICIT_DEF
1621ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1622ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s64>), [[C]](s32)
162396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
162496049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s64>)
162596049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8
162696049fcfSMichael Maitland  ;
162796049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i64_0
162896049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
162996049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s64>) = G_IMPLICIT_DEF
163096049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
163196049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s64>), [[C]](s64)
163296049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
163396049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s64>)
163496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8
163596049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i64> poison, <vscale x 8 x i64> poison, <vscale x 8 x i32> poison
163696049fcfSMichael Maitland  ret <vscale x 8 x i64> %a
163796049fcfSMichael Maitland}
163896049fcfSMichael Maitland
163996049fcfSMichael Maitlanddefine <vscale x 8 x i64> @shufflevector_nxv8i64_1() {
164096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i64_1
164196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
164296049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s64>) = G_IMPLICIT_DEF
1643ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1644ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s64>), [[C]](s32)
164596049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
164696049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s64>)
164796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8
164896049fcfSMichael Maitland  ;
164996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i64_1
165096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
165196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 8 x s64>) = G_IMPLICIT_DEF
165296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
165396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 8 x s64>), [[C]](s64)
165496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
165596049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s64>)
165696049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8
165796049fcfSMichael Maitland  %a = shufflevector <vscale x 8 x i64> undef, <vscale x 8 x i64> undef, <vscale x 8 x i32> undef
165896049fcfSMichael Maitland  ret <vscale x 8 x i64> %a
165996049fcfSMichael Maitland}
166096049fcfSMichael Maitland
166196049fcfSMichael Maitlanddefine <vscale x 8 x i64> @shufflevector_nxv8i64_2(<vscale x 8 x i64> %a) {
166296049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv8i64_2
166396049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
166496049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m8
166596049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
166696049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s64>) = COPY $v8m8
1667ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1668ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s64>), [[C]](s32)
166996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
167096049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s64>)
167196049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8
167296049fcfSMichael Maitland  ;
167396049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv8i64_2
167496049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
167596049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m8
167696049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
167796049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s64>) = COPY $v8m8
167896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
167996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<vscale x 8 x s64>), [[C]](s64)
168096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 8 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
168196049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[SPLAT_VECTOR]](<vscale x 8 x s64>)
168296049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8
168396049fcfSMichael Maitland  %b = shufflevector <vscale x 8 x i64> %a , <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
168496049fcfSMichael Maitland  ret <vscale x 8 x i64> %b
168596049fcfSMichael Maitland}
168696049fcfSMichael Maitland
168796049fcfSMichael Maitlanddefine <vscale x 16 x i64> @shufflevector_nxv16i64_0() {
168896049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i64_0
168996049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
169096049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s64>) = G_IMPLICIT_DEF
1691ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1692ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s64>), [[C]](s32)
169396049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
169496049fcfSMichael Maitland  ; RV32-NEXT:   [[UV:%[0-9]+]]:_(<vscale x 8 x s64>), [[UV1:%[0-9]+]]:_(<vscale x 8 x s64>) = G_UNMERGE_VALUES [[SPLAT_VECTOR]](<vscale x 16 x s64>)
169596049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[UV]](<vscale x 8 x s64>)
169696049fcfSMichael Maitland  ; RV32-NEXT:   $v16m8 = COPY [[UV1]](<vscale x 8 x s64>)
169796049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8, implicit $v16m8
169896049fcfSMichael Maitland  ;
169996049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i64_0
170096049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
170196049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s64>) = G_IMPLICIT_DEF
170296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
170396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s64>), [[C]](s64)
170496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
170596049fcfSMichael Maitland  ; RV64-NEXT:   [[UV:%[0-9]+]]:_(<vscale x 8 x s64>), [[UV1:%[0-9]+]]:_(<vscale x 8 x s64>) = G_UNMERGE_VALUES [[SPLAT_VECTOR]](<vscale x 16 x s64>)
170696049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[UV]](<vscale x 8 x s64>)
170796049fcfSMichael Maitland  ; RV64-NEXT:   $v16m8 = COPY [[UV1]](<vscale x 8 x s64>)
170896049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8, implicit $v16m8
170996049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i64> poison, <vscale x 16 x i64> poison, <vscale x 16 x i32> poison
171096049fcfSMichael Maitland  ret <vscale x 16 x i64> %a
171196049fcfSMichael Maitland}
171296049fcfSMichael Maitland
171396049fcfSMichael Maitlanddefine <vscale x 16 x i64> @shufflevector_nxv16i64_1() {
171496049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i64_1
171596049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
171696049fcfSMichael Maitland  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s64>) = G_IMPLICIT_DEF
1717ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1718ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s64>), [[C]](s32)
171996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
172096049fcfSMichael Maitland  ; RV32-NEXT:   [[UV:%[0-9]+]]:_(<vscale x 8 x s64>), [[UV1:%[0-9]+]]:_(<vscale x 8 x s64>) = G_UNMERGE_VALUES [[SPLAT_VECTOR]](<vscale x 16 x s64>)
172196049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[UV]](<vscale x 8 x s64>)
172296049fcfSMichael Maitland  ; RV32-NEXT:   $v16m8 = COPY [[UV1]](<vscale x 8 x s64>)
172396049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8, implicit $v16m8
172496049fcfSMichael Maitland  ;
172596049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i64_1
172696049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
172796049fcfSMichael Maitland  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 16 x s64>) = G_IMPLICIT_DEF
172896049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
172996049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 16 x s64>), [[C]](s64)
173096049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
173196049fcfSMichael Maitland  ; RV64-NEXT:   [[UV:%[0-9]+]]:_(<vscale x 8 x s64>), [[UV1:%[0-9]+]]:_(<vscale x 8 x s64>) = G_UNMERGE_VALUES [[SPLAT_VECTOR]](<vscale x 16 x s64>)
173296049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[UV]](<vscale x 8 x s64>)
173396049fcfSMichael Maitland  ; RV64-NEXT:   $v16m8 = COPY [[UV1]](<vscale x 8 x s64>)
173496049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8, implicit $v16m8
173596049fcfSMichael Maitland  %a = shufflevector <vscale x 16 x i64> undef, <vscale x 16 x i64> undef, <vscale x 16 x i32> undef
173696049fcfSMichael Maitland  ret <vscale x 16 x i64> %a
173796049fcfSMichael Maitland}
173896049fcfSMichael Maitland
173996049fcfSMichael Maitlanddefine <vscale x 16 x i64> @shufflevector_nxv16i64_2(<vscale x 16 x i64> %a) {
174096049fcfSMichael Maitland  ; RV32-LABEL: name: shufflevector_nxv16i64_2
174196049fcfSMichael Maitland  ; RV32: bb.1 (%ir-block.0):
174296049fcfSMichael Maitland  ; RV32-NEXT:   liveins: $v8m8, $v16m8
174396049fcfSMichael Maitland  ; RV32-NEXT: {{  $}}
174496049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s64>) = COPY $v8m8
174596049fcfSMichael Maitland  ; RV32-NEXT:   [[COPY1:%[0-9]+]]:_(<vscale x 8 x s64>) = COPY $v16m8
174696049fcfSMichael Maitland  ; RV32-NEXT:   [[CONCAT_VECTORS:%[0-9]+]]:_(<vscale x 16 x s64>) = G_CONCAT_VECTORS [[COPY]](<vscale x 8 x s64>), [[COPY1]](<vscale x 8 x s64>)
1747ac321cbbSDavid Green  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1748ac321cbbSDavid Green  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[CONCAT_VECTORS]](<vscale x 16 x s64>), [[C]](s32)
174996049fcfSMichael Maitland  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
175096049fcfSMichael Maitland  ; RV32-NEXT:   [[UV:%[0-9]+]]:_(<vscale x 8 x s64>), [[UV1:%[0-9]+]]:_(<vscale x 8 x s64>) = G_UNMERGE_VALUES [[SPLAT_VECTOR]](<vscale x 16 x s64>)
175196049fcfSMichael Maitland  ; RV32-NEXT:   $v8m8 = COPY [[UV]](<vscale x 8 x s64>)
175296049fcfSMichael Maitland  ; RV32-NEXT:   $v16m8 = COPY [[UV1]](<vscale x 8 x s64>)
175396049fcfSMichael Maitland  ; RV32-NEXT:   PseudoRET implicit $v8m8, implicit $v16m8
175496049fcfSMichael Maitland  ;
175596049fcfSMichael Maitland  ; RV64-LABEL: name: shufflevector_nxv16i64_2
175696049fcfSMichael Maitland  ; RV64: bb.1 (%ir-block.0):
175796049fcfSMichael Maitland  ; RV64-NEXT:   liveins: $v8m8, $v16m8
175896049fcfSMichael Maitland  ; RV64-NEXT: {{  $}}
175996049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY:%[0-9]+]]:_(<vscale x 8 x s64>) = COPY $v8m8
176096049fcfSMichael Maitland  ; RV64-NEXT:   [[COPY1:%[0-9]+]]:_(<vscale x 8 x s64>) = COPY $v16m8
176196049fcfSMichael Maitland  ; RV64-NEXT:   [[CONCAT_VECTORS:%[0-9]+]]:_(<vscale x 16 x s64>) = G_CONCAT_VECTORS [[COPY]](<vscale x 8 x s64>), [[COPY1]](<vscale x 8 x s64>)
176296049fcfSMichael Maitland  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
176396049fcfSMichael Maitland  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[CONCAT_VECTORS]](<vscale x 16 x s64>), [[C]](s64)
176496049fcfSMichael Maitland  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 16 x s64>) = G_SPLAT_VECTOR [[EVEC]](s64)
176596049fcfSMichael Maitland  ; RV64-NEXT:   [[UV:%[0-9]+]]:_(<vscale x 8 x s64>), [[UV1:%[0-9]+]]:_(<vscale x 8 x s64>) = G_UNMERGE_VALUES [[SPLAT_VECTOR]](<vscale x 16 x s64>)
176696049fcfSMichael Maitland  ; RV64-NEXT:   $v8m8 = COPY [[UV]](<vscale x 8 x s64>)
176796049fcfSMichael Maitland  ; RV64-NEXT:   $v16m8 = COPY [[UV1]](<vscale x 8 x s64>)
176896049fcfSMichael Maitland  ; RV64-NEXT:   PseudoRET implicit $v8m8, implicit $v16m8
176996049fcfSMichael Maitland  %b = shufflevector <vscale x 16 x i64> %a , <vscale x 16 x i64> poison, <vscale x 16 x i32> zeroinitializer
177096049fcfSMichael Maitland  ret <vscale x 16 x i64> %b
177196049fcfSMichael Maitland}
177296049fcfSMichael Maitland
1773*d5c292d8SCraig Topperdefine <vscale x 1 x ptr> @shufflevector_nxv1p0_0() {
1774*d5c292d8SCraig Topper  ; RV32-LABEL: name: shufflevector_nxv1p0_0
1775*d5c292d8SCraig Topper  ; RV32: bb.1 (%ir-block.0):
1776*d5c292d8SCraig Topper  ; RV32-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x p0>) = G_IMPLICIT_DEF
1777*d5c292d8SCraig Topper  ; RV32-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
1778*d5c292d8SCraig Topper  ; RV32-NEXT:   [[EVEC:%[0-9]+]]:_(p0) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x p0>), [[C]](s32)
1779*d5c292d8SCraig Topper  ; RV32-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x p0>) = G_SPLAT_VECTOR [[EVEC]](p0)
1780*d5c292d8SCraig Topper  ; RV32-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x p0>)
1781*d5c292d8SCraig Topper  ; RV32-NEXT:   PseudoRET implicit $v8
1782*d5c292d8SCraig Topper  ;
1783*d5c292d8SCraig Topper  ; RV64-LABEL: name: shufflevector_nxv1p0_0
1784*d5c292d8SCraig Topper  ; RV64: bb.1 (%ir-block.0):
1785*d5c292d8SCraig Topper  ; RV64-NEXT:   [[DEF:%[0-9]+]]:_(<vscale x 1 x p0>) = G_IMPLICIT_DEF
1786*d5c292d8SCraig Topper  ; RV64-NEXT:   [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
1787*d5c292d8SCraig Topper  ; RV64-NEXT:   [[EVEC:%[0-9]+]]:_(p0) = G_EXTRACT_VECTOR_ELT [[DEF]](<vscale x 1 x p0>), [[C]](s64)
1788*d5c292d8SCraig Topper  ; RV64-NEXT:   [[SPLAT_VECTOR:%[0-9]+]]:_(<vscale x 1 x p0>) = G_SPLAT_VECTOR [[EVEC]](p0)
1789*d5c292d8SCraig Topper  ; RV64-NEXT:   $v8 = COPY [[SPLAT_VECTOR]](<vscale x 1 x p0>)
1790*d5c292d8SCraig Topper  ; RV64-NEXT:   PseudoRET implicit $v8
1791*d5c292d8SCraig Topper  %a = shufflevector <vscale x 1 x ptr> poison, <vscale x 1 x ptr> poison, <vscale x 1 x i32> zeroinitializer
1792*d5c292d8SCraig Topper  ret <vscale x 1 x ptr> %a
1793*d5c292d8SCraig Topper}
1794