Skip to content

Commit

Permalink
[CVP] Add pre-commit tests. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcxzyw committed Feb 1, 2025
1 parent 7612dcc commit fc520e8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions llvm/test/Transforms/CorrelatedValuePropagation/min-max.ll
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,28 @@ define i8 @test_umax_nneg(i8 %a, i8 %b) {
%ret = call i8 @llvm.umax.i8(i8 %nneg_a, i8 %nneg_b)
ret i8 %ret
}

define i64 @test_at_use2(i32 %x) {
; CHECK-LABEL: @test_at_use2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[COND:%.*]] = icmp slt i32 [[X:%.*]], 0
; CHECK-NEXT: [[SMAX:%.*]] = call i32 @llvm.smax.i32(i32 [[X]], i32 -1)
; CHECK-NEXT: br i1 [[COND]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[EXT:%.*]] = zext nneg i32 [[SMAX]] to i64
; CHECK-NEXT: ret i64 [[EXT]]
; CHECK: if.end:
; CHECK-NEXT: ret i64 0
;
entry:
%cond = icmp slt i32 %x, 0
%smax = call i32 @llvm.smax.i32(i32 %x, i32 -1)
br i1 %cond, label %if.end, label %if.then

if.then:
%ext = zext nneg i32 %smax to i64
ret i64 %ext

if.end:
ret i64 0
}

0 comments on commit fc520e8

Please sign in to comment.