[all-commits] [llvm/llvm-project] eefef4: [MLIR][Remark] Drain remarks in RemarkEmittingPoli...

Henrich Lauko via All-commits all-commits at lists.llvm.org
Fri Sep 18 05:19:58 PDT 2026


  Branch: refs/heads/users/xlauko/mlir-remark-final-drain
  Home:   https://github.com/llvm/llvm-project
  Commit: eefef406becd6d73574b58a60ec2ec783dbc47b0
      https://github.com/llvm/llvm-project/commit/eefef406becd6d73574b58a60ec2ec783dbc47b0
  Author: Henrich Lauko <hlauko at nvidia.com>
  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][Remark] Drain remarks in RemarkEmittingPolicyFinal::finalize()

RemarkEmittingPolicyFinal::finalize() iterated 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 serialized every remark twice. With
mlir/test/Pass/remark-final.mlir the YAML file held 10 records for 5
remarks. The console path hid the duplicates because the diagnostic
handler is gone by the time the destructor runs.

Swap the pending set into a local before emitting. A second call then
emits only remarks reported since the first, and a RelatedTo link
resolves only between remarks drained by the same call. Both are
documented in the header and in Remarks.md and covered by unit tests.
The lit test now pins the record count with --implicit-check-not.

The drain was first applied downstream by Jhalak Patel.

Assisted-by: Claude Code (Claude Fable 5.1)



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