[all-commits] [llvm/llvm-project] 66bf25: [MLIR] Implement remark emitting policies in MLIR ...

Guray Ozen via All-commits all-commits at lists.llvm.org
Tue Oct 14 08:56:39 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 66bf252707d79be4bb1d61e1b2ff6dc71a4ccced
      https://github.com/llvm/llvm-project/commit/66bf252707d79be4bb1d61e1b2ff6dc71a4ccced
  Author: Guray Ozen <guray.ozen at gmail.com>
  Date:   2025-10-14 (Tue, 14 Oct 2025)

  Changed paths:
    M mlir/include/mlir/IR/Remarks.h
    M mlir/include/mlir/Remark/RemarkStreamer.h
    M mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/IR/Remarks.cpp
    M mlir/lib/Remark/RemarkStreamer.cpp
    M mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
    A mlir/test/Pass/remark-final.mlir
    M mlir/test/lib/Pass/TestRemarksPass.cpp
    M mlir/unittests/IR/RemarkTest.cpp

  Log Message:
  -----------
  [MLIR] Implement remark emitting policies in MLIR (#161202)

This update introduces two new remark emitting policies:
1. `RemarkEmittingPolicyAll`, which emits all remarks,
2. `RemarkEmittingPolicyFinal`, which only emits final remarks after
processing.

The `RemarkEngine` is modified to support these policies, allowing for
more flexible remark handling based on user configuration.

PR also adds flag to `mlir-opt`
```
  --remark-policy=<value>                                    - Specify the policy for remark output.
    =all                                                     -   Print all remarks
    =final                                                   -   Print final remarks
```

Relanding https://github.com/llvm/llvm-project/pull/160526

This PR requires RemarkEngine to be finalize manually. So here is usage:
```
MLIRContext ctx;
ctx.setRemarkEngine(...)
...
ctx.getRemarkEngine().shutdown() <-- PR adds this, it is required when the emission policy is final
```



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