[ConstraintElimination] Add test for regression after 3771310eed.

This commit is contained in:
Florian Hahn 2022-10-07 20:42:15 +01:00
parent 19ad1cd5ce
commit d227029ce4
No known key found for this signature in database
GPG Key ID: CF59919C6547A668
1 changed files with 15 additions and 0 deletions

View File

@ -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
}