[llvm] r341799 - [llvm-exegesis] Ignore double spaced separators in asm strings

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 10 03:45:04 PDT 2018


Author: rksimon
Date: Mon Sep 10 03:45:04 2018
New Revision: 341799

URL: http://llvm.org/viewvc/llvm-project?rev=341799&view=rev
Log:
[llvm-exegesis] Ignore double spaced separators in asm strings

Some asm has double spaces between operands, the deserializer was keeping these empty split pieces, causing assertions later on:

'ADC16mi RDI i_0x1x  i_0x0x  i_0x1x'

Modified:
    llvm/trunk/tools/llvm-exegesis/lib/BenchmarkResult.cpp

Modified: llvm/trunk/tools/llvm-exegesis/lib/BenchmarkResult.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/BenchmarkResult.cpp?rev=341799&r1=341798&r2=341799&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/BenchmarkResult.cpp (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/BenchmarkResult.cpp Mon Sep 10 03:45:04 2018
@@ -60,7 +60,7 @@ static llvm::StringRef
 deserialize(const exegesis::BenchmarkResultContext &Context,
             llvm::StringRef String, llvm::MCInst &Value) {
   llvm::SmallVector<llvm::StringRef, 8> Pieces;
-  String.split(Pieces, " ");
+  String.split(Pieces, " ", /* MaxSplit */ -1, /* KeepEmpty */ false);
   if (Pieces.empty())
     return "Invalid Instruction";
   bool ProcessOpcode = true;




More information about the llvm-commits mailing list