Skip to content

Commit ae54617

Browse files
committed
[SLP][NFC]Add a test with incorrect extractelement parameter after extending with poison
1 parent 380bb51 commit ae54617

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
3+
4+
define i32 @test() {
5+
; CHECK-LABEL: define i32 @test() {
6+
; CHECK-NEXT: [[ENTRY:.*:]]
7+
; CHECK-NEXT: [[TMP0:%.*]] = load <4 x i64>, ptr null, align 16
8+
; CHECK-NEXT: [[TMP1:%.*]] = or i64 poison, 0
9+
; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i64> [[TMP0]], <4 x i64> poison, <8 x i32> <i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 1, i32 poison, i32 poison>
10+
; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <4 x i64> [[TMP0]], <4 x i64> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
11+
; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <8 x i64> [[TMP3]], <8 x i64> <i64 poison, i64 poison, i64 poison, i64 poison, i64 0, i64 poison, i64 poison, i64 poison>, <8 x i32> <i32 poison, i32 poison, i32 poison, i32 poison, i32 12, i32 1, i32 poison, i32 poison>
12+
; CHECK-NEXT: [[TMP5:%.*]] = call <8 x i64> @llvm.vector.insert.v8i64.v4i64(<8 x i64> [[TMP4]], <4 x i64> [[TMP0]], i64 0)
13+
; CHECK-NEXT: [[TMP6:%.*]] = trunc <8 x i64> [[TMP5]] to <8 x i32>
14+
; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <8 x i32> [[TMP6]], <8 x i32> poison, <16 x i32> <i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 3, i32 3, i32 3, i32 4, i32 4, i32 5, i32 5>
15+
; CHECK-NEXT: [[TMP8:%.*]] = add <16 x i32> [[TMP7]], zeroinitializer
16+
; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x i64> [[TMP0]], i32 0
17+
; CHECK-NEXT: [[INC_3_3_I_1:%.*]] = or i64 [[TMP9]], 0
18+
; CHECK-NEXT: [[TMP10:%.*]] = call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> [[TMP8]])
19+
; CHECK-NEXT: [[TMP11:%.*]] = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> poison)
20+
; CHECK-NEXT: [[OP_RDX:%.*]] = or i32 [[TMP10]], [[TMP11]]
21+
; CHECK-NEXT: ret i32 [[OP_RDX]]
22+
;
23+
entry:
24+
%.pre.i = load i64, ptr getelementptr inbounds nuw (i8, ptr null, i64 24), align 8
25+
%.pre50.i = load i64, ptr getelementptr inbounds nuw (i8, ptr null, i64 16), align 16
26+
%.pre51.i = load i64, ptr getelementptr inbounds nuw (i8, ptr null, i64 8), align 8
27+
%.pre52.i = load i64, ptr null, align 16
28+
%0 = or i64 %.pre51.i, 0
29+
%1 = trunc i64 %.pre.i to i32
30+
%2 = add i32 %1, 0
31+
%3 = trunc i64 %.pre50.i to i32
32+
%4 = add i32 %3, 0
33+
%5 = trunc i64 %.pre51.i to i32
34+
%6 = add i32 %5, 0
35+
%7 = trunc i64 0 to i32
36+
%8 = add i32 %5, 0
37+
%9 = add i32 %7, 0
38+
%10 = add i32 %1, 0
39+
%11 = add i32 %3, 0
40+
%12 = add i32 %5, 0
41+
%13 = add i32 %7, 0
42+
%14 = trunc i64 %.pre.i to i32
43+
%15 = add i32 %14, 0
44+
%16 = trunc i64 %.pre50.i to i32
45+
%17 = add i32 %16, 0
46+
%18 = trunc i64 %.pre51.i to i32
47+
%19 = add i32 %18, 0
48+
%20 = trunc i64 %.pre52.i to i32
49+
%conv14.1.i = or i32 %9, %13
50+
%21 = or i32 %conv14.1.i, %6
51+
%22 = or i32 %21, %8
52+
%23 = or i32 %22, %12
53+
%24 = or i32 %23, %4
54+
%25 = or i32 %24, %11
55+
%26 = or i32 %25, %2
56+
%27 = or i32 %26, %10
57+
%28 = or i32 %27, %15
58+
%29 = or i32 %28, %17
59+
%30 = or i32 %29, %19
60+
%31 = add i32 %14, 0
61+
%32 = add i32 %16, 0
62+
%33 = add i32 %18, 0
63+
%34 = add i32 %20, 0
64+
%35 = add i32 %14, 0
65+
%36 = add i32 %16, 0
66+
%37 = add i32 %18, 0
67+
%38 = add i32 %20, 0
68+
%39 = add i32 %14, 0
69+
%40 = add i32 %16, 0
70+
%41 = add i32 %18, 0
71+
%42 = add i32 %20, 0
72+
%inc.3.3.i.1 = or i64 %.pre52.i, 0
73+
%conv14.i.1 = or i32 %38, %34
74+
%conv14.1.i.1 = or i32 %conv14.i.1, %42
75+
%conv14.3.i.1 = or i32 %conv14.1.i.1, %33
76+
%conv14.145.i.1 = or i32 %conv14.3.i.1, %37
77+
%conv14.1.1.i.1 = or i32 %conv14.145.i.1, %41
78+
%conv14.3.1.i.1 = or i32 %conv14.1.1.i.1, %32
79+
%conv14.247.i.1 = or i32 %conv14.3.1.i.1, %36
80+
%conv14.1.2.i.1 = or i32 %conv14.247.i.1, %40
81+
%conv14.3.2.i.1 = or i32 %conv14.1.2.i.1, %31
82+
%conv14.349.i.1 = or i32 %conv14.3.2.i.1, %35
83+
%conv14.1.3.i.1 = or i32 %conv14.349.i.1, %39
84+
%conv14.3.3.i.1 = or i32 %conv14.1.3.i.1, %30
85+
ret i32 %conv14.3.3.i.1
86+
}

0 commit comments

Comments
 (0)