Skip to content

Commit ff153bd

Browse files
committed
[InstCombine] Add test for #89669 (NFC)
1 parent e7efd37 commit ff153bd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/test/Transforms/InstCombine/sub-of-negatible.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,19 @@ define i8 @dont_negate_ordinary_select(i8 %x, i8 %y, i8 %z, i1 %c) {
13851385
ret i8 %t1
13861386
}
13871387

1388+
; FIXME: This is a miscompile.
1389+
define <2 x i32> @negate_select_of_negation_poison(<2 x i1> %c, <2 x i32> %x) {
1390+
; CHECK-LABEL: @negate_select_of_negation_poison(
1391+
; CHECK-NEXT: [[NEG:%.*]] = sub <2 x i32> <i32 0, i32 poison>, [[X:%.*]]
1392+
; CHECK-NEXT: [[TMP1:%.*]] = select <2 x i1> [[C:%.*]], <2 x i32> [[X]], <2 x i32> [[NEG]]
1393+
; CHECK-NEXT: ret <2 x i32> [[TMP1]]
1394+
;
1395+
%neg = sub <2 x i32> <i32 0, i32 poison>, %x
1396+
%sel = select <2 x i1> %c, <2 x i32> %neg, <2 x i32> %x
1397+
%neg2 = sub <2 x i32> zeroinitializer, %sel
1398+
ret <2 x i32> %neg2
1399+
}
1400+
13881401
; Freeze is transparent as far as negation is concerned
13891402
define i4 @negate_freeze(i4 %x, i4 %y, i4 %z) {
13901403
; CHECK-LABEL: @negate_freeze(

0 commit comments

Comments
 (0)