blob: d338be235fc33ea271a5c54b54227d45092c32b7 [file] [log] [blame]
Clement Courbetac74acd2018-04-04 11:37:06 +00001//===-- llvm-exegesis.cpp ---------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9///
10/// \file
11/// Measures execution properties (latencies/uops) of an instruction.
12///
13//===----------------------------------------------------------------------===//
14
Clement Courbet37f0ca02018-05-15 12:08:00 +000015#include "lib/Analysis.h"
Clement Courbetac74acd2018-04-04 11:37:06 +000016#include "lib/BenchmarkResult.h"
17#include "lib/BenchmarkRunner.h"
Clement Courbet37f0ca02018-05-15 12:08:00 +000018#include "lib/Clustering.h"
Clement Courbetac74acd2018-04-04 11:37:06 +000019#include "lib/LlvmState.h"
20#include "lib/PerfHelper.h"
Clement Courbet4860b982018-06-26 08:49:30 +000021#include "lib/Target.h"
Clement Courbetac74acd2018-04-04 11:37:06 +000022#include "llvm/ADT/StringExtras.h"
23#include "llvm/ADT/Twine.h"
24#include "llvm/MC/MCInstBuilder.h"
Clement Courbet78b2e732018-09-25 07:31:44 +000025#include "llvm/MC/MCObjectFileInfo.h"
26#include "llvm/MC/MCParser/MCAsmParser.h"
27#include "llvm/MC/MCParser/MCTargetAsmParser.h"
Clement Courbetac74acd2018-04-04 11:37:06 +000028#include "llvm/MC/MCRegisterInfo.h"
Clement Courbet78b2e732018-09-25 07:31:44 +000029#include "llvm/MC/MCStreamer.h"
Clement Courbet37f0ca02018-05-15 12:08:00 +000030#include "llvm/MC/MCSubtargetInfo.h"
Clement Courbet78b2e732018-09-25 07:31:44 +000031#include "llvm/Object/ObjectFile.h"
Clement Courbetac74acd2018-04-04 11:37:06 +000032#include "llvm/Support/CommandLine.h"
Clement Courbet37f0ca02018-05-15 12:08:00 +000033#include "llvm/Support/Format.h"
Clement Courbetac74acd2018-04-04 11:37:06 +000034#include "llvm/Support/Path.h"
Clement Courbet78b2e732018-09-25 07:31:44 +000035#include "llvm/Support/SourceMgr.h"
Clement Courbet37f0ca02018-05-15 12:08:00 +000036#include "llvm/Support/TargetRegistry.h"
Clement Courbetac74acd2018-04-04 11:37:06 +000037#include "llvm/Support/TargetSelect.h"
38#include <algorithm>
39#include <random>
40#include <string>
41#include <unordered_map>
42
43static llvm::cl::opt<unsigned>
44 OpcodeIndex("opcode-index", llvm::cl::desc("opcode to measure, by index"),
45 llvm::cl::init(0));
46
47static llvm::cl::opt<std::string>
48 OpcodeName("opcode-name", llvm::cl::desc("opcode to measure, by name"),
49 llvm::cl::init(""));
50
Clement Courbet37f0ca02018-05-15 12:08:00 +000051static llvm::cl::opt<std::string>
Clement Courbet78b2e732018-09-25 07:31:44 +000052 SnippetsFile("snippets-file", llvm::cl::desc("code snippets to measure"),
53 llvm::cl::init(""));
54
55static llvm::cl::opt<std::string>
Guillaume Chatelet8c91d4c2018-06-07 07:51:16 +000056 BenchmarkFile("benchmarks-file", llvm::cl::desc(""), llvm::cl::init(""));
Clement Courbet37f0ca02018-05-15 12:08:00 +000057
Clement Courbet4860b982018-06-26 08:49:30 +000058static llvm::cl::opt<exegesis::InstructionBenchmark::ModeE> BenchmarkMode(
Clement Courbet5ec03cd2018-05-18 12:33:57 +000059 "mode", llvm::cl::desc("the mode to run"),
Clement Courbet4860b982018-06-26 08:49:30 +000060 llvm::cl::values(clEnumValN(exegesis::InstructionBenchmark::Latency,
61 "latency", "Instruction Latency"),
62 clEnumValN(exegesis::InstructionBenchmark::Uops, "uops",
63 "Uop Decomposition"),
64 // When not asking for a specific benchmark mode, we'll
65 // analyse the results.
66 clEnumValN(exegesis::InstructionBenchmark::Unknown,
67 "analysis", "Analysis")));
Clement Courbetac74acd2018-04-04 11:37:06 +000068
69static llvm::cl::opt<unsigned>
70 NumRepetitions("num-repetitions",
71 llvm::cl::desc("number of time to repeat the asm snippet"),
72 llvm::cl::init(10000));
73
Clement Courbete752fd62018-06-18 11:27:47 +000074static llvm::cl::opt<bool> IgnoreInvalidSchedClass(
75 "ignore-invalid-sched-class",
76 llvm::cl::desc("ignore instructions that do not define a sched class"),
77 llvm::cl::init(false));
78
Clement Courbet37f0ca02018-05-15 12:08:00 +000079static llvm::cl::opt<unsigned> AnalysisNumPoints(
80 "analysis-numpoints",
81 llvm::cl::desc("minimum number of points in an analysis cluster"),
82 llvm::cl::init(3));
83
84static llvm::cl::opt<float>
85 AnalysisEpsilon("analysis-epsilon",
86 llvm::cl::desc("dbscan epsilon for analysis clustering"),
87 llvm::cl::init(0.1));
88
Clement Courbetcf210742018-05-17 13:41:28 +000089static llvm::cl::opt<std::string>
90 AnalysisClustersOutputFile("analysis-clusters-output-file",
91 llvm::cl::desc(""), llvm::cl::init("-"));
92static llvm::cl::opt<std::string>
93 AnalysisInconsistenciesOutputFile("analysis-inconsistencies-output-file",
94 llvm::cl::desc(""), llvm::cl::init("-"));
Clement Courbetcaa163e2018-05-16 09:50:04 +000095
Clement Courbetac74acd2018-04-04 11:37:06 +000096namespace exegesis {
97
Guillaume Chatelet8c91d4c2018-06-07 07:51:16 +000098static llvm::ExitOnError ExitOnErr;
99
Clement Courbet44b4c542018-06-19 11:28:59 +0000100#ifdef LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET
101void LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET();
102#endif
103
Clement Courbet78b2e732018-09-25 07:31:44 +0000104// Checks that only one of OpcodeName, OpcodeIndex or SnippetsFile is provided,
105// and returns the opcode index or 0 if snippets should be read from
106// `SnippetsFile`.
107static unsigned getOpcodeOrDie(const llvm::MCInstrInfo &MCInstrInfo) {
108 const size_t NumSetFlags = (OpcodeName.empty() ? 0 : 1) +
109 (OpcodeIndex == 0 ? 0 : 1) +
110 (SnippetsFile.empty() ? 0 : 1);
111 if (NumSetFlags != 1)
Clement Courbet0e69e2d2018-05-17 10:52:18 +0000112 llvm::report_fatal_error(
Clement Courbet78b2e732018-09-25 07:31:44 +0000113 "please provide one and only one of 'opcode-index', 'opcode-name' or "
114 "'snippets-file'");
115 if (!SnippetsFile.empty())
116 return 0;
Clement Courbet0e69e2d2018-05-17 10:52:18 +0000117 if (OpcodeIndex > 0)
118 return OpcodeIndex;
119 // Resolve opcode name -> opcode.
120 for (unsigned I = 0, E = MCInstrInfo.getNumOpcodes(); I < E; ++I)
121 if (MCInstrInfo.getName(I) == OpcodeName)
122 return I;
123 llvm::report_fatal_error(llvm::Twine("unknown opcode ").concat(OpcodeName));
124}
125
Clement Courbet53d35d22018-06-05 10:56:19 +0000126static BenchmarkResultContext
127getBenchmarkResultContext(const LLVMState &State) {
128 BenchmarkResultContext Ctx;
129
130 const llvm::MCInstrInfo &InstrInfo = State.getInstrInfo();
131 for (unsigned E = InstrInfo.getNumOpcodes(), I = 0; I < E; ++I)
132 Ctx.addInstrEntry(I, InstrInfo.getName(I).data());
133
134 const llvm::MCRegisterInfo &RegInfo = State.getRegInfo();
135 for (unsigned E = RegInfo.getNumRegs(), I = 0; I < E; ++I)
136 Ctx.addRegEntry(I, RegInfo.getName(I));
137
138 return Ctx;
139}
140
Clement Courbetd939f6d2018-09-13 07:40:53 +0000141// Generates code snippets for opcode `Opcode`.
Clement Courbet78b2e732018-09-25 07:31:44 +0000142static llvm::Expected<std::vector<BenchmarkCode>>
Clement Courbet79587352018-09-13 08:06:29 +0000143generateSnippets(const LLVMState &State, unsigned Opcode) {
Clement Courbetd939f6d2018-09-13 07:40:53 +0000144 const std::unique_ptr<SnippetGenerator> Generator =
145 State.getExegesisTarget().createSnippetGenerator(BenchmarkMode, State);
Clement Courbet78b2e732018-09-25 07:31:44 +0000146 if (!Generator)
Clement Courbetd939f6d2018-09-13 07:40:53 +0000147 llvm::report_fatal_error("cannot create snippet generator");
Clement Courbetd939f6d2018-09-13 07:40:53 +0000148
149 const llvm::MCInstrDesc &InstrDesc = State.getInstrInfo().get(Opcode);
150 // Ignore instructions that we cannot run.
151 if (InstrDesc.isPseudo())
152 return llvm::make_error<BenchmarkFailure>("Unsupported opcode: isPseudo");
153 if (InstrDesc.isBranch() || InstrDesc.isIndirectBranch())
154 return llvm::make_error<BenchmarkFailure>(
155 "Unsupported opcode: isBranch/isIndirectBranch");
156 if (InstrDesc.isCall() || InstrDesc.isReturn())
157 return llvm::make_error<BenchmarkFailure>(
158 "Unsupported opcode: isCall/isReturn");
159
160 return Generator->generateConfigurations(Opcode);
161}
162
Clement Courbet78b2e732018-09-25 07:31:44 +0000163namespace {
164
165// An MCStreamer that reads a BenchmarkCode definition from a file.
166// The BenchmarkCode definition is just an asm file, with additional comments to
167// specify which registers should be defined or are live on entry.
168class BenchmarkCodeStreamer : public llvm::MCStreamer,
169 public llvm::AsmCommentConsumer {
170public:
171 explicit BenchmarkCodeStreamer(llvm::MCContext *Context,
172 const llvm::MCRegisterInfo *TheRegInfo,
173 BenchmarkCode *Result)
174 : llvm::MCStreamer(*Context), RegInfo(TheRegInfo), Result(Result) {}
175
176 // Implementation of the llvm::MCStreamer interface. We only care about
177 // instructions.
178 void EmitInstruction(const llvm::MCInst &instruction,
179 const llvm::MCSubtargetInfo &mc_subtarget_info,
180 bool PrintSchedInfo) override {
181 Result->Instructions.push_back(instruction);
182 }
183
184 // Implementation of the llvm::AsmCommentConsumer.
185 void HandleComment(llvm::SMLoc Loc, llvm::StringRef CommentText) override {
186 CommentText = CommentText.trim();
187 if (!CommentText.consume_front("LLVM-EXEGESIS-"))
188 return;
189 if (CommentText.consume_front("DEFREG")) {
190 // LLVM-EXEGESIS-DEFREF <reg> <hex_value>
191 RegisterValue RegVal;
192 llvm::SmallVector<llvm::StringRef, 2> Parts;
193 CommentText.split(Parts, ' ', /*unlimited splits*/ -1,
194 /*do not keep empty strings*/ false);
195 if (Parts.size() != 2) {
196 llvm::errs() << "invalid comment 'LLVM-EXEGESIS-DEFREG " << CommentText
197 << "\n";
198 ++InvalidComments;
199 }
200 if (!(RegVal.Register = findRegisterByName(Parts[0].trim()))) {
201 llvm::errs() << "unknown register in 'LLVM-EXEGESIS-DEFREG "
202 << CommentText << "\n";
203 ++InvalidComments;
204 return;
205 }
206 const llvm::StringRef HexValue = Parts[1].trim();
207 RegVal.Value = llvm::APInt(
208 /* each hex digit is 4 bits */ HexValue.size() * 4, HexValue, 16);
209 Result->RegisterInitialValues.push_back(std::move(RegVal));
210 return;
211 }
212 if (CommentText.consume_front("LIVEIN")) {
213 // LLVM-EXEGESIS-LIVEIN <reg>
214 if (unsigned Reg = findRegisterByName(CommentText.ltrim()))
215 Result->LiveIns.push_back(Reg);
216 else {
217 llvm::errs() << "unknown register in 'LLVM-EXEGESIS-LIVEIN "
218 << CommentText << "\n";
219 ++InvalidComments;
220 }
221 return;
222 }
223 }
224
225 unsigned numInvalidComments() const { return InvalidComments; }
226
227private:
228 // We only care about instructions, we don't implement this part of the API.
229 void EmitCommonSymbol(llvm::MCSymbol *symbol, uint64_t size,
230 unsigned byte_alignment) override {}
231 bool EmitSymbolAttribute(llvm::MCSymbol *symbol,
232 llvm::MCSymbolAttr attribute) override {
233 return false;
234 }
235 void EmitValueToAlignment(unsigned byte_alignment, int64_t value,
236 unsigned value_size,
237 unsigned max_bytes_to_emit) override {}
238 void EmitZerofill(llvm::MCSection *section, llvm::MCSymbol *symbol,
239 uint64_t size, unsigned byte_alignment,
240 llvm::SMLoc Loc) override {}
241
242 unsigned findRegisterByName(const llvm::StringRef RegName) const {
243 // FIXME: Can we do better than this ?
244 for (unsigned I = 0, E = RegInfo->getNumRegs(); I < E; ++I) {
245 if (RegName == RegInfo->getName(I))
246 return I;
247 }
248 llvm::errs() << "'" << RegName
249 << "' is not a valid register name for the target\n";
250 return 0;
251 }
252
253 const llvm::MCRegisterInfo *const RegInfo;
254 BenchmarkCode *const Result;
255 unsigned InvalidComments = 0;
256};
257
258} // namespace
259
260// Reads code snippets from file `Filename`.
261static llvm::Expected<std::vector<BenchmarkCode>>
262readSnippets(const LLVMState &State, llvm::StringRef Filename) {
263 llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> BufferPtr =
264 llvm::MemoryBuffer::getFileOrSTDIN(Filename);
265 if (std::error_code EC = BufferPtr.getError()) {
266 return llvm::make_error<BenchmarkFailure>(
267 "cannot read snippet: " + Filename + ": " + EC.message());
268 }
269 llvm::SourceMgr SM;
270 SM.AddNewSourceBuffer(std::move(BufferPtr.get()), llvm::SMLoc());
271
272 BenchmarkCode Result;
273
274 llvm::MCObjectFileInfo ObjectFileInfo;
275 const llvm::TargetMachine &TM = State.getTargetMachine();
276 llvm::MCContext Context(TM.getMCAsmInfo(), TM.getMCRegisterInfo(),
277 &ObjectFileInfo);
278 ObjectFileInfo.InitMCObjectFileInfo(TM.getTargetTriple(), /*PIC*/ false,
279 Context);
280 BenchmarkCodeStreamer Streamer(&Context, TM.getMCRegisterInfo(), &Result);
281 const std::unique_ptr<llvm::MCAsmParser> AsmParser(
282 llvm::createMCAsmParser(SM, Context, Streamer, *TM.getMCAsmInfo()));
283 if (!AsmParser)
284 return llvm::make_error<BenchmarkFailure>("cannot create asm parser");
285 AsmParser->getLexer().setCommentConsumer(&Streamer);
286
287 const std::unique_ptr<llvm::MCTargetAsmParser> TargetAsmParser(
288 TM.getTarget().createMCAsmParser(*TM.getMCSubtargetInfo(), *AsmParser,
289 *TM.getMCInstrInfo(),
290 llvm::MCTargetOptions()));
291
292 if (!TargetAsmParser)
293 return llvm::make_error<BenchmarkFailure>(
294 "cannot create target asm parser");
295 AsmParser->setTargetParser(*TargetAsmParser);
296
297 if (AsmParser->Run(false))
298 return llvm::make_error<BenchmarkFailure>("cannot parse asm file");
299 if (Streamer.numInvalidComments())
300 return llvm::make_error<BenchmarkFailure>(
301 llvm::Twine("found ")
302 .concat(llvm::Twine(Streamer.numInvalidComments()))
303 .concat(" invalid LLVM-EXEGESIS comments"));
304 return std::vector<BenchmarkCode>{std::move(Result)};
305}
306
Clement Courbet37f0ca02018-05-15 12:08:00 +0000307void benchmarkMain() {
308 if (exegesis::pfm::pfmInitialize())
309 llvm::report_fatal_error("cannot initialize libpfm");
310
Clement Courbetac74acd2018-04-04 11:37:06 +0000311 llvm::InitializeNativeTarget();
312 llvm::InitializeNativeTargetAsmPrinter();
Clement Courbet78b2e732018-09-25 07:31:44 +0000313 llvm::InitializeNativeTargetAsmParser();
Clement Courbet44b4c542018-06-19 11:28:59 +0000314#ifdef LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET
315 LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET();
316#endif
Clement Courbetac74acd2018-04-04 11:37:06 +0000317
Clement Courbetac74acd2018-04-04 11:37:06 +0000318 const LLVMState State;
Clement Courbet78b2e732018-09-25 07:31:44 +0000319 const auto Opcode = getOpcodeOrDie(State.getInstrInfo());
Clement Courbete752fd62018-06-18 11:27:47 +0000320
Clement Courbet78b2e732018-09-25 07:31:44 +0000321 std::vector<BenchmarkCode> Configurations;
322 if (Opcode > 0) {
323 // Ignore instructions without a sched class if -ignore-invalid-sched-class
324 // is passed.
325 if (IgnoreInvalidSchedClass &&
326 State.getInstrInfo().get(Opcode).getSchedClass() == 0) {
327 llvm::errs() << "ignoring instruction without sched class\n";
328 return;
329 }
330 Configurations = ExitOnErr(generateSnippets(State, Opcode));
331 } else {
332 Configurations = ExitOnErr(readSnippets(State, SnippetsFile));
Clement Courbete752fd62018-06-18 11:27:47 +0000333 }
Clement Courbetac74acd2018-04-04 11:37:06 +0000334
Clement Courbet4860b982018-06-26 08:49:30 +0000335 const std::unique_ptr<BenchmarkRunner> Runner =
336 State.getExegesisTarget().createBenchmarkRunner(BenchmarkMode, State);
337 if (!Runner) {
338 llvm::report_fatal_error("cannot create benchmark runner");
Clement Courbetac74acd2018-04-04 11:37:06 +0000339 }
340
Clement Courbet0e69e2d2018-05-17 10:52:18 +0000341 if (NumRepetitions == 0)
342 llvm::report_fatal_error("--num-repetitions must be greater than zero");
343
Guillaume Chatelet8c91d4c2018-06-07 07:51:16 +0000344 // Write to standard output if file is not set.
345 if (BenchmarkFile.empty())
346 BenchmarkFile = "-";
347
Guillaume Chateletb4f15822018-06-07 14:00:29 +0000348 const BenchmarkResultContext Context = getBenchmarkResultContext(State);
Guillaume Chateletb4f15822018-06-07 14:00:29 +0000349
Clement Courbetd939f6d2018-09-13 07:40:53 +0000350 for (const BenchmarkCode &Conf : Configurations) {
351 InstructionBenchmark Result =
352 Runner->runConfiguration(Conf, NumRepetitions);
353 ExitOnErr(Result.writeYaml(Context, BenchmarkFile));
354 }
Clement Courbet37f0ca02018-05-15 12:08:00 +0000355 exegesis::pfm::pfmTerminate();
356}
357
Clement Courbetcf210742018-05-17 13:41:28 +0000358// Prints the results of running analysis pass `Pass` to file `OutputFilename`
359// if OutputFilename is non-empty.
360template <typename Pass>
361static void maybeRunAnalysis(const Analysis &Analyzer, const std::string &Name,
Clement Courbet53d35d22018-06-05 10:56:19 +0000362 const std::string &OutputFilename) {
Clement Courbetcf210742018-05-17 13:41:28 +0000363 if (OutputFilename.empty())
364 return;
365 if (OutputFilename != "-") {
366 llvm::errs() << "Printing " << Name << " results to file '"
367 << OutputFilename << "'\n";
368 }
369 std::error_code ErrorCode;
370 llvm::raw_fd_ostream ClustersOS(OutputFilename, ErrorCode,
Zachary Turner1f67a3c2018-06-07 19:58:58 +0000371 llvm::sys::fs::FA_Read |
372 llvm::sys::fs::FA_Write);
373 if (ErrorCode)
374 llvm::report_fatal_error("cannot open out file: " + OutputFilename);
375 if (auto Err = Analyzer.run<Pass>(ClustersOS))
376 llvm::report_fatal_error(std::move(Err));
Clement Courbetcf210742018-05-17 13:41:28 +0000377}
378
379static void analysisMain() {
Guillaume Chatelet8c91d4c2018-06-07 07:51:16 +0000380 if (BenchmarkFile.empty())
381 llvm::report_fatal_error("--benchmarks-file must be set.");
382
Clement Courbet53d35d22018-06-05 10:56:19 +0000383 llvm::InitializeNativeTarget();
384 llvm::InitializeNativeTargetAsmPrinter();
Clement Courbet4273e1e2018-06-15 07:30:45 +0000385 llvm::InitializeNativeTargetDisassembler();
Clement Courbet37f0ca02018-05-15 12:08:00 +0000386 // Read benchmarks.
Clement Courbet53d35d22018-06-05 10:56:19 +0000387 const LLVMState State;
Clement Courbet37f0ca02018-05-15 12:08:00 +0000388 const std::vector<InstructionBenchmark> Points =
Guillaume Chatelet8c91d4c2018-06-07 07:51:16 +0000389 ExitOnErr(InstructionBenchmark::readYamls(
390 getBenchmarkResultContext(State), BenchmarkFile));
Clement Courbet37f0ca02018-05-15 12:08:00 +0000391 llvm::outs() << "Parsed " << Points.size() << " benchmark points\n";
392 if (Points.empty()) {
393 llvm::errs() << "no benchmarks to analyze\n";
394 return;
395 }
396 // FIXME: Check that all points have the same triple/cpu.
397 // FIXME: Merge points from several runs (latency and uops).
398
Clement Courbet37f0ca02018-05-15 12:08:00 +0000399 std::string Error;
400 const auto *TheTarget =
401 llvm::TargetRegistry::lookupTarget(Points[0].LLVMTriple, Error);
402 if (!TheTarget) {
403 llvm::errs() << "unknown target '" << Points[0].LLVMTriple << "'\n";
404 return;
405 }
Guillaume Chatelet64165922018-06-11 09:18:01 +0000406 const auto Clustering = ExitOnErr(InstructionBenchmarkClustering::create(
Clement Courbet37f0ca02018-05-15 12:08:00 +0000407 Points, AnalysisNumPoints, AnalysisEpsilon));
Clement Courbet6d6c1a92018-05-16 08:47:21 +0000408
409 const Analysis Analyzer(*TheTarget, Clustering);
410
Clement Courbetcf210742018-05-17 13:41:28 +0000411 maybeRunAnalysis<Analysis::PrintClusters>(Analyzer, "analysis clusters",
412 AnalysisClustersOutputFile);
413 maybeRunAnalysis<Analysis::PrintSchedClassInconsistencies>(
414 Analyzer, "sched class consistency analysis",
415 AnalysisInconsistenciesOutputFile);
Clement Courbetac74acd2018-04-04 11:37:06 +0000416}
417
418} // namespace exegesis
419
420int main(int Argc, char **Argv) {
421 llvm::cl::ParseCommandLineOptions(Argc, Argv, "");
422
Guillaume Chatelet64165922018-06-11 09:18:01 +0000423 exegesis::ExitOnErr.setExitCodeMapper([](const llvm::Error &Err) {
424 if (Err.isA<llvm::StringError>())
425 return EXIT_SUCCESS;
426 return EXIT_FAILURE;
427 });
428
Clement Courbet4860b982018-06-26 08:49:30 +0000429 if (BenchmarkMode == exegesis::InstructionBenchmark::Unknown) {
Clement Courbet37f0ca02018-05-15 12:08:00 +0000430 exegesis::analysisMain();
431 } else {
432 exegesis::benchmarkMain();
Clement Courbetac74acd2018-04-04 11:37:06 +0000433 }
Clement Courbetac74acd2018-04-04 11:37:06 +0000434 return EXIT_SUCCESS;
435}