[all-commits] [llvm/llvm-project] 7ffcbc: [llvm-exegesis] Skip benchmark entries with unknow...
Lawson Darrow via All-commits
all-commits at lists.llvm.org
Thu Jun 11 09:19:00 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7ffcbc27ea719531e8bda54fa1b0aca5c8a7e095
https://github.com/llvm/llvm-project/commit/7ffcbc27ea719531e8bda54fa1b0aca5c8a7e095
Author: Lawson Darrow <103522304+Lawson-Darrow at users.noreply.github.com>
Date: 2026-06-11 (Thu, 11 Jun 2026)
Changed paths:
A llvm/test/tools/llvm-exegesis/X86/analysis-malformed-yaml-error.test
A llvm/test/tools/llvm-exegesis/X86/analysis-skip-unknown-opcode.test
M llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
M llvm/tools/llvm-exegesis/lib/BenchmarkResult.h
Log Message:
-----------
[llvm-exegesis] Skip benchmark entries with unknown opcodes in analysis mode (#201162)
Fixes #144403
`llvm-exegesis -mode=analysis` currently aborts the whole run if any
entry references an unknown opcode (e.g. an old sample whose instruction
was since renamed). A single bitrotted entry discards the results for
every valid one:
```
uops-test.yaml:5:7: error: No opcode with name 'VADDPDYrrr'
llvm-exegesis: 'uops-test.yaml': invalid argument
```
This adds an opt-in `SkipInvalidEntries` parameter to
`Benchmark::readYamls`. When set, the `YamlContext` records recoverable
per-entry deserialization errors (e.g. an unknown opcode or register)
instead of returning them from `ScalarTraits::input` to the YAML parser,
which would otherwise poison the stream and stop parsing. `readYamls`
then inspects the recorded error after each document, warns about the
offending entry, drops it, and continues with the rest. The default
stays `false`, preserving the existing strict behavior for all other
callers; analysis mode passes `true`.
For example, a file with one bitrotted entry and one valid entry now
produces:
```
warning: skipping benchmark entry: No opcode with name 'NOT_A_REAL_OPCODE'
warning: skipped 1 benchmark entries that could not be parsed
Parsed 1 benchmark points
```
Tests:
- Unit test in `BenchmarkResultTest.cpp` covering both strict (errors)
and skip (drops the bad entry, keeps the valid one) behavior.
- A lit test exercising analysis mode end-to-end: a file with one
unknown-opcode entry plus one valid entry still produces clusters output
and emits the warning.
The "did you mean '<nearest>'?" opcode suggestion mentioned in the issue
(via `OptTable::findNearest`) is left as a follow-up.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list