Skip to content

Conversation

grypp
Copy link
Member

@grypp grypp commented Sep 4, 2025

Adds remark flags to mlir-opt:

Remark Options:
Filter remarks by regular expression (llvm::Regex syntax).

  --remark-format=<value>                                    - Specify the format for remark output.
    =emitRemark                                              -   Print as emitRemark to command-line
    =yaml                                                    -   Print yaml file
    =bitstream                                               -   Print bitstream file
  --remarks-filter=<string>                                  - Show all remarks: passed, missed, failed, analysis
  --remarks-filter-analyse=<string>                          - Show analysis remarks
  --remarks-filter-failed=<string>                           - Show failed remarks
  --remarks-filter-missed=<string>                           - Show missed remarks
  --remarks-filter-passed=<string>                           - Show passed remarks
  --remarks-output-file=<string>                             - Output file for yaml and bitstream remark formats. Default is mlir-remarks.yaml or mlir-remarks.bitstream

@grypp grypp requested a review from joker-eph September 4, 2025 08:27
@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Sep 4, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 4, 2025

@llvm/pr-subscribers-mlir-core

Author: Guray Ozen (grypp)

Changes

Adds remark flags to mlir-opt:

Remark Options:
Filter remarks by regular expression (llvm::Regex syntax).

  --remark-format=&lt;value&gt;                                    - Specify the format for remark output.
    =emitRemark                                              -   Print as emitRemark to command-line
    =yaml                                                    -   Print yaml file
    =bitstream                                               -   Print bitstream file
  --remarks-analyse=&lt;string&gt;                                 - Show analysis remarks
  --remarks-failed=&lt;string&gt;                                  - Show failed remarks
  --remarks-missed=&lt;string&gt;                                  - Show missed remarks
  --remarks-passed=&lt;string&gt;                                  - Show passed remarks

Full diff: https://github.com/llvm/llvm-project/pull/156825.diff

4 Files Affected:

  • (modified) mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h (+22)
  • (modified) mlir/lib/Tools/mlir-opt/CMakeLists.txt (+1)
  • (modified) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp (+79-9)
  • (modified) mlir/unittests/IR/CMakeLists.txt (+1-1)
diff --git a/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
index 94231227599c9..dc6a6a1c3cc42 100644
--- a/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
+++ b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
@@ -38,6 +38,12 @@ enum class VerbosityLevel {
   ErrorsWarningsAndRemarks
 };
 
+using RemarkFormat = enum {
+  REMARK_FORMAT_STDOUT,
+  REMARK_FORMAT_YAML,
+  REMARK_FORMAT_BITSTREAM,
+};
+
 /// Configuration options for the mlir-opt tool.
 /// This is intended to help building tools like mlir-opt by collecting the
 /// supported options.
@@ -221,9 +227,25 @@ class MlirOptMainConfig {
   }
   bool shouldVerifyRoundtrip() const { return verifyRoundtripFlag; }
 
+  /// Checks if any remark filters are set.
+  bool shouldEmitRemarks() const {
+    // Emit all remarks only when no filters are specified.
+    const bool hasFilters =
+        !remarksPassedFlag.empty() || !remarksFailedFlag.empty() ||
+        !remarksMissedFlag.empty() || !remarksAnalyseFlag.empty();
+    return hasFilters;
+  }
+
   /// Reproducer file generation (no crash required).
   StringRef getReproducerFilename() const { return generateReproducerFileFlag; }
 
+  /// Remark options
+  RemarkFormat remarkFormatFlag;
+  std::string remarksPassedFlag = "";
+  std::string remarksFailedFlag = "";
+  std::string remarksMissedFlag = "";
+  std::string remarksAnalyseFlag = "";
+
 protected:
   /// Allow operation with no registered dialects.
   /// This option is for convenience during testing only and discouraged in
diff --git a/mlir/lib/Tools/mlir-opt/CMakeLists.txt b/mlir/lib/Tools/mlir-opt/CMakeLists.txt
index f24d4c60174ee..858c9c1f97f9c 100644
--- a/mlir/lib/Tools/mlir-opt/CMakeLists.txt
+++ b/mlir/lib/Tools/mlir-opt/CMakeLists.txt
@@ -13,4 +13,5 @@ add_mlir_library(MLIROptLib
   MLIRPluginsLib
   MLIRSupport
   MLIRIRDL
+  MLIRRemarkStreamer
   )
diff --git a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
index de714d8b740af..c456540cc1793 100644
--- a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
+++ b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
@@ -23,9 +23,11 @@
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Location.h"
 #include "mlir/IR/MLIRContext.h"
