[all-commits] [llvm/llvm-project] c02e5d: [MLIR] Drain remarks in RemarkEmittingPolicyFinal:...
Henrich Lauko via All-commits
all-commits at lists.llvm.org
Fri Sep 18 05:55:05 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c02e5de301c6cb20ba5d0942b71ad8c2b412fb99
https://github.com/llvm/llvm-project/commit/c02e5de301c6cb20ba5d0942b71ad8c2b412fb99
Author: Henrich Lauko <xlauko at mail.muni.cz>
Date: 2026-09-18 (Fri, 18 Sep 2026)
Changed paths:
M mlir/docs/Remarks.md
M mlir/include/mlir/IR/Remarks.h
M mlir/lib/IR/Remarks.cpp
M mlir/test/Pass/remark-final.mlir
M mlir/unittests/IR/RemarkTest.cpp
Log Message:
-----------
[MLIR] Drain remarks in RemarkEmittingPolicyFinal::finalize() (#224607)
`RemarkEmittingPolicyFinal::finalize()` iterates `postponedRemarks`
without clearing it. `MlirOptMain` calls `finalize()` after printing the
module, and `~RemarkEngine` calls it again when the context is
destroyed, so a YAML or bitstream streamer serializes every remark
twice. With `mlir/test/Pass/remark-final.mlir` the YAML output file
holds 10 records for 5 remarks. The console path hides this because the
diagnostic handler is already gone when the destructor runs.
This change swaps the pending set into a local before emitting. A second
`finalize()` then emits only the remarks reported since the first one. A
consequence worth stating: a `RelatedTo` link resolves only between
remarks drained by the same call. Both behaviours are documented in the
header comment and in `Remarks.md`.
A follow-up will make the emission order of the final policy
deterministic; today it is `DenseSet` iteration order, which is why the
lit test keeps `CHECK-DAG`.
Assisted-by: Claude Code (Claude Fable 5.1). I read and reviewed the
change before opening it.
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