[InstCombine] Add additional vscale icmp tests (NFC)

The existing tests don't test the precise range bounds implied
by the vscale_range attribute.
This commit is contained in:
Nikita Popov 2023-03-16 11:36:42 +01:00
parent 16d9488cca
commit 07136a314d

View File

@ -82,6 +82,50 @@ entry:
ret i1 %res ret i1 %res
} }
define i1 @vscale_ule_max() vscale_range(5,10) {
; CHECK-LABEL: @vscale_ule_max(
; CHECK-NEXT: [[VSCALE:%.*]] = call i16 @llvm.vscale.i16()
; CHECK-NEXT: [[RES:%.*]] = icmp ult i16 [[VSCALE]], 11
; CHECK-NEXT: ret i1 [[RES]]
;
%vscale = call i16 @llvm.vscale.i16()
%res = icmp ule i16 %vscale, 10
ret i1 %res
}
define i1 @vscale_ult_max() vscale_range(5,10) {
; CHECK-LABEL: @vscale_ult_max(
; CHECK-NEXT: [[VSCALE:%.*]] = call i16 @llvm.vscale.i16()
; CHECK-NEXT: [[RES:%.*]] = icmp ult i16 [[VSCALE]], 10
; CHECK-NEXT: ret i1 [[RES]]
;
%vscale = call i16 @llvm.vscale.i16()
%res = icmp ult i16 %vscale, 10
ret i1 %res
}
define i1 @vscale_uge_min() vscale_range(5,10) {
; CHECK-LABEL: @vscale_uge_min(
; CHECK-NEXT: [[VSCALE:%.*]] = call i16 @llvm.vscale.i16()
; CHECK-NEXT: [[RES:%.*]] = icmp ugt i16 [[VSCALE]], 4
; CHECK-NEXT: ret i1 [[RES]]
;
%vscale = call i16 @llvm.vscale.i16()
%res = icmp uge i16 %vscale, 5
ret i1 %res
}
define i1 @vscale_ugt_min() vscale_range(5,10) {
; CHECK-LABEL: @vscale_ugt_min(
; CHECK-NEXT: [[VSCALE:%.*]] = call i16 @llvm.vscale.i16()
; CHECK-NEXT: [[RES:%.*]] = icmp ugt i16 [[VSCALE]], 5
; CHECK-NEXT: ret i1 [[RES]]
;
%vscale = call i16 @llvm.vscale.i16()
%res = icmp ugt i16 %vscale, 5
ret i1 %res
}
declare i8 @llvm.vscale.i8() declare i8 @llvm.vscale.i8()
declare i16 @llvm.vscale.i16() declare i16 @llvm.vscale.i16()
declare i32 @llvm.vscale.i32() declare i32 @llvm.vscale.i32()