Skip to content

Commit

Permalink
[ConstraintElimination] Add test for regression after 3771310.
Browse files Browse the repository at this point in the history
  • Loading branch information
fhahn committed Oct 7, 2022
1 parent 19ad1cd commit d227029
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -142,3 +142,18 @@ define i1 @sgt_0_unsigned_a_ugt_neg_10(i8 %a) {
%cmp = icmp sgt i16 %ext, 0
ret i1 %cmp
}

define i1 @sge_neg_1_sge_0_known(i8 %a) {
; CHECK-LABEL: @sge_neg_1_sge_0_known(
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A:%.*]] to i16
; CHECK-NEXT: [[A_NE_0:%.*]] = icmp sge i16 [[EXT]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[A_NE_0]])
; CHECK-NEXT: [[T:%.*]] = icmp sge i16 [[EXT]], -1
; CHECK-NEXT: ret i1 [[T]]
;
%ext = zext i8 %a to i16
%a.ne.0 = icmp sge i16 %ext, 0
call void @llvm.assume(i1 %a.ne.0)
%t = icmp sge i16 %ext, -1
ret i1 %t
}

0 comments on commit d227029

Please sign in to comment.