Skip to content

Commit c07d334

Browse files
committed
[SLP][NFC]Add a test for PR79743 with incorrect node demotion, NFC.
1 parent 649ecf8 commit c07d334

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
3+
4+
define void @test() {
5+
; CHECK-LABEL: define void @test() {
6+
; CHECK-NEXT: entry:
7+
; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr null, align 2
8+
; CHECK-NEXT: [[TMP1:%.*]] = and i8 0, 1
9+
; CHECK-NEXT: [[TMP2:%.*]] = and i32 0, 0
10+
; CHECK-NEXT: [[TMP3:%.*]] = select i1 false, i32 0, i32 0
11+
; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i8> <i8 poison, i8 0, i8 poison, i8 poison>, i8 [[TMP1]], i32 0
12+
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i8> [[TMP4]], <4 x i8> poison, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
13+
; CHECK-NEXT: [[TMP6:%.*]] = trunc <4 x i8> [[TMP5]] to <4 x i1>
14+
; CHECK-NEXT: [[TMP7:%.*]] = zext <4 x i1> [[TMP6]] to <4 x i32>
15+
; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <4 x i8> [[TMP4]], <4 x i8> poison, <4 x i32> zeroinitializer
16+
; CHECK-NEXT: [[TMP9:%.*]] = or <4 x i8> [[TMP8]], zeroinitializer
17+
; CHECK-NEXT: [[TMP10:%.*]] = sext <4 x i8> [[TMP9]] to <4 x i32>
18+
; CHECK-NEXT: [[TMP11:%.*]] = zext <4 x i1> [[TMP6]] to <4 x i32>
19+
; CHECK-NEXT: [[TMP12:%.*]] = or <4 x i32> zeroinitializer, [[TMP11]]
20+
; CHECK-NEXT: [[TMP13:%.*]] = icmp eq <4 x i32> [[TMP10]], [[TMP12]]
21+
; CHECK-NEXT: [[TMP14:%.*]] = shufflevector <4 x i32> <i32 0, i32 0, i32 poison, i32 0>, <4 x i32> [[TMP7]], <4 x i32> <i32 0, i32 1, i32 6, i32 3>
22+
; CHECK-NEXT: [[TMP15:%.*]] = select <4 x i1> [[TMP13]], <4 x i32> [[TMP14]], <4 x i32> zeroinitializer
23+
; CHECK-NEXT: [[TMP16:%.*]] = trunc <4 x i32> [[TMP15]] to <4 x i1>
24+
; CHECK-NEXT: [[TMP17:%.*]] = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> [[TMP16]])
25+
; CHECK-NEXT: [[TMP18:%.*]] = zext i1 [[TMP17]] to i32
26+
; CHECK-NEXT: [[OP_RDX:%.*]] = and i32 0, [[TMP18]]
27+
; CHECK-NEXT: store i32 [[OP_RDX]], ptr null, align 4
28+
; CHECK-NEXT: ret void
29+
;
30+
entry:
31+
%0 = load i16, ptr null, align 2
32+
%1 = and i8 0, 1
33+
%2 = and i32 0, 0
34+
%3 = select i1 false, i32 0, i32 0
35+
%i2 = sext i8 %1 to i32
36+
%i3 = or i8 %1, 0
37+
%i4 = sext i8 %i3 to i32
38+
%i5 = or i32 0, %i2
39+
%b1 = icmp eq i32 %i4, %i5
40+
%a1 = select i1 %b1, i32 0, i32 0
41+
%4 = and i32 %a1, 0
42+
%s1 = and i32 %4, 0
43+
%i8 = sext i8 %1 to i32
44+
%i9 = or i8 %1, 0
45+
%i10 = sext i8 %i9 to i32
46+
%i11 = or i32 0, %i8
47+
%b2 = icmp eq i32 %i10, %i11
48+
%a2 = select i1 %b2, i32 0, i32 0
49+
%5 = and i32 %a2, 0
50+
%s2 = and i32 %5, %s1
51+
%i14 = sext i8 %1 to i32
52+
%i15 = or i8 %1, 0
53+
%i16 = sext i8 %i15 to i32
54+
%i17 = or i32 0, %i14
55+
%b3 = icmp eq i32 %i16, %i17
56+
%a3 = select i1 %b3, i32 %i14, i32 0
57+
%6 = and i32 %a3, 0
58+
%s3 = and i32 %6, %s2
59+
%i20 = sext i8 0 to i32
60+
%i21 = or i8 %1, 0
61+
%i22 = sext i8 %i21 to i32
62+
%i23 = or i32 0, %i20
63+
%b4 = icmp eq i32 %i22, %i23
64+
%a4 = select i1 %b4, i32 0, i32 0
65+
%7 = and i32 %a4, 0
66+
%s4 = and i32 %7, %s3
67+
store i32 %s4, ptr null, align 4
68+
ret void
69+
}

0 commit comments

Comments
 (0)