diff options
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp')
-rw-r--r-- | llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp index 1536e8a5624..c2e57819bb4 100644 --- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp @@ -35,6 +35,8 @@ BenchmarkRunner::~BenchmarkRunner() = default; // code. static std::vector<llvm::MCInst> GenerateInstructions(const BenchmarkCode &BC, const size_t MinInstructions) { + if (BC.Instructions.empty()) + return {}; std::vector<llvm::MCInst> Code = BC.Instructions; for (int I = 0; Code.size() < MinInstructions; ++I) Code.push_back(BC.Instructions[I % BC.Instructions.size()]); @@ -53,10 +55,6 @@ BenchmarkRunner::runConfiguration(const BenchmarkCode &BC, InstrBenchmark.Info = BC.Info; const std::vector<llvm::MCInst> &Instructions = BC.Instructions; - if (Instructions.empty()) { - InstrBenchmark.Error = "Empty snippet"; - return InstrBenchmark; - } InstrBenchmark.Key.Instructions = Instructions; |