Skip to content

Commit f947d5a

Browse files
committed
[RISCV] Reduce redundancy in vnsrl tests
Triggered by discussion on pr118509.
1 parent c1afcaf commit f947d5a

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shufflevector-vnsrl.ll

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,6 @@ define void @vnsrl_0_i8_single_src(ptr %in, ptr %out) {
447447
; V-NEXT: vle8.v v8, (a0)
448448
; V-NEXT: vsetivli zero, 4, e8, mf8, ta, ma
449449
; V-NEXT: vnsrl.wi v8, v8, 0
450-
; V-NEXT: vsetivli zero, 8, e8, mf4, ta, ma
451450
; V-NEXT: vse8.v v8, (a1)
452451
; V-NEXT: ret
453452
;
@@ -457,18 +456,42 @@ define void @vnsrl_0_i8_single_src(ptr %in, ptr %out) {
457456
; ZVE32F-NEXT: vle8.v v8, (a0)
458457
; ZVE32F-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
459458
; ZVE32F-NEXT: vnsrl.wi v8, v8, 0
459+
; ZVE32F-NEXT: vse8.v v8, (a1)
460+
; ZVE32F-NEXT: ret
461+
entry:
462+
%0 = load <8 x i8>, ptr %in, align 1
463+
%shuffle.i5 = shufflevector <8 x i8> %0, <8 x i8> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
464+
store <4 x i8> %shuffle.i5, ptr %out, align 1
465+
ret void
466+
}
467+
468+
define void @vnsrl_8_i8_single_src(ptr %in, ptr %out) {
469+
; V-LABEL: vnsrl_8_i8_single_src:
470+
; V: # %bb.0: # %entry
471+
; V-NEXT: vsetivli zero, 8, e8, mf4, ta, ma
472+
; V-NEXT: vle8.v v8, (a0)
473+
; V-NEXT: vsetivli zero, 4, e8, mf8, ta, ma
474+
; V-NEXT: vnsrl.wi v8, v8, 8
475+
; V-NEXT: vse8.v v8, (a1)
476+
; V-NEXT: ret
477+
;
478+
; ZVE32F-LABEL: vnsrl_8_i8_single_src:
479+
; ZVE32F: # %bb.0: # %entry
460480
; ZVE32F-NEXT: vsetivli zero, 8, e8, mf4, ta, ma
481+
; ZVE32F-NEXT: vle8.v v8, (a0)
482+
; ZVE32F-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
483+
; ZVE32F-NEXT: vnsrl.wi v8, v8, 8
461484
; ZVE32F-NEXT: vse8.v v8, (a1)
462485
; ZVE32F-NEXT: ret
463486
entry:
464487
%0 = load <8 x i8>, ptr %in, align 1
465-
%shuffle.i5 = shufflevector <8 x i8> %0, <8 x i8> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
466-
store <8 x i8> %shuffle.i5, ptr %out, align 1
488+
%shuffle.i5 = shufflevector <8 x i8> %0, <8 x i8> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
489+
store <4 x i8> %shuffle.i5, ptr %out, align 1
467490
ret void
468491
}
469492

470-
define void @vnsrl_0_i8_single_src2(ptr %in, ptr %out) {
471-
; V-LABEL: vnsrl_0_i8_single_src2:
493+
define void @vnsrl_0_i8_single_wideuse(ptr %in, ptr %out) {
494+
; V-LABEL: vnsrl_0_i8_single_wideuse:
472495
; V: # %bb.0: # %entry
473496
; V-NEXT: vsetivli zero, 8, e8, mf4, ta, ma
474497
; V-NEXT: vle8.v v8, (a0)
@@ -478,7 +501,7 @@ define void @vnsrl_0_i8_single_src2(ptr %in, ptr %out) {
478501
; V-NEXT: vse8.v v8, (a1)
479502
; V-NEXT: ret
480503
;
481-
; ZVE32F-LABEL: vnsrl_0_i8_single_src2:
504+
; ZVE32F-LABEL: vnsrl_0_i8_single_wideuse:
482505
; ZVE32F: # %bb.0: # %entry
483506
; ZVE32F-NEXT: vsetivli zero, 8, e8, mf4, ta, ma
484507
; ZVE32F-NEXT: vle8.v v8, (a0)

0 commit comments

Comments
 (0)