Skip to content

Commit bef6687

Browse files
committed
[SLP][NFC]Add a test with the incorrect comparison after minbiwidth analysis.
1 parent fd59319 commit bef6687

File tree

1 file changed

+41
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)