[llvm] [SLP] Move some of X86 tests to common directory (PR #106401)

Elvina Yakubova via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 02:24:02 PDT 2024


https://github.com/ElvinaYakubova updated https://github.com/llvm/llvm-project/pull/106401

>From 582eaf16ed6039964fd910887d07d22c6b6f02e4 Mon Sep 17 00:00:00 2001
From: Elvina Yakubova <eyakubova at nvidia.com>
Date: Wed, 28 Aug 2024 07:44:49 -0700
Subject: [PATCH] [SLP] Move some of X86 tests to common directory

Some of the tests from X86 directory can be generalized for AArch64
to improve its coverage.
---
 .../{X86 => }/alternate-cmp-swapped-pred-parent.ll            | 2 ++
 .../SLPVectorizer/{X86 => }/alternate-opcode-sindle-bv.ll     | 2 ++
 .../Transforms/SLPVectorizer/{X86 => }/arith-div-undef.ll     | 2 ++
 .../{X86 => }/bool-logical-op-reduction-with-poison.ll        | 2 ++
 .../SLPVectorizer/{X86 => }/buildvector-insert-mask-size.ll   | 4 +++-
 .../SLPVectorizer/{X86 => }/buildvector-nodes-dependency.ll   | 2 ++
 .../{X86 => }/call-arg-reduced-by-minbitwidth.ll              | 2 ++
 llvm/test/Transforms/SLPVectorizer/{X86 => }/catchswitch.ll   | 2 ++
 .../SLPVectorizer/{X86 => }/crash_exceed_scheduling.ll        | 2 ++
 .../Transforms/SLPVectorizer/{X86 => }/diamond_broadcast.ll   | 2 ++
 10 files changed, 21 insertions(+), 1 deletion(-)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/alternate-cmp-swapped-pred-parent.ll (94%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/alternate-opcode-sindle-bv.ll (87%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/arith-div-undef.ll (88%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/bool-logical-op-reduction-with-poison.ll (92%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/buildvector-insert-mask-size.ll (76%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/buildvector-nodes-dependency.ll (96%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/call-arg-reduced-by-minbitwidth.ll (96%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/catchswitch.ll (96%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/crash_exceed_scheduling.ll (95%)
 rename llvm/test/Transforms/SLPVectorizer/{X86 => }/diamond_broadcast.ll (88%)

diff --git a/llvm/test/Transforms/SLPVectorizer/X86/alternate-cmp-swapped-pred-parent.ll b/llvm/test/Transforms/SLPVectorizer/alternate-cmp-swapped-pred-parent.ll
similarity index 94%
rename from llvm/test/Transforms/SLPVectorizer/X86/alternate-cmp-swapped-pred-parent.ll
rename to llvm/test/Transforms/SLPVectorizer/alternate-cmp-swapped-pred-parent.ll
index cfac93b1a28fb8..a709af4cf85848 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/alternate-cmp-swapped-pred-parent.ll
+++ b/llvm/test/Transforms/SLPVectorizer/alternate-cmp-swapped-pred-parent.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt < %s -mtriple=x86_64-unknown -passes=slp-vectorizer -S -slp-threshold=-1000 | FileCheck %s
+; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -passes=slp-vectorizer -S -slp-threshold=-1000 | FileCheck %s
 
 define void @test() {
 ; CHECK-LABEL: @test(
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-sindle-bv.ll b/llvm/test/Transforms/SLPVectorizer/alternate-opcode-sindle-bv.ll
similarity index 87%
rename from llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-sindle-bv.ll
rename to llvm/test/Transforms/SLPVectorizer/alternate-opcode-sindle-bv.ll
index 89268837c9d8e0..0dbdd2ec8bea6d 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-sindle-bv.ll
+++ b/llvm/test/Transforms/SLPVectorizer/alternate-opcode-sindle-bv.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
+; RUN: opt -S --passes=slp-vectorizer -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
 
 define <2 x i32> @test(i32 %arg) {
 ; CHECK-LABEL: define <2 x i32> @test(
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/arith-div-undef.ll b/llvm/test/Transforms/SLPVectorizer/arith-div-undef.ll
similarity index 88%
rename from llvm/test/Transforms/SLPVectorizer/X86/arith-div-undef.ll
rename to llvm/test/Transforms/SLPVectorizer/arith-div-undef.ll
index a7330f92346325..b96eac0d0167a3 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/arith-div-undef.ll
+++ b/llvm/test/Transforms/SLPVectorizer/arith-div-undef.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt < %s -mtriple=x86_64-unknown -passes=slp-vectorizer,instcombine -S -slp-threshold=-10000 | FileCheck %s
+; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -passes=slp-vectorizer,instcombine -S -slp-threshold=-10000 | FileCheck %s
 
 define <8 x i32> @sdiv_v8i32_undefs(<8 x i32> %a) {
 ; CHECK-LABEL: @sdiv_v8i32_undefs(
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/bool-logical-op-reduction-with-poison.ll b/llvm/test/Transforms/SLPVectorizer/bool-logical-op-reduction-with-poison.ll
similarity index 92%
rename from llvm/test/Transforms/SLPVectorizer/X86/bool-logical-op-reduction-with-poison.ll
rename to llvm/test/Transforms/SLPVectorizer/bool-logical-op-reduction-with-poison.ll
index 408ea623997289..af6df02b6b1af8 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/bool-logical-op-reduction-with-poison.ll
+++ b/llvm/test/Transforms/SLPVectorizer/bool-logical-op-reduction-with-poison.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt -S --passes=slp-vectorizer < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
+; RUN: opt -S --passes=slp-vectorizer < %s -mtriple=aarch64-unknown-linux-gnu | FileCheck %s
 
 define i1 @test(i32 %0, i32 %1, i32 %p) {
 ; CHECK-LABEL: define i1 @test(
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-insert-mask-size.ll b/llvm/test/Transforms/SLPVectorizer/buildvector-insert-mask-size.ll
similarity index 76%
rename from llvm/test/Transforms/SLPVectorizer/X86/buildvector-insert-mask-size.ll
rename to llvm/test/Transforms/SLPVectorizer/buildvector-insert-mask-size.ll
index b8331c9e1faa35..97367a99f36745 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-insert-mask-size.ll
+++ b/llvm/test/Transforms/SLPVectorizer/buildvector-insert-mask-size.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-;RUN: opt -S -passes=slp-vectorizer -mtriple=x86_64-unknown-linux < %s -slp-threshold=-1 | FileCheck %s
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
+; RUN: opt -S -passes=slp-vectorizer -mtriple=x86_64-unknown-linux < %s -slp-threshold=-1 | FileCheck %s
+; RUN: opt -S -passes=slp-vectorizer -mtriple=aarch64-unknown-linux < %s -slp-threshold=-1 | FileCheck %s
 
 define void @test() {
 ; CHECK-LABEL: @test(
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-nodes-dependency.ll b/llvm/test/Transforms/SLPVectorizer/buildvector-nodes-dependency.ll
similarity index 96%
rename from llvm/test/Transforms/SLPVectorizer/X86/buildvector-nodes-dependency.ll
rename to llvm/test/Transforms/SLPVectorizer/buildvector-nodes-dependency.ll
index 001da64c60a93f..9d3463e2e05111 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-nodes-dependency.ll
+++ b/llvm/test/Transforms/SLPVectorizer/buildvector-nodes-dependency.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64 < %s | FileCheck %s
+; RUN: opt -passes=slp-vectorizer -S -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
 
 define double @test() {
 ; CHECK-LABEL: define double @test() {
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/call-arg-reduced-by-minbitwidth.ll b/llvm/test/Transforms/SLPVectorizer/call-arg-reduced-by-minbitwidth.ll
similarity index 96%
rename from llvm/test/Transforms/SLPVectorizer/X86/call-arg-reduced-by-minbitwidth.ll
rename to llvm/test/Transforms/SLPVectorizer/call-arg-reduced-by-minbitwidth.ll
index 82966124d3baa4..b77184b1b5b87a 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/call-arg-reduced-by-minbitwidth.ll
+++ b/llvm/test/Transforms/SLPVectorizer/call-arg-reduced-by-minbitwidth.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-pc-windows-msvc19.34.0 < %s | FileCheck %s
+; RUN: opt -S --passes=slp-vectorizer -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
 
 define void @test(ptr %0, i8 %1, i1 %cmp12.i) {
 ; CHECK-LABEL: define void @test(
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/catchswitch.ll b/llvm/test/Transforms/SLPVectorizer/catchswitch.ll
similarity index 96%
rename from llvm/test/Transforms/SLPVectorizer/X86/catchswitch.ll
rename to llvm/test/Transforms/SLPVectorizer/catchswitch.ll
index f8a7a9503ca52f..a229f3de1cc4df 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/catchswitch.ll
+++ b/llvm/test/Transforms/SLPVectorizer/catchswitch.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64-pc-windows-msvc19.29.30145 < %s | FileCheck %s
+; RUN: opt -passes=slp-vectorizer -S -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
 
 ; This used to crash in SLP vectorization when attempting to set the
 ; IRBuilder's insertion point to the end of a catchswitch block, which
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/crash_exceed_scheduling.ll b/llvm/test/Transforms/SLPVectorizer/crash_exceed_scheduling.ll
similarity index 95%
rename from llvm/test/Transforms/SLPVectorizer/X86/crash_exceed_scheduling.ll
rename to llvm/test/Transforms/SLPVectorizer/crash_exceed_scheduling.ll
index 18d9f8c903c5b4..c88f78595f23f2 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/crash_exceed_scheduling.ll
+++ b/llvm/test/Transforms/SLPVectorizer/crash_exceed_scheduling.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt < %s -passes=slp-vectorizer -slp-min-tree-size=2 -slp-threshold=-1000 -slp-max-look-ahead-depth=1 -slp-schedule-budget=27 -S -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
+; RUN: opt < %s -passes=slp-vectorizer -slp-min-tree-size=2 -slp-threshold=-1000 -slp-max-look-ahead-depth=1 -slp-schedule-budget=27 -S -mtriple=aarch64-unknown-linux-gnu | FileCheck %s
 
 define void @exceed(double %0, double %1) {
 ; CHECK-LABEL: @exceed(
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast.ll b/llvm/test/Transforms/SLPVectorizer/diamond_broadcast.ll
similarity index 88%
rename from llvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast.ll
rename to llvm/test/Transforms/SLPVectorizer/diamond_broadcast.ll
index 60006ccc825174..afe75a1f2718d8 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast.ll
+++ b/llvm/test/Transforms/SLPVectorizer/diamond_broadcast.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; REQUIRES: target={{aarch64|x86_64}}-{{.*}}
 ; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64-unknown-linux -slp-threshold=-1 | FileCheck %s
+; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=aarch64-unknown-linux-gnu -slp-threshold=-1 | FileCheck %s
 
 define i32 @diamond_broadcast(ptr noalias nocapture %B, ptr noalias nocapture %A) {
 ; CHECK-LABEL: @diamond_broadcast(



More information about the llvm-commits mailing list