Skip to content

Commit 552c8eb

Browse files
committed
[SLP][NFC]Add a test with the wrong result extension after reduction,
NFC.
1 parent b9cd48f commit 552c8eb

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2+
; RUN: opt -S -mtriple=riscv64-unknown-linux-gnu -mattr="+v" --passes=slp-vectorizer < %s | FileCheck %s
3+
4+
define i32 @test(ptr %0, ptr %1) {
5+
; CHECK-LABEL: define i32 @test(
6+
; CHECK-SAME: ptr [[TMP0:%.*]], ptr [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] {
7+
; CHECK-NEXT: entry:
8+
; CHECK-NEXT: [[LOAD_5:%.*]] = load i32, ptr [[TMP1]], align 4
9+
; CHECK-NEXT: [[TMP2:%.*]] = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> <i1 true, i1 true, i1 true, i1 true>)
10+
; CHECK-NEXT: [[TMP3:%.*]] = sext i1 [[TMP2]] to i32
11+
; CHECK-NEXT: [[OP_RDX:%.*]] = and i32 [[TMP3]], [[LOAD_5]]
12+
; CHECK-NEXT: ret i32 [[OP_RDX]]
13+
;
14+
entry:
15+
%zext.0 = zext i8 1 to i32
16+
%zext.1 = zext i8 1 to i32
17+
%zext.2 = zext i8 1 to i32
18+
%zext.3 = zext i8 1 to i32
19+
%select.zext.0 = select i1 false, i32 -1, i32 %zext.0
20+
%select.zext.1 = select i1 false, i32 0, i32 %zext.1
21+
%select.zext.2 = select i1 false, i32 0, i32 %zext.2
22+
%select.zext.3 = select i1 false, i32 0, i32 %zext.3
23+
24+
%load.5 = load i32, ptr %1, align 4
25+
26+
%and.0 = and i32 %load.5, %select.zext.0
27+
%and.1 = and i32 %and.0, %select.zext.1
28+
%and.2 = and i32 %and.1, %select.zext.2
29+
%and.3 = and i32 %and.2, %select.zext.3
30+
31+
ret i32 %and.3
32+
}
33+

0 commit comments

Comments
 (0)