[llvm-exegesis] Ignore double spaced separators in asm strings
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 10 Sep 2018 10:45:04 +0000 (10:45 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 10 Sep 2018 10:45:04 +0000 (10:45 +0000)
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'

llvm-svn: 341799

llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp

index 33ad650..77adb2f 100644 (file)
@@ -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;