-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SLP] Move some of X86 tests to common directory #106401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-transforms Author: Elvina Yakubova (ElvinaYakubova) ChangesSome of the tests from X86 directory can be generalized for AArch64 to improve its coverage. Full diff: https://github.com/llvm/llvm-project/pull/106401.diff 10 Files Affected:
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 96%
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..3ab9f6219ece37 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,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; 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 91%
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..b03dcd1fec29ae 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,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; 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 91%
rename from llvm/test/Transforms/SLPVectorizer/X86/arith-div-undef.ll
rename to llvm/test/Transforms/SLPVectorizer/arith-div-undef.ll
index a7330f92346325..3c8f727e3897f2 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/arith-div-undef.ll
+++ b/llvm/test/Transforms/SLPVectorizer/arith-div-undef.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; 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 95%
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..74559401b6b292 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,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
; 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 79%
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..00595a60a6cb26 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,6 @@
; 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
+; 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 97%
rename from llvm/test/Transforms/SLPVectorizer/X86/buildvector-nodes-dependency.ll
rename to llvm/test/Transforms/SLPVectorizer/buildvector-nodes-dependency.ll
index 001da64c60a93f..9f13c1248b93e3 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-nodes-dependency.ll
+++ b/llvm/test/Transforms/SLPVectorizer/buildvector-nodes-dependency.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; 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 97%
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..ac12d8c166ed91 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,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; 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 97%
rename from llvm/test/Transforms/SLPVectorizer/X86/catchswitch.ll
rename to llvm/test/Transforms/SLPVectorizer/catchswitch.ll
index f8a7a9503ca52f..41c4d7210899b5 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/catchswitch.ll
+++ b/llvm/test/Transforms/SLPVectorizer/catchswitch.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; 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 96%
rename from llvm/test/Transforms/SLPVectorizer/X86/crash_exceed_scheduling.ll
rename to llvm/test/Transforms/SLPVectorizer/crash_exceed_scheduling.ll
index 18d9f8c903c5b4..96e035dd42f217 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/crash_exceed_scheduling.ll
+++ b/llvm/test/Transforms/SLPVectorizer/crash_exceed_scheduling.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; 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 91%
rename from llvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast.ll
rename to llvm/test/Transforms/SLPVectorizer/diamond_broadcast.ll
index 60006ccc825174..8dea9ddbc03718 100644
--- a/llvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast.ll
+++ b/llvm/test/Transforms/SLPVectorizer/diamond_broadcast.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; 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(
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These test must be either copied to AArch64 directory, or special directives REQUIRES: x86, aarch64 should be used to avoid false failed tests in some llvm configs
Does not this mean that the supported host architecture must be x86/aarch64 ? We just want to run the tests for x86/aarch64 which is indicated by the -mtriple option and hence, it wont run for other triples. |
If the llvm compiled without x86 or aarch64, it still tries to run all the tests. These tests will fail, because llvm won't be able execute them successfully. To prevent their unconditional execution, need to add special directives that checks if the compiler supports given target. Or put them in the corresponding directories, where config files do the same - check if the llvm support given target before running the tests in the given directories. |
98bfd84
to
582eaf1
Compare
Thanks for the explanation. I updated the commit with REQUIRES since we don't want to duplicate tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
Some of the tests from X86 directory can be generalized for AArch64 to improve its coverage.
582eaf1
to
39378fb
Compare
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/5728 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/5347 Here is the relevant piece of the build log for the reference
|
@@ -1,5 +1,7 @@ | |||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | |||
; REQUIRES: target={{aarch64|x86_64}}-{{.*}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check this works as expected?
With this patch merged, those tests are now considered 'unsupported' even when all targets are enabled.
You can check this by applying the patch below and observe that there are no test failures
diff --git a/llvm/test/Transforms/SLPVectorizer/alternate-cmp-swapped-pred-parent.ll b/llvm/test/Transforms/SLPVectorizer/alternate-cmp-swapped-pred-parent.ll
index a709af4cf858..1511dfbe37b6 100644
--- a/llvm/test/Transforms/SLPVectorizer/alternate-cmp-swapped-pred-parent.ll
+++ b/llvm/test/Transforms/SLPVectorizer/alternate-cmp-swapped-pred-parent.ll
@@ -6,7 +6,6 @@
define void @test() {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[CALL37:%.*]] = load i16, ptr poison, align 2
; CHECK-NEXT: br label [[BB:%.*]]
; CHECK: bb:
; CHECK-NEXT: [[CALL:%.*]] = load i16, ptr poison, align 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I checked and locally for me it worked fine
There are some buildbots failures as well, I'll try to figure out what's going on asap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it helps, the above is for ARM64 macOS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/3717 Here is the relevant piece of the build log for the reference
|
Some of the tests from X86 directory can be generalized for AArch64 to improve its coverage.