Skip to content

Commit 98e2328

Browse files
committed
[SLP][NFC]Add a test with non-power-of-2 gathered consecutive loads, NFC
1 parent 1379740 commit 98e2328

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt -S -mtriple=x86_64-unknown-linux --passes=slp-vectorizer < %s | FileCheck %s
3+
4+
define <6 x double> @test(ptr %a) {
5+
; CHECK-LABEL: define <6 x double> @test(
6+
; CHECK-SAME: ptr [[A:%.*]]) {
7+
; CHECK-NEXT: [[ENTRY:.*:]]
8+
; CHECK-NEXT: [[TMP0:%.*]] = load <4 x double>, ptr [[A]], align 8
9+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr double, ptr [[A]], i16 4
10+
; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, ptr [[TMP1]], align 8
11+
; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <4 x double> [[TMP0]], <4 x double> poison, <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison>
12+
; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x double> [[TMP2]], <2 x double> poison, <6 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison>
13+
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <6 x double> [[TMP3]], <6 x double> [[TMP4]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 6, i32 7>
14+
; CHECK-NEXT: ret <6 x double> [[TMP5]]
15+
;
16+
entry:
17+
%1 = load double, ptr %a, align 8
18+
%2 = getelementptr double, ptr %a, i16 1
19+
%3 = load double, ptr %2, align 8
20+
%4 = getelementptr double, ptr %a, i16 2
21+
%5 = load double, ptr %4, align 8
22+
%6 = getelementptr double, ptr %a, i16 3
23+
%7 = load double, ptr %6, align 8
24+
%8 = getelementptr double, ptr %a, i16 4
25+
%9 = load double, ptr %8, align 8
26+
%10 = getelementptr double, ptr %a, i16 5
27+
%11 = load double, ptr %10, align 8
28+
%12 = insertelement <6 x double> poison, double %1, i32 0
29+
%13 = insertelement <6 x double> %12, double %3, i32 1
30+
%14 = insertelement <6 x double> %13, double %5, i32 2
31+
%15 = insertelement <6 x double> %14, double %7, i32 3
32+
%16 = insertelement <6 x double> %15, double %9, i32 4
33+
%17 = insertelement <6 x double> %16, double %11, i32 5
34+
ret <6 x double> %17
35+
}

0 commit comments

Comments
 (0)