Skip to content

Commit 86b9a4f

Browse files
committed
[SLP][NFC]Add a test with the skipped gather node, which is same, as vectorized node.
1 parent 5f9ae61 commit 86b9a4f

File tree

1 file changed

+144
-0
lines changed

1 file changed

+144
-0
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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 -mcpu=x86-64-v4 < %s | FileCheck %s
3+
4+
%struct.rect = type { float, float, float, float }
5+
6+
define void @foo(ptr %i7, i32 %0, i1 %tobool62.not) {
7+
; CHECK-LABEL: define void @foo(
8+
; CHECK-SAME: ptr [[I7:%.*]], i32 [[TMP0:%.*]], i1 [[TOBOOL62_NOT:%.*]]) #[[ATTR0:[0-9]+]] {
9+
; CHECK-NEXT: entry:
10+
; CHECK-NEXT: [[RC21:%.*]] = alloca [0 x [0 x %struct.rect]], i32 0, align 4
11+
; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[RC21]], align 4
12+
; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i32> poison, i32 [[TMP0]], i32 0
13+
; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> poison, <2 x i32> zeroinitializer
14+
; CHECK-NEXT: [[TMP4:%.*]] = sitofp <2 x i32> [[TMP3]] to <2 x float>
15+
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x float> [[TMP4]], <2 x float> poison, <4 x i32> <i32 1, i32 0, i32 1, i32 0>
16+
; CHECK-NEXT: [[X1:%.*]] = getelementptr i8, ptr [[RC21]], i64 4
17+
; CHECK-NEXT: [[TMP6:%.*]] = load <2 x float>, ptr [[X1]], align 4
18+
; CHECK-NEXT: [[TMP7:%.*]] = load float, ptr [[I7]], align 4
19+
; CHECK-NEXT: [[TMP8:%.*]] = insertelement <4 x float> poison, float [[TMP1]], i32 0
20+
; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <2 x float> [[TMP6]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
21+
; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <4 x float> [[TMP8]], <4 x float> [[TMP9]], <4 x i32> <i32 0, i32 4, i32 5, i32 poison>
22+
; CHECK-NEXT: [[TMP11:%.*]] = insertelement <4 x float> [[TMP10]], float [[TMP7]], i32 3
23+
; CHECK-NEXT: [[TMP12:%.*]] = fcmp olt <4 x float> [[TMP11]], zeroinitializer
24+
; CHECK-NEXT: [[TMP13:%.*]] = load <4 x float>, ptr poison, align 16
25+
; CHECK-NEXT: [[TMP14:%.*]] = fcmp olt <4 x float> [[TMP13]], zeroinitializer
26+
; CHECK-NEXT: [[TMP15:%.*]] = select <4 x i1> [[TMP14]], <4 x float> [[TMP5]], <4 x float> zeroinitializer
27+
; CHECK-NEXT: [[TMP16:%.*]] = select <4 x i1> [[TMP12]], <4 x float> zeroinitializer, <4 x float> [[TMP15]]
28+
; CHECK-NEXT: store <4 x float> [[TMP16]], ptr [[RC21]], align 4
29+
; CHECK-NEXT: br label [[IF_END:%.*]]
30+
; CHECK: entry.if.end72_crit_edge:
31+
; CHECK-NEXT: br label [[IF_END72:%.*]]
32+
; CHECK: if.then63:
33+
; CHECK-NEXT: br label [[IF_END]]
34+
; CHECK: if.end:
35+
; CHECK-NEXT: [[TMP17:%.*]] = phi <4 x float> [ poison, [[IF_THEN63:%.*]] ], [ [[TMP16]], [[ENTRY:%.*]] ]
36+
; CHECK-NEXT: [[TMP18:%.*]] = call <4 x float> @llvm.round.v4f32(<4 x float> [[TMP17]])
37+
; CHECK-NEXT: [[TMP19:%.*]] = fptosi <4 x float> [[TMP18]] to <4 x i32>
38+
; CHECK-NEXT: br label [[IF_END72]]
39+
; CHECK: if.end72:
40+
; CHECK-NEXT: [[TMP20:%.*]] = phi <4 x i32> [ poison, [[ENTRY_IF_END72_CRIT_EDGE:%.*]] ], [ [[TMP19]], [[IF_END]] ]
41+
; CHECK-NEXT: [[TMP21:%.*]] = shufflevector <4 x i32> [[TMP20]], <4 x i32> poison, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
42+
; CHECK-NEXT: br i1 [[TOBOOL62_NOT]], label [[IF_END75:%.*]], label [[IF_THEN74:%.*]]
43+
; CHECK: if.then74:
44+
; CHECK-NEXT: br label [[IF_END75]]
45+
; CHECK: if.end75:
46+
; CHECK-NEXT: [[TMP22:%.*]] = phi <4 x i32> [ [[TMP20]], [[IF_THEN74]] ], [ [[TMP21]], [[IF_END72]] ]
47+
; CHECK-NEXT: [[TMP23:%.*]] = or <4 x i32> [[TMP22]], <i32 1, i32 1, i32 1, i32 1>
48+
; CHECK-NEXT: [[TMP24:%.*]] = shufflevector <2 x i32> [[TMP3]], <2 x i32> poison, <4 x i32> zeroinitializer
49+
; CHECK-NEXT: [[TMP25:%.*]] = mul <4 x i32> [[TMP23]], [[TMP24]]
50+
; CHECK-NEXT: [[TMP26:%.*]] = sitofp <4 x i32> [[TMP25]] to <4 x float>
51+
; CHECK-NEXT: [[TMP27:%.*]] = shufflevector <4 x float> [[TMP26]], <4 x float> poison, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
52+
; CHECK-NEXT: store <4 x float> [[TMP27]], ptr [[RC21]], align 4
53+
; CHECK-NEXT: ret void
54+
;
55+
entry:
56+
%rc21 = alloca [0 x [0 x %struct.rect]], i32 0, align 4
57+
%1 = load float, ptr %rc21, align 4
58+
%cmp = fcmp olt float %1, 0.000000e+00
59+
%conv = sitofp i32 %0 to float
60+
%cmp2 = fcmp olt float %conv, 0.000000e+00
61+
%cond = select i1 %cmp2, float %conv, float 0.000000e+00
62+
%cond9 = select i1 %cmp, float 0.000000e+00, float %cond
63+
store float %cond9, ptr %rc21, align 4
64+
%x1 = getelementptr i8, ptr %rc21, i64 4
65+
%2 = load float, ptr %x1, align 4
66+
%cmp11 = fcmp olt float %2, 0.000000e+00
67+
%conv16 = sitofp i32 %0 to float
68+
%cmp17 = fcmp olt float %conv16, 0.000000e+00
69+
%cond24 = select i1 %cmp17, float %conv16, float 0.000000e+00
70+
%cond26 = select i1 %cmp11, float 0.000000e+00, float %cond24
71+
store float %cond26, ptr %x1, align 4
72+
%y0 = getelementptr i8, ptr %rc21, i64 8
73+
%3 = load float, ptr %y0, align 4
74+
%cmp28 = fcmp olt float %3, 0.000000e+00
75+
%cmp34 = fcmp olt float %conv, 0.000000e+00
76+
%cond41 = select i1 %cmp34, float %conv, float 0.000000e+00
77+
%cond43 = select i1 %cmp28, float 0.000000e+00, float %cond41
78+
store float %cond43, ptr %y0, align 4
79+
%y11 = getelementptr i8, ptr %rc21, i64 12
80+
%4 = load float, ptr %i7, align 4
81+
%cmp45 = fcmp olt float %4, 0.000000e+00
82+
%cmp51 = fcmp olt float %conv16, 0.000000e+00
83+
%cond58 = select i1 %cmp51, float %conv16, float 0.000000e+00
84+
%cond60 = select i1 %cmp45, float 0.000000e+00, float %cond58
85+
store float %cond60, ptr %y11, align 4
86+
br label %if.end
87+
88+
entry.if.end72_crit_edge:
89+
br label %if.end72
90+
91+
if.then63:
92+
br label %if.end
93+
94+
if.end:
95+
%5 = phi float [ 0.000000e+00, %if.then63 ], [ %cond60, %entry ]
96+
%6 = phi float [ 0.000000e+00, %if.then63 ], [ %cond26, %entry ]
97+
%7 = phi float [ 0.000000e+00, %if.then63 ], [ %cond43, %entry ]
98+
%8 = phi float [ 0.000000e+00, %if.then63 ], [ %cond9, %entry ]
99+
%9 = call float @llvm.round.f32(float %8)
100+
%conv65 = fptosi float %9 to i32
101+
%10 = call float @llvm.round.f32(float %7)
102+
%conv67 = fptosi float %10 to i32
103+
%11 = call float @llvm.round.f32(float %6)
104+
%conv69 = fptosi float %11 to i32
105+
%12 = call float @llvm.round.f32(float %5)
106+
%conv71 = fptosi float %12 to i32
107+
br label %if.end72
108+
109+
if.end72:
110+
%.pre100 = phi i32 [ 0, %entry.if.end72_crit_edge ], [ %conv71, %if.end ]
111+
%.pre99 = phi i32 [ 0, %entry.if.end72_crit_edge ], [ %conv67, %if.end ]
112+
%.pre98 = phi i32 [ 0, %entry.if.end72_crit_edge ], [ %conv69, %if.end ]
113+
%.pre97 = phi i32 [ 0, %entry.if.end72_crit_edge ], [ %conv65, %if.end ]
114+
br i1 %tobool62.not, label %if.end75, label %if.then74
115+
116+
if.then74:
117+
br label %if.end75
118+
119+
if.end75:
120+
%13 = phi i32 [ %.pre99, %if.then74 ], [ %.pre100, %if.end72 ]
121+
%14 = phi i32 [ %.pre100, %if.then74 ], [ %.pre99, %if.end72 ]
122+
%15 = phi i32 [ %.pre97, %if.then74 ], [ %.pre98, %if.end72 ]
123+
%16 = phi i32 [ %.pre98, %if.then74 ], [ %.pre97, %if.end72 ]
124+
%sub = or i32 %16, 1
125+
%mul = mul i32 %sub, %0
126+
%conv77 = sitofp i32 %mul to float
127+
store float %conv77, ptr %rc21, align 4
128+
%x178 = getelementptr i8, ptr %rc21, i64 4
129+
%sub79 = or i32 %15, 1
130+
%mul80 = mul i32 %sub79, %0
131+
%conv81 = sitofp i32 %mul80 to float
132+
store float %conv81, ptr %x178, align 4
133+
%y082 = getelementptr i8, ptr %rc21, i64 8
134+
%sub83 = or i32 %14, 1
135+
%mul84 = mul i32 %sub83, %0
136+
%conv85 = sitofp i32 %mul84 to float
137+
store float %conv85, ptr %y082, align 4
138+
%y186 = getelementptr i8, ptr %rc21, i64 12
139+
%sub87 = or i32 %13, 1
140+
%mul88 = mul i32 %sub87, %0
141+
%conv89 = sitofp i32 %mul88 to float
142+
store float %conv89, ptr %y186, align 4
143+
ret void
144+
}

0 commit comments

Comments
 (0)