Skip to content

Commit 2077d40

Browse files
committed
[SLP]Add a test with non-power-of-2 reduction for ctpop, NFC
From #127177
1 parent 5767e4d commit 2077d40

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
3+
4+
define i8 @test() {
5+
; CHECK-LABEL: define i8 @test() {
6+
; CHECK-NEXT: [[ENTRY:.*:]]
7+
; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.ctpop.i8(i8 0)
8+
; CHECK-NEXT: [[TMP1:%.*]] = call i4 @llvm.ctpop.i4(i4 1)
9+
; CHECK-NEXT: [[TMP2:%.*]] = zext i4 [[TMP1]] to i8
10+
; CHECK-NEXT: [[OP_RDX:%.*]] = add i8 [[TMP0]], [[TMP2]]
11+
; CHECK-NEXT: ret i8 [[OP_RDX]]
12+
;
13+
entry:
14+
%inc.1.i.i = zext i1 false to i8
15+
%inc.2.i.i = zext i1 false to i8
16+
%inc.3.i.i = zext i1 false to i8
17+
%inc.6.i.i = zext i1 false to i8
18+
%inc.7.i.i = zext i1 false to i8
19+
%inc.8.i.i = zext i1 false to i8
20+
%inc.10.i.i = zext i1 false to i8
21+
%inc.11.i.i = zext i1 false to i8
22+
%inc.12.i.i = zext i1 true to i8
23+
%inc.13.i.i = zext i1 false to i8
24+
%inc.14.i.i = zext i1 false to i8
25+
%inc.15.i.i = zext i1 false to i8
26+
%inc9.1.i.i = add i8 %inc.2.i.i, %inc.1.i.i
27+
%inc9.2.i.i = add i8 %inc9.1.i.i, %inc.3.i.i
28+
%spec.select17.i.i = add i8 %inc9.2.i.i, %inc.6.i.i
29+
%spec.select18.i.i = add i8 %spec.select17.i.i, %inc.7.i.i
30+
%spec.select19.i.i = add i8 %spec.select18.i.i, %inc.8.i.i
31+
%spec.select21.i.i = add i8 %spec.select19.i.i, %inc.10.i.i
32+
%spec.select22.i.i = add i8 %spec.select21.i.i, %inc.11.i.i
33+
%spec.select23.i.i = add i8 %spec.select22.i.i, %inc.12.i.i
34+
%spec.select24.i.i = add i8 %spec.select23.i.i, %inc.13.i.i
35+
%spec.select25.i.i = add i8 %spec.select24.i.i, %inc.14.i.i
36+
%spec.select26.i.i = add i8 %spec.select25.i.i, %inc.15.i.i
37+
ret i8 %spec.select26.i.i
38+
}

0 commit comments

Comments
 (0)