Skip to content

Commit e59f120

Browse files
committed
[RISCV] Add test for strided load combine regression. NFC
This adds a reduced test case for the regression seen in x264 with #83035. If the intermediate concatenating shuffles are large enough then the splitting combine will prevent the strided load combine which is preferable.
1 parent b9d83ef commit e59f120

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-load-combine.ll

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,3 +566,28 @@ define void @reverse_strided_runtime_4xv2f32(ptr %x, ptr %z, i64 %s) {
566566
store <8 x float> %e.2, ptr %z
567567
ret void
568568
}
569+
570+
; The middle end sometimes produces this pattern of shuffles, where the
571+
; intermediate shuffles are the full result vector size padded with poison
572+
; elements.
573+
define <16 x i8> @widen_4xv4i8_immediate_expand(ptr %p, i64 %s) {
574+
; CHECK-LABEL: widen_4xv4i8_immediate_expand:
575+
; CHECK: # %bb.0:
576+
; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
577+
; CHECK-NEXT: vlse32.v v8, (a0), a1
578+
; CHECK-NEXT: ret
579+
%a = load <4 x i8>, ptr %p
580+
%b.ptr = getelementptr i8, ptr %p, i64 %s
581+
%b = load <4 x i8>, ptr %b.ptr
582+
%c.ptr = getelementptr i8, ptr %b.ptr, i64 %s
583+
%c = load <4 x i8>, ptr %c.ptr
584+
%d.ptr = getelementptr i8, ptr %c.ptr, i64 %s
585+
%d = load <4 x i8>, ptr %d.ptr
586+
587+
%ab = shufflevector <4 x i8> %a, <4 x i8> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
588+
%cx = shufflevector <4 x i8> %c, <4 x i8> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
589+
%dx = shufflevector <4 x i8> %d, <4 x i8> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
590+
%abcx = shufflevector <16 x i8> %ab, <16 x i8> %cx, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 16, i32 17, i32 18, i32 19, i32 poison, i32 poison, i32 poison, i32 poison>
591+
%abcd = shufflevector <16 x i8> %abcx, <16 x i8> %dx, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 16, i32 17, i32 18, i32 19>
592+
ret <16 x i8> %abcd
593+
}

0 commit comments

Comments
 (0)