[llvm] [RISCV][MC] Prioritize features in MultiMismatchFallback (PR #215737)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 16 22:45:29 PDT 2026
================
@@ -1866,6 +1866,15 @@ class AsmParser {
// messages.
bit ReportMultipleNearMisses = false;
+ // PrioritizeFeatureInMultipleNearMisses -
+ // When 0, operand near-misses and feature near-misses are treated equally
+ // in the multiple near-miss reporting path.
+ // When 1, feature near-misses are prioritized over operand near-misses
+ // when multiple near-misses are recorded for the same instruction encoding,
+ // so that diagnostics point to the missing extension rather than a operand
+ // mismatch. Only effective when ReportMultipleNearMisses is also 1.
+ bit PrioritizeFeatureInMultipleNearMisses = false;
----------------
saloni-shinde-Q wrote:
Thanks for the feedback. I think the current comment might be misleading. The purpose of this change is to improve the diagnostic selected in the MultiMismatchFallback path, rather than to change the handling of ordinary multiple near-misses.
Previously, when an instruction had multiple operand mismatches and no regular near-miss was available, the first operand mismatch was saved in MultiMismatchFallback and reported. With this change, if a feature mismatch is also recorded, the feature mismatch is prioritized over the first operand mismatch. Thus, even when multiple operand mismatches are present, the diagnostic reports the missing feature instead of an operand mismatch.
I’ll update the comment to describe the MultiMismatchFallback behavior more accurately. Does this purpose and behavior sound reasonable to you?
https://github.com/llvm/llvm-project/pull/215737
More information about the llvm-commits
mailing list