[Mlir-commits] [mlir] [MLIR] Introduce RemarkEngine + pluggable remark streaming (YAML/Bitstream) (PR #152474)
Razvan Lupusoru
llvmlistbot at llvm.org
Fri Aug 15 14:09:05 PDT 2025
================
@@ -0,0 +1,467 @@
+//===- Remarks.h - MLIR Optimization Remark ----------------------*- C++-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines utilities for emitting optimization remarks.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_IR_REMARKS_H
+#define MLIR_IR_REMARKS_H
+
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/IR/DiagnosticInfo.h"
+#include "llvm/Remarks/Remark.h"
+#include "llvm/Support/FormatVariadic.h"
+#include "llvm/Support/Regex.h"
+#include <optional>
+
+#include "mlir/IR/Diagnostics.h"
+#include "mlir/IR/MLIRContext.h"
+#include "mlir/IR/Value.h"
+
+namespace mlir::remark {
+/// Define an the set of categories to accept. By default none are, the provided
+/// regex matches against the category names for each kind of remark.
+struct RemarkCategories {
+ std::optional<std::string> passed, missed, analysis, failed;
+};
+
+/// Categories describe the outcome of an optimization, not the mechanics of
+/// emitting/serializing remarks.
+enum class RemarkKind {
+ OptimizationRemarkUnknown = 0,
+
+ /// An optimization was applied.
+ OptimizationRemarkPassed,
----------------
razvanlupusoru wrote:
Do you prefer the Optimization prefix? It seems adequate to simply name these: Passed, Missed, Failure, Analysis. And I prefer without "Optimization" since I want it to capture all relevant compiler transformations.
https://github.com/llvm/llvm-project/pull/152474
More information about the Mlir-commits
mailing list