+#include "mlir/IR/Remarks.h"
 #include "mlir/Parser/Parser.h"
 #include "mlir/Pass/PassManager.h"
 #include "mlir/Pass/PassRegistry.h"
+#include "mlir/Remark/RemarkStreamer.h"
 #include "mlir/Support/FileUtilities.h"
 #include "mlir/Support/Timing.h"
 #include "mlir/Support/ToolUtilities.h"
@@ -33,6 +35,7 @@
 #include "mlir/Tools/Plugins/DialectPlugin.h"
 #include "mlir/Tools/Plugins/PassPlugin.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Remarks/RemarkFormat.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/LogicalResult.h"
@@ -204,6 +207,41 @@ struct MlirOptMainConfigCLOptions : public MlirOptMainConfig {
             cl::location(generateReproducerFileFlag), cl::init(""),
             cl::value_desc("filename"));
 
+    static cl::OptionCategory remarkCategory(
+        "Remark Options",
+        "Filter remarks by regular expression (llvm::Regex syntax).");
+
+    static llvm::cl::opt<RemarkFormat, /*ExternalStorage=*/true> remarkFormat{
+        "remark-format",
+        llvm::cl::desc("Specify the format for remark output."),
+        cl::location(remarkFormatFlag),
+        llvm::cl::value_desc("format"),
+        llvm::cl::init(REMARK_FORMAT_STDOUT),
+        llvm::cl::values(
+            clEnumValN(REMARK_FORMAT_STDOUT, "emitRemark",
+                       "Print as emitRemark to command-line"),
+            clEnumValN(REMARK_FORMAT_YAML, "yaml", "Print yaml file"),
+            clEnumValN(REMARK_FORMAT_BITSTREAM, "bitstream",
+                       "Print bitstream file")),
+        llvm::cl::cat(remarkCategory)};
+
+    static cl::opt<std::string, /*ExternalStorage=*/true> remarksPassed(
+        "remarks-passed", cl::desc("Show passed remarks"),
+        cl::location(remarksPassedFlag), cl::init(""), cl::cat(remarkCategory));
+
+    static cl::opt<std::string, /*ExternalStorage=*/true> remarksFailed(
+        "remarks-failed", cl::desc("Show failed remarks"),
+        cl::location(remarksFailedFlag), cl::init(""), cl::cat(remarkCategory));
+
+    static cl::opt<std::string, /*ExternalStorage=*/true> remarksMissed(
+        "remarks-missed", cl::desc("Show missed remarks"),
+        cl::location(remarksMissedFlag), cl::init(""), cl::cat(remarkCategory));
+
+    static cl::opt<std::string, /*ExternalStorage=*/true> remarksAnalyse(
+        "remarks-analyse", cl::desc("Show analysis remarks"),
+        cl::location(remarksAnalyseFlag), cl::init(""),
+        cl::cat(remarkCategory));
+
     /// Set the callback to load a pass plugin.
     passPlugins.setCallback([&](const std::string &pluginPath) {
       auto plugin = PassPlugin::load(pluginPath);
@@ -241,23 +279,23 @@ class DiagnosticFilter : public ScopedDiagnosticHandler {
     setHandler([verbosityLevel, showNotes](Diagnostic &diag) {
       auto severity = diag.getSeverity();
       switch (severity) {
-      case DiagnosticSeverity::Error:
+      case mlir::DiagnosticSeverity::Error:
         // failure indicates that the error is not handled by the filter and
         // goes through to the default handler. Therefore, the error can be
         // successfully printed.
         return failure();
-      case DiagnosticSeverity::Warning:
+      case mlir::DiagnosticSeverity::Warning:
         if (verbosityLevel == VerbosityLevel::ErrorsOnly)
           return success();
         else
           return failure();
-      case DiagnosticSeverity::Remark:
+      case mlir::DiagnosticSeverity::Remark:
         if (verbosityLevel == VerbosityLevel::ErrorsOnly ||
             verbosityLevel == VerbosityLevel::ErrorsAndWarnings)
           return success();
         else
           return failure();
-      case DiagnosticSeverity::Note:
+      case mlir::DiagnosticSeverity::Note:
         if (showNotes)
           return failure();
         else
@@ -462,6 +500,38 @@ performActions(raw_ostream &os,
 
   context->enableMultithreading(wasThreadingEnabled);
 
+  // Set up optimization remarks.
+  if (config.shouldEmitRemarks()) {
+    remark::RemarkCategories cats{
+        config.remarksPassedFlag, config.remarksFailedFlag,
+        config.remarksMissedFlag, config.remarksAnalyseFlag};
+
+    mlir::MLIRContext &ctx = *context;
+
+    switch (config.remarkFormatFlag) {
+    case REMARK_FORMAT_STDOUT:
+      if (failed(mlir::remark::enableOptimizationRemarks(ctx, nullptr, cats)))
+        return failure();
+      break;
+
+    case REMARK_FORMAT_YAML: {
+      constexpr llvm::StringLiteral file{"mlir-remarks.yaml"};
+      if (failed(mlir::remark::enableOptimizationRemarksWithLLVMStreamer(
+              ctx, file, llvm::remarks::Format::YAML, cats)))
+        return failure();
+      break;
+    }
+
+    case REMARK_FORMAT_BITSTREAM: {
+      constexpr llvm::StringLiteral File{"mlir-remarks.bitstream"};
+      if (failed(mlir::remark::enableOptimizationRemarksWithLLVMStreamer(
+              ctx, File, llvm::remarks::Format::Bitstream, cats)))
+        return failure();
+      break;
+    }
+    }
+  }
+
   // Prepare the pass manager, applying command-line and reproducer options.
   PassManager pm(op.get()->getName(), PassManager::Nesting::Implicit);
   pm.enableVerifier(config.shouldVerifyPasses());
@@ -523,8 +593,8 @@ processBuffer(raw_ostream &os, std::unique_ptr<MemoryBuffer> ownedBuffer,
       SMLoc());
   sourceMgr->AddNewSourceBuffer(std::move(ownedBuffer), SMLoc());
 
-  // Create a context just for the current buffer. Disable threading on creation
-  // since we'll inject the thread-pool separately.
+  // Create a context just for the current buffer. Disable threading on
+  // creation since we'll inject the thread-pool separately.
   MLIRContext context(registry, MLIRContext::Threading::DISABLED);
   if (threadPool)
     context.setThreadPool(*threadPool);
@@ -669,9 +739,9 @@ LogicalResult mlir::MlirOptMain(int argc, char **argv,
   if (config.shouldListPasses())
     return printRegisteredPassesAndReturn();
 
-  // When reading from stdin and the input is a tty, it is often a user mistake
-  // and the process "appears to be stuck". Print a message to let the user know
-  // about it!
+  // When reading from stdin and the input is a tty, it is often a user
+  // mistake and the process "appears to be stuck". Print a message to let the
+  // user know about it!
   if (inputFilename == "-" &&
       sys::Process::FileDescriptorIsDisplayed(fileno(stdin)))
     llvm::errs() << "(processing input from stdin now, hit ctrl-c/ctrl-d to "
diff --git a/mlir/unittests/IR/CMakeLists.txt b/mlir/unittests/IR/CMakeLists.txt
index 75cd2d65ef5a1..dd3b110dcd295 100644
--- a/mlir/unittests/IR/CMakeLists.txt
+++ b/mlir/unittests/IR/CMakeLists.txt
@@ -14,7 +14,7 @@ add_mlir_unittest(MLIRIRTests
   MemrefLayoutTest.cpp
   OperationSupportTest.cpp
   PatternMatchTest.cpp
-  RemarkTest.cpp
+  RemarkTest.cpp  
   ShapedTypeTest.cpp
   SymbolTableTest.cpp
   TypeTest.cpp

@llvmbot
Copy link
Member

llvmbot commented Sep 4, 2025

@llvm/pr-subscribers-mlir

Author: Guray Ozen (grypp)

Changes

Adds remark flags to mlir-opt:

Remark Options:
Filter remarks by regular expression (llvm::Regex syntax).

  --remark-format=&lt;value&gt;                                    - Specify the format for remark output.
    =emitRemark                                              -   Print as emitRemark to command-line
    =yaml                                                    -   Print yaml file
    =bitstream                                               -   Print bitstream file
  --remarks-analyse=&lt;string&gt;                                 - Show analysis remarks
  --remarks-failed=&lt;string&gt;                                  - Show failed remarks
  --remarks-missed=&lt;string&gt;                                  - Show missed remarks
  --remarks-passed=&lt;string&gt;                                  - Show passed remarks

Full diff: https://github.com/llvm/llvm-project/pull/156825.diff

4 Files Affected:

  • (modified) mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h (+22)
  • (modified) mlir/lib/Tools/mlir-opt/CMakeLists.txt (+1)
  • (modified) mlir/lib/Tools/mlir-opt/MlirOptMain.cpp (+79-9)
  • (modified) mlir/unittests/IR/CMakeLists.txt (+1-1)
diff --git a/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
index 94231227599c9..dc6a6a1c3cc42 100644
--- a/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
+++ b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
@@ -38,6 +38,12 @@ enum class VerbosityLevel {
   ErrorsWarningsAndRemarks
 };
 
+using RemarkFormat = enum {
+  REMARK_FORMAT_STDOUT,
+  REMARK_FORMAT_YAML,
+  REMARK_FORMAT_BITSTREAM,
+};
+
 /// Configuration options for the mlir-opt tool.
 /// This is intended to help building tools like mlir-opt by collecting the
 /// supported options.
@@ -221,9 +227,25 @@ class MlirOptMainConfig {
   }
   bool shouldVerifyRoundtrip() const { return verifyRoundtripFlag; }
 
+  /// Checks if any remark filters are set.
+  bool shouldEmitRemarks() const {
+    // Emit all remarks only when no filters are specified.
+    const bool hasFilters =
+        !remarksPassedFlag.empty() || !remarksFailedFlag.empty() ||
+        !remarksMissedFlag.empty() || !remarksAnalyseFlag.empty();
+    return hasFilters;
+  }
+
   /// Reproducer file generation (no crash required).
   StringRef getReproducerFilename() const { return generateReproducerFileFlag; }
 
+  /// Remark options
+  RemarkFormat remarkFormatFlag;
+  std::string remarksPassedFlag = "";
+  std::string remarksFailedFlag = "";
+  std::string remarksMissedFlag = "";
+  std::string remarksAnalyseFlag = "";
+
 protected:
   /// Allow operation with no registered dialects.
   /// This option is for convenience during testing only and discouraged in
diff --git a/mlir/lib/Tools/mlir-opt/CMakeLists.txt b/mlir/lib/Tools/mlir-opt/CMakeLists.txt
index f24d4c60174ee..858c9c1f97f9c 100644
--- a/mlir/lib/Tools/mlir-opt/CMakeLists.txt
+++ b/mlir/lib/Tools/mlir-opt/CMakeLists.txt
@@ -13,4 +13,5 @@ add_mlir_library(MLIROptLib
   MLIRPluginsLib
   MLIRSupport
   MLIRIRDL
+  MLIRRemarkStreamer
   )
diff --git a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
index de714d8b740af..c456540cc1793 100644
--- a/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
+++ b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
@@ -23,9 +23,11 @@
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Location.h"
 #include "mlir/IR/MLIRContext.h"
+#include "mlir/IR/Remarks.h"
 #include "mlir/Parser/Parser.h"
 #include "mlir/Pass/PassManager.h"
 #include "mlir/Pass/PassRegistry.h"
+#include "mlir/Remark/RemarkStreamer.h"
 #include "mlir/Support/FileUtilities.h"
 #include "mlir/Support/Timing.h"
 #include "mlir/Support/ToolUtilities.h"
@@ -33,6 +35,7 @@
 #include "mlir/Tools/Plugins/DialectPlugin.h"
 #include "mlir/Tools/Plugins/PassPlugin.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Remarks/RemarkFormat.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/LogicalResult.h"
@@ -204,6 +207,41 @@ struct MlirOptMainConfigCLOptions : public MlirOptMainConfig {
             cl::location(generateReproducerFileFlag), cl::init(""),
             cl::value_desc("filename"));
 
+    static cl::OptionCategory remarkCategory(
+        "Remark Options",
+        "Filter remarks by regular expression (llvm::Regex syntax).");
+
+    static llvm::cl::opt<RemarkFormat, /*ExternalStorage=*/true> remarkFormat{
+        "remark-format",
+        llvm::cl::desc("Specify the format for remark output."),
+        cl::location(remarkFormatFlag),
+        llvm::cl::value_desc("format"),
+        llvm::cl::init(REMARK_FORMAT_STDOUT),
+        llvm::cl::values(
+            clEnumValN(REMARK_FORMAT_STDOUT, "emitRemark",
+                       "Print as emitRemark to command-line"),
+            clEnumValN(REMARK_FORMAT_YAML, "yaml", "Print yaml file"),
+            clEnumValN(REMARK_FORMAT_BITSTREAM, "bitstream",
+                       "Print bitstream file")),
+        llvm::cl::cat(remarkCategory)};
+
+    static cl::opt<std::string, /*ExternalStorage=*/true> remarksPassed(
+        "remarks-passed", cl::desc("Show passed remarks"),
+        cl::location(remarksPassedFlag), cl::init(""), cl::cat(remarkCategory));
+
+    static cl::opt<std::string, /*ExternalStorage=*/true> remarksFailed(
+        "remarks-failed", cl::desc("Show failed remarks"),
+        cl::location(remarksFailedFlag), cl::init(""), cl::cat(remarkCategory));
+
+    static cl::opt<std::string, /*ExternalStorage=*/true> remarksMissed(
+        "remarks-missed", cl::desc("Show missed remarks"),
+        cl::location(remarksMissedFlag), cl::init(""), cl::cat(remarkCategory));
+
+    static cl::opt<std::string, /*ExternalStorage=*/true> remarksAnalyse(
+        "remarks-analyse", cl::desc("Show analysis remarks"),
+        cl::location(remarksAnalyseFlag), cl::init(""),
+        cl::cat(remarkCategory));
+
     /// Set the callback to load a pass plugin.
     passPlugins.setCallback([&](const std::string &pluginPath) {
       auto plugin = PassPlugin::load(pluginPath);
@@ -241,23 +279,23 @@ class DiagnosticFilter : public ScopedDiagnosticHandler {
     setHandler([verbosityLevel, showNotes](Diagnostic &diag) {
       auto severity = diag.getSeverity();
       switch (severity) {
-      case DiagnosticSeverity::Error:
+      case mlir::DiagnosticSeverity::Error:
         // failure indicates that the error is not handled by the filter and
         // goes through to the default handler. Therefore, the error can be
         // successfully printed.
         return failure();
-      case DiagnosticSeverity::Warning:
+      case mlir::DiagnosticSeverity::Warning:
         if (verbosityLevel == VerbosityLevel::ErrorsOnly)
           return success();
         else
           return failure();
-      case DiagnosticSeverity::Remark:
+      case mlir::DiagnosticSeverity::Remark:
         if (verbosityLevel == VerbosityLevel::ErrorsOnly ||
             verbosityLevel == VerbosityLevel::ErrorsAndWarnings)
           return success();
         else
           return failure();
-      case DiagnosticSeverity::Note:
+      case mlir::DiagnosticSeverity::Note:
         if (showNotes)
           return failure();
         else
@@ -462,6 +500,38 @@ performActions(raw_ostream &os,
 
   context->enableMultithreading(wasThreadingEnabled);
 
+  // Set up optimization remarks.
+  if (config.shouldEmitRemarks()) {
+    remark::RemarkCategories cats{
+        config.remarksPassedFlag, config.remarksFailedFlag,
+        config.remarksMissedFlag, config.remarksAnalyseFlag};
+
+    mlir::MLIRContext &ctx = *context;
+
+    switch (config.remarkFormatFlag) {
+    case REMARK_FORMAT_STDOUT:
+      if (failed(mlir::remark::enableOptimizationRemarks(ctx, nullptr, cats)))
+        return failure();
+      break;
+
+    case REMARK_FORMAT_YAML: {
+      constexpr llvm::StringLiteral file{"mlir-remarks.yaml"};
+      if (failed(mlir::remark::enableOptimizationRemarksWithLLVMStreamer(
+              ctx, file, llvm::remarks::Format::YAML, cats)))
+        return failure();
+      break;
+    }
+
+    case REMARK_FORMAT_BITSTREAM: {
+      constexpr llvm::StringLiteral File{"mlir-remarks.bitstream"};
+      if (failed(mlir::remark::enableOptimizationRemarksWithLLVMStreamer(
+              ctx, File, llvm::remarks::Format::Bitstream, cats)))
+        return failure();
+      break;
+    }
+    }
+  }
+
   // Prepare the pass manager, applying command-line and reproducer options.
   PassManager pm(op.get()->getName(), PassManager::Nesting::Implicit);
   pm.enableVerifier(config.shouldVerifyPasses());
@@ -523,8 +593,8 @@ processBuffer(raw_ostream &os, std::unique_ptr<MemoryBuffer> ownedBuffer,
       SMLoc());
   sourceMgr->AddNewSourceBuffer(std::move(ownedBuffer), SMLoc());
 
-  // Create a context just for the current buffer. Disable threading on creation
-  // since we'll inject the thread-pool separately.
+  // Create a context just for the current buffer. Disable threading on
+  // creation since we'll inject the thread-pool separately.
   MLIRContext context(registry, MLIRContext::Threading::DISABLED);
   if (threadPool)
     context.setThreadPool(*threadPool);
@@ -669,9 +739,9 @@ LogicalResult mlir::MlirOptMain(int argc, char **argv,
   if (config.shouldListPasses())
     return printRegisteredPassesAndReturn();
 
-  // When reading from stdin and the input is a tty, it is often a user mistake
-  // and the process "appears to be stuck". Print a message to let the user know
-  // about it!
+  // When reading from stdin and the input is a tty, it is often a user
+  // mistake and the process "appears to be stuck". Print a message to let the
+  // user know about it!
   if (inputFilename == "-" &&
       sys::Process::FileDescriptorIsDisplayed(fileno(stdin)))
     llvm::errs() << "(processing input from stdin now, hit ctrl-c/ctrl-d to "
diff --git a/mlir/unittests/IR/CMakeLists.txt b/mlir/unittests/IR/CMakeLists.txt
index 75cd2d65ef5a1..dd3b110dcd295 100644
--- a/mlir/unittests/IR/CMakeLists.txt
+++ b/mlir/unittests/IR/CMakeLists.txt
@@ -14,7 +14,7 @@ add_mlir_unittest(MLIRIRTests
   MemrefLayoutTest.cpp
   OperationSupportTest.cpp
   PatternMatchTest.cpp
-  RemarkTest.cpp
+  RemarkTest.cpp  
   ShapedTypeTest.cpp
   SymbolTableTest.cpp
   TypeTest.cpp

cl::cat(remarkCategory));

static cl::opt<std::string, /*ExternalStorage=*/true> remarksPassed(
"remarks-filter-passed", cl::desc("Show passed remarks"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"remarks-filter-passed", cl::desc("Show passed remarks"),
"remarks-filter-passed", cl::desc("Regex to filter 'passed' remarks, matching the remark category name"),

(same for the others)

@joker-eph
Copy link
Collaborator

This probably deserves a section in the doc? https://mlir.llvm.org/docs/Remarks/

@grypp grypp merged commit 50f539c into llvm:main Sep 12, 2025
9 checks passed
@grypp
Copy link
Member Author

grypp commented Sep 12, 2025

This probably deserves a section in the doc? https://mlir.llvm.org/docs/Remarks/

Yes, I'll add an example there and little doc

@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 12, 2025

LLVM Buildbot has detected a new failure on builder mlir-nvidia-gcc7 running on mlir-nvidia while building mlir at step 6 "build-check-mlir-build-only".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/116/builds/18253

Here is the relevant piece of the build log for the reference
Step 6 (build-check-mlir-build-only) failure: build (failure)
...
16.622 [1773/13/3184] Building MyExtension.h.inc...
16.623 [1773/12/3185] Building Ops.cpp.inc...
16.624 [1771/13/3186] Building MyExtensionTypes.h.inc...
16.632 [1771/12/3187] Building MyExtension.cpp.inc...
16.635 [1771/11/3188] Building MyExtension.h.inc...
16.642 [1771/10/3189] Building ShapeInferenceOpInterfaces.cpp.inc...
16.642 [1771/9/3190] Building ShapeInferenceOpInterfaces.h.inc...
16.739 [1771/8/3191] Building CXX object tools/yaml2obj/CMakeFiles/yaml2obj.dir/yaml2obj.cpp.o
18.779 [1771/7/3192] Building CXX object tools/mlir/lib/Remark/CMakeFiles/obj.MLIRRemarkStreamer.dir/RemarkStreamer.cpp.o
18.922 [1771/6/3193] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o
FAILED: tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /usr/bin/g++-7 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/tools/mlir/lib/IR -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/IR -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/tools/mlir/include -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/include -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/include -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++1z -MD -MT tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o -MF tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o.d -o tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o -c /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/IR/Remarks.cpp
/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/IR/Remarks.cpp: In function ‘std::optional<llvm::Regex> buildFilter(const mlir::remark::RemarkCategories&, const std::optional<std::__cxx11::basic_string<char> >&)’:
/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/IR/Remarks.cpp:287:10: error: could not convert ‘rx’ from ‘llvm::Regex’ to ‘std::optional<llvm::Regex>’
   return rx;
          ^~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
19.338 [1771/5/3194] Building X86GenSubtargetInfo.inc...
20.493 [1771/4/3195] Building X86GenInstrInfo.inc...
21.053 [1771/3/3196] Building CXX object lib/MC/MCParser/CMakeFiles/LLVMMCParser.dir/AsmParser.cpp.o
23.131 [1771/2/3197] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/MLIRContext.cpp.o
In file included from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/IR/MLIRContext.cpp:14:0:
/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/IR/TypeDetail.h:53:49: warning: ‘mlir::detail::IntegerTypeStorage::signedness’ is too small to hold all values of ‘enum mlir::IntegerType::SignednessSemantics’
   IntegerType::SignednessSemantics signedness : 2;
                                                 ^
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
31.244 [1771/1/3198] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
ninja: build stopped: subcommand failed.

matthias-springer added a commit that referenced this pull request Sep 12, 2025
Fix build after #156825.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 12, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building mlir at step 5 "compile-openmp".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/30611

Here is the relevant piece of the build log for the reference
Step 5 (compile-openmp) failure: build (failure)
...
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/Basic/PointerAuthOptions.h:98:58: warning: ‘clang::PointerAuthSchema::SelectedAuthenticationMode’ is too small to hold all values of ‘enum class clang::PointerAuthenticationMode’
   PointerAuthenticationMode SelectedAuthenticationMode : 2;
                                                          ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/Basic/PointerAuthOptions.h:99:39: warning: ‘clang::PointerAuthSchema::DiscriminationKind’ is too small to hold all values of ‘enum class clang::PointerAuthSchema::Discrimination’
   Discrimination DiscriminationKind : 2;
                                       ^
10.434 [3604/32/3771] Linking CXX static library lib/libLLVMObjCopy.a
10.465 [3603/32/3772] Linking CXX static library lib/libLLVMObjectYAML.a
10.466 [3602/32/3773] Linking CXX static library lib/libLLVMDebugInfoDWARF.a
10.483 [3601/32/3774] Building CXX object tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o
FAILED: tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/mlir/lib/IR -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/IR -Itools/mlir/include -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/include -Iinclude -I/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++1z -MD -MT tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o -MF tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o.d -o tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Remarks.cpp.o -c /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/IR/Remarks.cpp
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/IR/Remarks.cpp: In function ‘std::optional<llvm::Regex> buildFilter(const mlir::remark::RemarkCategories&, const std::optional<std::__cxx11::basic_string<char> >&)’:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/mlir/lib/IR/Remarks.cpp:287:10: error: could not convert ‘rx’ from ‘llvm::Regex’ to ‘std::optional<llvm::Regex>’
   return rx;
          ^~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
10.491 [3601/31/3775] Linking CXX static library lib/libLLVMDebugInfoGSYM.a
10.501 [3601/30/3776] Building CXX object tools/mlir/lib/Remark/CMakeFiles/obj.MLIRRemarkStreamer.dir/RemarkStreamer.cpp.o
10.521 [3601/29/3777] Linking CXX static library lib/libLLVMDebugInfoPDB.a
10.552 [3601/28/3778] Building CXX object tools/clang/lib/Parse/CMakeFiles/obj.clangParse.dir/ParseDeclCXX.cpp.o
In file included from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/TypeBase.h:31:0,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/DeclarationName.h:16,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/DeclBase.h:19,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/Decl.h:20,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/Type.h:20,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/CanonicalType.h:17,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/ASTContext.h:18,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/lib/Parse/ParseDeclCXX.cpp:13:
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/Basic/PointerAuthOptions.h:94:18: warning: ‘clang::PointerAuthSchema::TheKind’ is too small to hold all values of ‘enum class clang::PointerAuthSchema::Kind’
   Kind TheKind : 2;
                  ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/Basic/PointerAuthOptions.h:98:58: warning: ‘clang::PointerAuthSchema::SelectedAuthenticationMode’ is too small to hold all values of ‘enum class clang::PointerAuthenticationMode’
   PointerAuthenticationMode SelectedAuthenticationMode : 2;
                                                          ^
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/Basic/PointerAuthOptions.h:99:39: warning: ‘clang::PointerAuthSchema::DiscriminationKind’ is too small to hold all values of ‘enum class clang::PointerAuthSchema::Discrimination’
   Discrimination DiscriminationKind : 2;
                                       ^
10.566 [3601/27/3779] Linking CXX static library lib/libLLVMJITLink.a
10.575 [3601/26/3780] Building CXX object tools/clang/lib/Parse/CMakeFiles/obj.clangParse.dir/ParseExpr.cpp.o
In file included from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/TypeBase.h:31:0,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/DeclarationName.h:16,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/DeclBase.h:19,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/Decl.h:20,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/Type.h:20,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/CanonicalType.h:17,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/include/clang/AST/ASTContext.h:18,
                 from /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/lib/Parse/ParseExpr.cpp:23:

matthias-springer added a commit that referenced this pull request Sep 12, 2025
basioli-k added a commit to basioli-k/llvm-project that referenced this pull request Sep 12, 2025
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 12, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-fast running on sanitizer-buildbot3 while building mlir at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/14935

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 92811 tests, 88 workers --
Testing:  0.. 10
FAIL: MLIR :: Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir (417 of 92811)
******************** TEST 'MLIR :: Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt -lower-vector-to-from-elements-to-shuffle-tree -split-input-file /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt -lower-vector-to-from-elements-to-shuffle-tree -split-input-file /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir
# note: command had no output on stdout or stderr
# error: command failed with exit status: -6
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************
Testing:  0.. 10.. 
FAIL: MLIR :: Conversion/VectorToLLVM/vector-to-llvm-interface.mlir (970 of 92811)
******************** TEST 'MLIR :: Conversion/VectorToLLVM/vector-to-llvm-interface.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt --convert-to-llvm="filter-dialects=vector" --split-input-file /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt --convert-to-llvm=filter-dialects=vector --split-input-file /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
# note: command had no output on stdout or stderr
# error: command failed with exit status: -6
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
# `-----------------------------
# error: command failed with exit status: 2
Step 10 (stage2/asan_ubsan check) failure: stage2/asan_ubsan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:530: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 92811 tests, 88 workers --
Testing:  0.. 10
FAIL: MLIR :: Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir (417 of 92811)
******************** TEST 'MLIR :: Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt -lower-vector-to-from-elements-to-shuffle-tree -split-input-file /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt -lower-vector-to-from-elements-to-shuffle-tree -split-input-file /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir
# note: command had no output on stdout or stderr
# error: command failed with exit status: -6
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Dialect/Vector/vector-tofrom-elements-to-shuffle-tree-transforms.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************
Testing:  0.. 10.. 
FAIL: MLIR :: Conversion/VectorToLLVM/vector-to-llvm-interface.mlir (970 of 92811)
******************** TEST 'MLIR :: Conversion/VectorToLLVM/vector-to-llvm-interface.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt --convert-to-llvm="filter-dialects=vector" --split-input-file /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt --convert-to-llvm=filter-dialects=vector --split-input-file /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
# note: command had no output on stdout or stderr
# error: command failed with exit status: -6
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
# `-----------------------------
# error: command failed with exit status: 2

"Remark Options",
"Filter remarks by regular expression (llvm::Regex syntax).");

static llvm::cl::opt<RemarkFormat, /*ExternalStorage=*/true> remarkFormat{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a using namespace llvm and mlir above, so no need to qualify these here (and also inconsistent with ones just below and above).

auto severity = diag.getSeverity();
switch (severity) {
case DiagnosticSeverity::Error:
case mlir::DiagnosticSeverity::Error:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these changes needed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflict with the LLVM class of the same name I believe (there is an added include to LLVM)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is the reason exactly

@alazarev
Copy link
Contributor

This PR breaks https://lab.llvm.org/buildbot/#/builders/85/builds/13330

==> /home/b/sanitizer-aarch64-linux-bootstrap-ubsan/build/sanitizer_logs/report.mlir-opt.3736086 <==
/home/b/sanitizer-aarch64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/Support/CommandLine.h:595:13: runtime error: load of value 11, which is not a valid value for type 'const mlir::RemarkFormat'

bool allowUnregisteredDialectsFlag = false;

/// Remark format
RemarkFormat remarkFormatFlag;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sanitizer issue is because there is no default here.

joker-eph added a commit that referenced this pull request Sep 15, 2025
Follow-up to #156825 ; a member wasn't always initialized, it's not clear to me
why this is needed though, so this fix may not be the right one, we'll monitor
the bots.
@joker-eph
Copy link
Collaborator

This PR breaks https://lab.llvm.org/buildbot/#/builders/85/builds/13330

==> /home/b/sanitizer-aarch64-linux-bootstrap-ubsan/build/sanitizer_logs/report.mlir-opt.3736086 <== /home/b/sanitizer-aarch64-linux-bootstrap-ubsan/build/llvm-project/llvm/include/llvm/Support/CommandLine.h:595:13: runtime error: load of value 11, which is not a valid value for type 'const mlir::RemarkFormat'

I fixed the MLIR failures here: https://lab.llvm.org/buildbot/#/builders/85/builds/13427

@Garra1980
Copy link

Also I see new warning
warning: ‘mlir::MlirOptMainConfig’ has a field ‘mlir::MlirOptMainConfig::remarkFormatFlag’ whose type has no linkage [-Wsubobject-linkage]

@joker-eph
Copy link
Collaborator

I sent #158733 to address to fix this issue.

@Garra1980
Copy link

I sent #158733 to address to fix this issue.

Thanks a lot!

@grypp
Copy link
Member Author

grypp commented Sep 17, 2025

I am just seeing this issue. Thanks for fixing the issue @joker-eph , reporting @Garra1980

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants