[llvm] 07136a3 - [InstCombine] Add additional vscale icmp tests (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 16 03:37:25 PDT 2023
Author: Nikita Popov
Date: 2023-03-16T11:36:42+01:00
New Revision: 07136a314dc9a9815dacc8ef35dfbc939c271898
URL: https://github.com/llvm/llvm-project/commit/07136a314dc9a9815dacc8ef35dfbc939c271898
DIFF: https://github.com/llvm/llvm-project/commit/07136a314dc9a9815dacc8ef35dfbc939c271898.diff
LOG: [InstCombine] Add additional vscale icmp tests (NFC)
The existing tests don't test the precise range bounds implied
by the vscale_range attribute.
Added:
Modified:
llvm/test/Transforms/InstCombine/icmp-vscale.ll
Removed:
################################################################################
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()
More information about the llvm-commits
mailing list