[llvm] e13c62a - [InstSimplify][test] move tests that don't require InstCombine; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 24 10:15:07 PDT 2021
Author: Sanjay Patel
Date: 2021-06-24T13:13:34-04:00
New Revision: e13c62a10371dea7d4cfd491bb2ef3b779e7526f
URL: https://github.com/llvm/llvm-project/commit/e13c62a10371dea7d4cfd491bb2ef3b779e7526f
DIFF: https://github.com/llvm/llvm-project/commit/e13c62a10371dea7d4cfd491bb2ef3b779e7526f.diff
LOG: [InstSimplify][test] move tests that don't require InstCombine; NFC
These are existing/missing simplifications, so the tests
don't need the full power of InstCombine.
Added:
Modified:
llvm/test/Transforms/InstCombine/vscale_extractelement-inseltpoison.ll
llvm/test/Transforms/InstCombine/vscale_extractelement.ll
llvm/test/Transforms/InstSimplify/vscale-inseltpoison.ll
llvm/test/Transforms/InstSimplify/vscale.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/vscale_extractelement-inseltpoison.ll b/llvm/test/Transforms/InstCombine/vscale_extractelement-inseltpoison.ll
index 07ca96d44de21..ac4efe956beed 100644
--- a/llvm/test/Transforms/InstCombine/vscale_extractelement-inseltpoison.ll
+++ b/llvm/test/Transforms/InstCombine/vscale_extractelement-inseltpoison.ll
@@ -55,16 +55,6 @@ define i8 @extractelement_bitcast_wrong_insert(<vscale x 2 x i32> %a, i32 %x) {
ret i8 %r
}
-define i32 @extractelement_shuffle_in_range(i32 %v) {
-; CHECK-LABEL: @extractelement_shuffle_in_range(
-; CHECK-NEXT: ret i32 %v
-;
- %in = insertelement <vscale x 4 x i32> poison, i32 %v, i32 0
- %splat = shufflevector <vscale x 4 x i32> %in, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
- %r = extractelement <vscale x 4 x i32> %splat, i32 1
- ret i32 %r
-}
-
define i32 @extractelement_shuffle_maybe_out_of_range(i32 %v) {
; CHECK-LABEL: @extractelement_shuffle_maybe_out_of_range(
; CHECK-NEXT: [[IN:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[V:%.*]], i32 0
@@ -91,20 +81,6 @@ define i32 @extractelement_shuffle_invalid_index(i32 %v) {
ret i32 %r
}
-
-define i32 @extractelement_shuffle_symbolic_index(i32 %v, i32 %idx) {
-; CHECK-LABEL: @extractelement_shuffle_symbolic_index(
-; CHECK-NEXT: [[IN:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[V:%.*]], i32 0
-; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[IN]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
-; CHECK-NEXT: [[R:%.*]] = extractelement <vscale x 4 x i32> [[SPLAT]], i32 [[IDX:%.*]]
-; CHECK-NEXT: ret i32 [[R]]
-;
- %in = insertelement <vscale x 4 x i32> poison, i32 %v, i32 0
- %splat = shufflevector <vscale x 4 x i32> %in, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
- %r = extractelement <vscale x 4 x i32> %splat, i32 %idx
- ret i32 %r
-}
-
define <vscale x 4 x i32> @extractelement_insertelement_same_positions(<vscale x 4 x i32> %vec) {
; CHECK-LABEL: @extractelement_insertelement_same_positions(
; CHECK-NEXT: ret <vscale x 4 x i32> [[VEC:%.*]]
diff --git a/llvm/test/Transforms/InstCombine/vscale_extractelement.ll b/llvm/test/Transforms/InstCombine/vscale_extractelement.ll
index 0d7eb90b2d3a6..302f845c94748 100644
--- a/llvm/test/Transforms/InstCombine/vscale_extractelement.ll
+++ b/llvm/test/Transforms/InstCombine/vscale_extractelement.ll
@@ -55,16 +55,6 @@ define i8 @extractelement_bitcast_wrong_insert(<vscale x 2 x i32> %a, i32 %x) {
ret i8 %r
}
-define i32 @extractelement_shuffle_in_range(i32 %v) {
-; CHECK-LABEL: @extractelement_shuffle_in_range(
-; CHECK-NEXT: ret i32 %v
-;
- %in = insertelement <vscale x 4 x i32> undef, i32 %v, i32 0
- %splat = shufflevector <vscale x 4 x i32> %in, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
- %r = extractelement <vscale x 4 x i32> %splat, i32 1
- ret i32 %r
-}
-
define i32 @extractelement_shuffle_maybe_out_of_range(i32 %v) {
; CHECK-LABEL: @extractelement_shuffle_maybe_out_of_range(
; CHECK-NEXT: [[IN:%.*]] = insertelement <vscale x 4 x i32> undef, i32 [[V:%.*]], i32 0
@@ -91,20 +81,6 @@ define i32 @extractelement_shuffle_invalid_index(i32 %v) {
ret i32 %r
}
-
-define i32 @extractelement_shuffle_symbolic_index(i32 %v, i32 %idx) {
-; CHECK-LABEL: @extractelement_shuffle_symbolic_index(
-; CHECK-NEXT: [[IN:%.*]] = insertelement <vscale x 4 x i32> undef, i32 [[V:%.*]], i32 0
-; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[IN]], <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
-; CHECK-NEXT: [[R:%.*]] = extractelement <vscale x 4 x i32> [[SPLAT]], i32 [[IDX:%.*]]
-; CHECK-NEXT: ret i32 [[R]]
-;
- %in = insertelement <vscale x 4 x i32> undef, i32 %v, i32 0
- %splat = shufflevector <vscale x 4 x i32> %in, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
- %r = extractelement <vscale x 4 x i32> %splat, i32 %idx
- ret i32 %r
-}
-
define <vscale x 4 x i32> @extractelement_insertelement_same_positions(<vscale x 4 x i32> %vec) {
; CHECK-LABEL: @extractelement_insertelement_same_positions(
; CHECK-NEXT: ret <vscale x 4 x i32> [[VEC:%.*]]
diff --git a/llvm/test/Transforms/InstSimplify/vscale-inseltpoison.ll b/llvm/test/Transforms/InstSimplify/vscale-inseltpoison.ll
index 6ad1a2dca33e9..a7739490ce7af 100644
--- a/llvm/test/Transforms/InstSimplify/vscale-inseltpoison.ll
+++ b/llvm/test/Transforms/InstSimplify/vscale-inseltpoison.ll
@@ -197,3 +197,26 @@ define i1 @getelementptr_check_non_null(<vscale x 16 x i8>* %ptr) {
%cmp = icmp eq <vscale x 16 x i8>* %x, null
ret i1 %cmp
}
+
+define i32 @extractelement_splat_constant_index(i32 %v) {
+; CHECK-LABEL: @extractelement_splat_constant_index(
+; CHECK-NEXT: ret i32 [[V:%.*]]
+;
+ %in = insertelement <vscale x 4 x i32> poison, i32 %v, i32 0
+ %splat = shufflevector <vscale x 4 x i32> %in, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
+ %r = extractelement <vscale x 4 x i32> %splat, i32 1
+ ret i32 %r
+}
+
+define i32 @extractelement_splat_variable_index(i32 %v, i32 %idx) {
+; CHECK-LABEL: @extractelement_splat_variable_index(
+; CHECK-NEXT: [[IN:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[V:%.*]], i32 0
+; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[IN]], <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
+; CHECK-NEXT: [[R:%.*]] = extractelement <vscale x 4 x i32> [[SPLAT]], i32 [[IDX:%.*]]
+; CHECK-NEXT: ret i32 [[R]]
+;
+ %in = insertelement <vscale x 4 x i32> poison, i32 %v, i32 0
+ %splat = shufflevector <vscale x 4 x i32> %in, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
+ %r = extractelement <vscale x 4 x i32> %splat, i32 %idx
+ ret i32 %r
+}
diff --git a/llvm/test/Transforms/InstSimplify/vscale.ll b/llvm/test/Transforms/InstSimplify/vscale.ll
index 4cf6f5dc58289..108a9bb7726a2 100644
--- a/llvm/test/Transforms/InstSimplify/vscale.ll
+++ b/llvm/test/Transforms/InstSimplify/vscale.ll
@@ -197,3 +197,26 @@ define i1 @getelementptr_check_non_null(<vscale x 16 x i8>* %ptr) {
%cmp = icmp eq <vscale x 16 x i8>* %x, null
ret i1 %cmp
}
+
+define i32 @extractelement_splat_constant_index(i32 %v) {
+; CHECK-LABEL: @extractelement_splat_constant_index(
+; CHECK-NEXT: ret i32 [[V:%.*]]
+;
+ %in = insertelement <vscale x 4 x i32> undef, i32 %v, i32 0
+ %splat = shufflevector <vscale x 4 x i32> %in, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
+ %r = extractelement <vscale x 4 x i32> %splat, i32 1
+ ret i32 %r
+}
+
+define i32 @extractelement_splat_variable_index(i32 %v, i32 %idx) {
+; CHECK-LABEL: @extractelement_splat_variable_index(
+; CHECK-NEXT: [[IN:%.*]] = insertelement <vscale x 4 x i32> undef, i32 [[V:%.*]], i32 0
+; CHECK-NEXT: [[SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[IN]], <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
+; CHECK-NEXT: [[R:%.*]] = extractelement <vscale x 4 x i32> [[SPLAT]], i32 [[IDX:%.*]]
+; CHECK-NEXT: ret i32 [[R]]
+;
+ %in = insertelement <vscale x 4 x i32> undef, i32 %v, i32 0
+ %splat = shufflevector <vscale x 4 x i32> %in, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
+ %r = extractelement <vscale x 4 x i32> %splat, i32 %idx
+ ret i32 %r
+}
More information about the llvm-commits
mailing list