diff --git a/llvm/test/tools/llvm-exegesis/X86/dummy-perf-counters-subprocess.s b/llvm/test/tools/llvm-exegesis/X86/dummy-perf-counters-subprocess.s new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-exegesis/X86/dummy-perf-counters-subprocess.s @@ -0,0 +1,7 @@ +# REQUIRES: exegesis-can-measure-latency, x86_64-linux + +# RUN: not llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=%s -execution-mode=subprocess -use-dummy-perf-counters 2>&1 | FileCheck %s + +# CHECK: llvm-exegesis error: Dummy perf counters are not supported in the subprocess execution mode. + +mov $0, %rax diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp --- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp +++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp @@ -477,6 +477,11 @@ if (BenchmarkPhaseSelector == BenchmarkPhaseSelectorE::Measure) ExitOnErr(State.getExegesisTarget().checkFeatureSupport()); + if (ExecutionMode == BenchmarkRunner::ExecutionModeE::SubProcess && + UseDummyPerfCounters) + ExitWithError("Dummy perf counters are not supported in the subprocess " + "execution mode."); + const std::unique_ptr Runner = ExitOnErr(State.getExegesisTarget().createBenchmarkRunner( BenchmarkMode, State, BenchmarkPhaseSelector, ExecutionMode,