Skip to content

Commit 628283a

Browse files
committed
[InstCombine] Pre-commit tests (NFC)
1 parent 5445a35 commit 628283a

File tree

1 file changed

+17
-2
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+17
-2
lines changed

llvm/test/Transforms/InstCombine/add.ll

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,14 +1440,12 @@ define i32 @and31_add_sexts(i1 %x, i1 %y) {
14401440
define i32 @lshr_add_use_sexts(i1 %x, i1 %y, ptr %p) {
14411441
; CHECK-LABEL: @lshr_add_use_sexts(
14421442
; CHECK-NEXT: [[XS:%.*]] = sext i1 [[X:%.*]] to i32
1443-
; CHECK-NEXT: store i32 [[XS]], ptr [[P:%.*]], align 4
14441443
; CHECK-NEXT: [[YS:%.*]] = sext i1 [[Y:%.*]] to i32
14451444
; CHECK-NEXT: [[SUB:%.*]] = add nsw i32 [[XS]], [[YS]]
14461445
; CHECK-NEXT: [[R:%.*]] = lshr i32 [[SUB]], 31
14471446
; CHECK-NEXT: ret i32 [[R]]
14481447
;
14491448
%xs = sext i1 %x to i32
1450-
store i32 %xs, ptr %p
14511449
%ys = sext i1 %y to i32
14521450
%sub = add i32 %xs, %ys
14531451
%r = lshr i32 %sub, 31
@@ -1456,6 +1454,23 @@ define i32 @lshr_add_use_sexts(i1 %x, i1 %y, ptr %p) {
14561454

14571455
; Negative test - extra use
14581456

1457+
define i32 @lshr_add_use_sexts(i1 %x, i1 %y, ptr %p) {
1458+
; CHECK-LABEL: @lshr_add_use_sexts(
1459+
; CHECK-NEXT: [[XS:%.*]] = sext i1 [[X:%.*]] to i32
1460+
; CHECK-NEXT: store i32 [[XS]], ptr [[P:%.*]], align 4
1461+
; CHECK-NEXT: [[YS:%.*]] = sext i1 [[Y:%.*]] to i32
1462+
; CHECK-NEXT: [[SUB:%.*]] = add nsw i32 [[XS]], [[YS]]
1463+
; CHECK-NEXT: [[R:%.*]] = lshr i32 [[SUB]], 31
1464+
; CHECK-NEXT: ret i32 [[R]]
1465+
;
1466+
%xs = sext i1 %x to i32
1467+
store i32 %xs, ptr %p
1468+
%ys = sext i1 %y to i32
1469+
%sub = add i32 %xs, %ys
1470+
%r = lshr i32 %sub, 31
1471+
ret i32 %r
1472+
}
1473+
14591474
define i32 @lshr_add_use2_sexts(i1 %x, i1 %y, ptr %p) {
14601475
; CHECK-LABEL: @lshr_add_use2_sexts(
14611476
; CHECK-NEXT: [[XS:%.*]] = sext i1 [[X:%.*]] to i32

0 commit comments

Comments
 (0)