[llvm] 9314111 - [VectorCombine] add test for scalable vectors; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 28 09:44:56 PDT 2020
Author: Sanjay Patel
Date: 2020-06-28T12:44:44-04:00
New Revision: 931411136af6061a7a48553344ff750d2a362d68
URL: https://github.com/llvm/llvm-project/commit/931411136af6061a7a48553344ff750d2a362d68
DIFF: https://github.com/llvm/llvm-project/commit/931411136af6061a7a48553344ff750d2a362d68.diff
LOG: [VectorCombine] add test for scalable vectors; NFC
Added:
Modified:
llvm/test/Transforms/VectorCombine/X86/extract-cmp-binop.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/VectorCombine/X86/extract-cmp-binop.ll b/llvm/test/Transforms/VectorCombine/X86/extract-cmp-binop.ll
index df46fcecf9aa..fa7df755252e 100644
--- a/llvm/test/Transforms/VectorCombine/X86/extract-cmp-binop.ll
+++ b/llvm/test/Transforms/VectorCombine/X86/extract-cmp-binop.ll
@@ -122,3 +122,20 @@ define i1 @
diff erent_source_vec(<4 x i32> %a, <4 x i32> %b) {
%r = and i1 %cmp1, %cmp2
ret i1 %r
}
+
+define i1 @scalable(<vscale x 4 x i32> %a) {
+; CHECK-LABEL: @scalable(
+; CHECK-NEXT: [[E1:%.*]] = extractelement <vscale x 4 x i32> [[A:%.*]], i32 3
+; CHECK-NEXT: [[E2:%.*]] = extractelement <vscale x 4 x i32> [[A]], i32 1
+; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[E1]], 42
+; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[E2]], -8
+; CHECK-NEXT: [[R:%.*]] = xor i1 [[CMP1]], [[CMP2]]
+; CHECK-NEXT: ret i1 [[R]]
+;
+ %e1 = extractelement <vscale x 4 x i32> %a, i32 3
+ %e2 = extractelement <vscale x 4 x i32> %a, i32 1
+ %cmp1 = icmp sgt i32 %e1, 42
+ %cmp2 = icmp sgt i32 %e2, -8
+ %r = xor i1 %cmp1, %cmp2
+ ret i1 %r
+}
More information about the llvm-commits
mailing list