From 458d70674190c4d043d5dfd2e41aecddff5cdb69 Mon Sep 17 00:00:00 2001 From: Peter Waller Date: Tue, 7 May 2024 13:06:00 +0100 Subject: [PATCH] [llvm-mca] Make bad-input.s even more CPU specific Note: This patch is distinct from the previous one titled "[llvm-mca] Move bad-input.s test to be target specific" This is a followup to #90474 and commit afc10fc9b7ce3d23d9012f5a1496e849fe873ba2 Context: Builders failing because they're unable to run the failure test. This still doesn't work in various circumstances, it seems MCA doesn't want to run on a wide variety of hosts in various configurations, so stick to the tried and tested method and pass -mtriple and -mcpu. --- .../tools/llvm-mca/AArch64/Neoverse/bad-input.s | 16 ++++++++++++++++ llvm/test/tools/llvm-mca/AArch64/bad-input.s | 14 -------------- llvm/test/tools/llvm-mca/X86/bad-input.s | 12 +++++++----- 3 files changed, 23 insertions(+), 19 deletions(-) create mode 100644 llvm/test/tools/llvm-mca/AArch64/Neoverse/bad-input.s delete mode 100644 llvm/test/tools/llvm-mca/AArch64/bad-input.s diff --git a/llvm/test/tools/llvm-mca/AArch64/Neoverse/bad-input.s b/llvm/test/tools/llvm-mca/AArch64/Neoverse/bad-input.s new file mode 100644 index 000000000000..41891adc6c0d --- /dev/null +++ b/llvm/test/tools/llvm-mca/AArch64/Neoverse/bad-input.s @@ -0,0 +1,16 @@ +# This test is generic but not all builders have an llvm-mca which can run natively. + +# RUN: not llvm-mca -mtriple=aarch64 -mcpu=neoverse-v1 %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s +# RUN: not llvm-mca -mtriple=aarch64 -mcpu=neoverse-v1 -skip-unsupported-instructions=none %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s +# RUN: not llvm-mca -mtriple=aarch64 -mcpu=neoverse-v1 -skip-unsupported-instructions=lack-sched %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s +# RUN: not llvm-mca -mtriple=aarch64 -mcpu=neoverse-v1 -skip-unsupported-instructions=parse-failure %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s +# RUN: not llvm-mca -mtriple=aarch64 -mcpu=neoverse-v1 -skip-unsupported-instructions=any %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s + +# Test checks that MCA does not produce a total cycles estimate if it encounters parse errors. + +# CHECK-ALL-NOT: Total Cycles: + +# CHECK: error: Assembly input parsing had errors, use -skip-unsupported-instructions=parse-failure to drop failing lines from the input. +# CHECK-SKIP: error: no assembly instructions found. + +This is not a valid assembly file for any architecture (by virtue of this text.) diff --git a/llvm/test/tools/llvm-mca/AArch64/bad-input.s b/llvm/test/tools/llvm-mca/AArch64/bad-input.s deleted file mode 100644 index eaf69979cb20..000000000000 --- a/llvm/test/tools/llvm-mca/AArch64/bad-input.s +++ /dev/null @@ -1,14 +0,0 @@ -# RUN: not llvm-mca %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s -# RUN: not llvm-mca -skip-unsupported-instructions=none %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s -# RUN: not llvm-mca -skip-unsupported-instructions=lack-sched %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s -# RUN: not llvm-mca -skip-unsupported-instructions=parse-failure %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s -# RUN: not llvm-mca -skip-unsupported-instructions=any %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s - -# Test checks that MCA does not produce a total cycles estimate if it encounters parse errors. - -# CHECK-ALL-NOT: Total Cycles: - -# CHECK: error: Assembly input parsing had errors, use -skip-unsupported-instructions=parse-failure to drop failing lines from the input. -# CHECK-SKIP: error: no assembly instructions found. - -This is not a valid assembly file for any architecture (by virtue of this text.) diff --git a/llvm/test/tools/llvm-mca/X86/bad-input.s b/llvm/test/tools/llvm-mca/X86/bad-input.s index eaf69979cb20..b49bccc45b2d 100644 --- a/llvm/test/tools/llvm-mca/X86/bad-input.s +++ b/llvm/test/tools/llvm-mca/X86/bad-input.s @@ -1,8 +1,10 @@ -# RUN: not llvm-mca %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s -# RUN: not llvm-mca -skip-unsupported-instructions=none %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s -# RUN: not llvm-mca -skip-unsupported-instructions=lack-sched %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s -# RUN: not llvm-mca -skip-unsupported-instructions=parse-failure %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s -# RUN: not llvm-mca -skip-unsupported-instructions=any %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s +# This test is generic but not all builders have an llvm-mca which can run natively. + +# RUN: not llvm-mca -mtriple=x86_64 -mcpu=x86-64 %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s +# RUN: not llvm-mca -mtriple=x86_64 -mcpu=x86-64 -skip-unsupported-instructions=none %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s +# RUN: not llvm-mca -mtriple=x86_64 -mcpu=x86-64 -skip-unsupported-instructions=lack-sched %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK %s +# RUN: not llvm-mca -mtriple=x86_64 -mcpu=x86-64 -skip-unsupported-instructions=parse-failure %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s +# RUN: not llvm-mca -mtriple=x86_64 -mcpu=x86-64 -skip-unsupported-instructions=any %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s # Test checks that MCA does not produce a total cycles estimate if it encounters parse errors.