Skip to content

Commit a9958c4

Browse files
committed
[InstCombine] Add pre-commit tests. NFC.
1 parent dbece8e commit a9958c4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/test/Transforms/InstCombine/saturating-add-sub.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,19 @@ define <2 x i32> @uadd_sat_not_ugt_commute_add(<2 x i32> %x, <2 x i32> %yp) {
18901890
ret <2 x i32> %r
18911891
}
18921892

1893+
define <2 x i32> @uadd_sat_not_ugt_commute_add_partial_poison(<2 x i32> %x, <2 x i32> %yp) {
1894+
; CHECK-LABEL: @uadd_sat_not_ugt_commute_add_partial_poison(
1895+
; CHECK-NEXT: [[NOTX:%.*]] = xor <2 x i32> [[X:%.*]], <i32 -1, i32 poison>
1896+
; CHECK-NEXT: [[R:%.*]] = call <2 x i32> @llvm.uadd.sat.v2i32(<2 x i32> [[YP:%.*]], <2 x i32> [[NOTX]])
1897+
; CHECK-NEXT: ret <2 x i32> [[R]]
1898+
;
1899+
%notx = xor <2 x i32> %x, <i32 -1, i32 poison>
1900+
%a = add nuw <2 x i32> %yp, %notx
1901+
%c = icmp ugt <2 x i32> %yp, %x
1902+
%r = select <2 x i1> %c, <2 x i32> <i32 -1, i32 -1>, <2 x i32> %a
1903+
ret <2 x i32> %r
1904+
}
1905+
18931906
define i32 @uadd_sat_not_commute_select(i32 %x, i32 %y) {
18941907
; CHECK-LABEL: @uadd_sat_not_commute_select(
18951908
; CHECK-NEXT: [[NOTX:%.*]] = xor i32 [[X:%.*]], -1

0 commit comments

Comments
 (0)