Skip to content

Commit 0457644

Browse files
committed
[SLP][NFC]Add a test with the incorrect combination of Xor/Mul vector instructions, NFC
1 parent 301259a commit 0457644

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
2+
; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s -slp-threshold=-100 | FileCheck %s
3+
define i1 @foo(i1 %v) { ; assume %v is 1
4+
; CHECK-LABEL: define i1 @foo(
5+
; CHECK-SAME: i1 [[V:%.*]]) {
6+
; CHECK-NEXT: [[ENTRY:.*:]]
7+
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i1> poison, i1 [[V]], i32 0
8+
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x i1> [[TMP0]], <2 x i1> poison, <2 x i32> zeroinitializer
9+
; CHECK-NEXT: [[TMP2:%.*]] = mul <2 x i1> <i1 false, i1 true>, [[TMP1]]
10+
; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x i1> [[TMP2]], i32 0
11+
; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x i1> [[TMP2]], i32 1
12+
; CHECK-NEXT: [[SUB:%.*]] = sub i1 [[TMP3]], [[TMP4]]
13+
; CHECK-NEXT: ret i1 [[SUB]]
14+
;
15+
entry:
16+
%not = xor i1 %v, 1 ; 0
17+
%not1 = xor i1 %not, 1 ; 1
18+
%mul = mul i1 %v, 1 ; 1
19+
%sub = sub i1 %not1, %mul ; 0
20+
ret i1 %sub ; 0
21+
}

0 commit comments

Comments
 (0)