Skip to content

Commit fd53128

Browse files
committed
[InstCombine] Add pre-commit tests [NFC]
1 parent 25063be commit fd53128

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

llvm/test/Transforms/InstCombine/shift-logic.ll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,21 @@ define i8 @shl_sub(i8 %x, i8 %y) {
430430
ret i8 %sh1
431431
}
432432

433+
define i8 @shl_sub_multiuse(i8 %x) {
434+
; CHECK-LABEL: @shl_sub_multiuse(
435+
; CHECK-NEXT: [[SH0:%.*]] = shl i8 [[X:%.*]], 3
436+
; CHECK-NEXT: [[R:%.*]] = sub i8 [[SH0]], 42
437+
; CHECK-NEXT: call void @use(i8 [[SH0]])
438+
; CHECK-NEXT: [[SH1:%.*]] = shl i8 [[R]], 2
439+
; CHECK-NEXT: ret i8 [[SH1]]
440+
;
441+
%sh0 = shl i8 %x, 3
442+
%r = sub i8 %sh0, 42
443+
call void @use(i8 %sh0)
444+
%sh1 = shl i8 %r, 2
445+
ret i8 %sh1
446+
}
447+
433448
; Make sure we don't commute operands for sub
434449
define i8 @shl_sub_no_commute(i8 %x, i8 %y) {
435450
; CHECK-LABEL: @shl_sub_no_commute(

0 commit comments

Comments
 (0)