diff --git a/llvm/test/Transforms/InstCombine/icmp-vscale.ll b/llvm/test/Transforms/InstCombine/icmp-vscale.ll index c85a9e8a406d..15fcf717accc 100644 --- a/llvm/test/Transforms/InstCombine/icmp-vscale.ll +++ b/llvm/test/Transforms/InstCombine/icmp-vscale.ll @@ -82,6 +82,50 @@ entry: 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 i16 @llvm.vscale.i16() declare i32 @llvm.vscale.i32()