[all-commits] [llvm/llvm-project] fe7883: [MLIR][Remark] Move reported remarks into the policy

Henrich Lauko via All-commits all-commits at lists.llvm.org
Wed Sep 30 06:04:56 PDT 2026


  Branch: refs/heads/users/xlauko/mlir-remark-move-report
  Home:   https://github.com/llvm/llvm-project
  Commit: fe78836c40af3ef7003f0aad737bb346f0f89347
      https://github.com/llvm/llvm-project/commit/fe78836c40af3ef7003f0aad737bb346f0f89347
  Author: Henrich Lauko <hlauko at nvidia.com>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    M mlir/include/mlir/IR/Remarks.h
    M mlir/lib/IR/Remarks.cpp

  Log Message:
  -----------
  [MLIR][Remark] Move reported remarks into the policy

RemarkEngine::report took a const rvalue reference, so the std::move in
InFlightRemark's destructor never moved anything and the policy received
a const reference. RemarkEmittingPolicyFinal then copied the whole Remark,
its strings and argument vector included, into its DenseSet on every
report, and since the engine lock was added it did so inside the critical
section.

Take the remark by non-const rvalue reference in report() and
reportRemark(), and move it into the final policy's set. The in-flight
remark owns the object and destroys it right after reporting, so nothing
observes the moved-from state. Emitted output is unchanged. Out-of-tree
policies need to change their reportRemark signature to Remark &&.

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