Skip to content

Commit

Permalink
[InstCombine] Add more tests. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcxzyw committed Sep 18, 2024
1 parent 74f0229 commit ebf3de7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions llvm/test/Transforms/InstCombine/icmp-shl-nuw.ll
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ define i1 @fold_icmp_shl_nuw_c2_div_non_pow2(i32 %x) {
ret i1 %cmp
}

define i1 @fold_icmp_shl_nuw_c3(i32 %x) {
; CHECK-LABEL: @fold_icmp_shl_nuw_c3(
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 [[X:%.*]], 1
; CHECK-NEXT: ret i1 [[CMP]]
;
%shl = shl nuw i32 48, %x
%cmp = icmp uge i32 %shl, 144
ret i1 %cmp
}

; Negative tests

define i1 @fold_icmp_shl_nuw_c2_indivisible(i32 %x) {
Expand Down

0 comments on commit ebf3de7

Please sign in to comment.