From 28481789cfed8fb51a40517f713472fb0957328e Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Mon, 8 Apr 2019 10:50:31 +0000 Subject: [PATCH] [llvm-exegesis] benchmarkMain(): less cryptic error if built w/o libpfm Wanted to check if inablility to measure latency of CMOV32rm is a regression from D60041 / D60138, but unable to do that because the llvm-exegesis-{8,9} from debian sid fails with that cryptic, unhelpful error. I suspect this will be a better error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357900 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-exegesis/llvm-exegesis.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/llvm-exegesis/llvm-exegesis.cpp b/tools/llvm-exegesis/llvm-exegesis.cpp index 7339baf8f8e..ed8ab6fc3f0 100644 --- a/tools/llvm-exegesis/llvm-exegesis.cpp +++ b/tools/llvm-exegesis/llvm-exegesis.cpp @@ -359,6 +359,11 @@ readSnippets(const LLVMState &State, llvm::StringRef Filename) { } void benchmarkMain() { +#ifndef HAVE_LIBPFM + llvm::report_fatal_error( + "benchmarking unavaliable, LLVM was built without libpfm."); +#endif + if (exegesis::pfm::pfmInitialize()) llvm::report_fatal_error("cannot initialize libpfm"); -- 2.40.0