[llvm] [llvm-exegesis] Skip benchmark entries with unknown opcodes in analysis mode (PR #201162)

Lawson Darrow via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 07:27:42 PDT 2026


================
@@ -63,8 +64,22 @@ struct YamlContext {
 
   std::string &getLastError() { return ErrorStream.str(); }
 
+  // Returns the recorded error to report to the YAML parser from a
+  // ScalarTraits::input. When ContinueOnError is set, recoverable per-entry
+  // errors (e.g. an unknown opcode in a bitrotted sample) are left recorded for
+  // the caller to inspect but are not reported to the parser, which would
+  // otherwise abort parsing of every remaining document.
+  StringRef getInputError() {
+    return ContinueOnError ? StringRef() : StringRef(getLastError());
+  }
+
   raw_string_ostream &getErrorStream() { return ErrorStream; }
 
+  // When set, ScalarTraits::input swallows recoverable deserialization errors
+  // (see getInputError) so that readYamls can skip the offending entry instead
+  // of aborting the whole file.
+  bool ContinueOnError = false;
----------------
Lawson-Darrow wrote:

Yes! The false default is still used. 

readYaml() (singular) keeps the pre-existing strict behavior and is still exercised by the X86 and Mips BenchmarkResult unit tests and readYamlFrom() also keeps the strict default. Only readYamls() opts into ContinueOnError = true to skip recoverable perentry errors in analysis mode.

https://github.com/llvm/llvm-project/pull/201162


More information about the llvm-commits mailing list