Skip to content

Commit

Permalink
[InstCombine] add test for sdiv with shl; NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
rotateright committed Oct 8, 2022
1 parent 68d4dbc commit ebda066
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions llvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll
Expand Up @@ -91,3 +91,14 @@ define i8 @shl1_nuw(i8 %x, i8 %y) {
%div = sdiv exact i8 %x, %shl
ret i8 %div
}

define i8 @shl1_nsw_not_exact(i8 %x, i8 %y) {
; CHECK-LABEL: @shl1_nsw_not_exact(
; CHECK-NEXT: [[SHL:%.*]] = shl nuw nsw i8 1, [[Y:%.*]]
; CHECK-NEXT: [[DIV:%.*]] = sdiv i8 [[X:%.*]], [[SHL]]
; CHECK-NEXT: ret i8 [[DIV]]
;
%shl = shl nsw i8 1, %y
%div = sdiv i8 %x, %shl
ret i8 %div
}

0 comments on commit ebda066

Please sign in to comment.