[Mlir-commits] [mlir] [mlir] Fix ThinLTO printing failures in dylib-linked test tools (PR #236742)
Mehdi Amini
llvmlistbot at llvm.org
Thu Oct 29 05:04:23 PDT 2026
https://github.com/joker-eph created https://github.com/llvm/llvm-project/pull/236742
Move MLIRAnalysisBase dependencies in the Affine and DLTI test libraries to mlir_target_link_libraries so they use libMLIR when dylib linking is enabled. Direct LINK_LIBS dependencies pull static MLIRIR into mlir-opt alongside libMLIR, duplicating AsmPrinter.cpp and its private options.
ThinLTO inlines printer option registration into the dylib, while the executable's interposed OpPrintingFlags constructor reads its separate, uninitialized options object. Printing flags are consequently ignored.
This completes the test-library dependency corrections after #232793 and #236359.
Assisted-by: Codex
>From 85b366eb9799c6fcbc856ef5f64feeac8d0670fe Mon Sep 17 00:00:00 2001
From: Mehdi Amini <joker.eph at gmail.com>
Date: Thu, 29 Oct 2026 05:03:03 -0700
Subject: [PATCH] [mlir] Fix ThinLTO printing failures in dylib-linked test
tools
Move MLIRAnalysisBase dependencies in the Affine and DLTI test libraries
to mlir_target_link_libraries so they use libMLIR when dylib linking is
enabled. Direct LINK_LIBS dependencies pull static MLIRIR into mlir-opt
alongside libMLIR, duplicating AsmPrinter.cpp and its private options.
ThinLTO inlines printer option registration into the dylib, while the
executable's interposed OpPrintingFlags constructor reads its separate,
uninitialized options object. Printing flags are consequently ignored.
This completes the test-library dependency corrections after #232793
and #236359.
With the reported ThinLTO configuration, check-mlir changes from 61
failures to 4215 passes, 647 unsupported tests and one expected failure.
Assisted-by: Codex
---
mlir/test/lib/Dialect/Affine/CMakeLists.txt | 2 +-
mlir/test/lib/Dialect/DLTI/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mlir/test/lib/Dialect/Affine/CMakeLists.txt b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
index 512bf5ba113f3d..29a8cbbc9f86fb 100644
--- a/mlir/test/lib/Dialect/Affine/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
@@ -21,10 +21,10 @@ add_mlir_library(MLIRAffineTransformsTestPasses
Core
LINK_LIBS PUBLIC
- MLIRAnalysisBase
MLIRTestDialect
)
mlir_target_link_libraries(MLIRAffineTransformsTestPasses PUBLIC
+ MLIRAnalysisBase
MLIRArithTransforms
MLIRAffineAnalysis
MLIRAffineTransforms
diff --git a/mlir/test/lib/Dialect/DLTI/CMakeLists.txt b/mlir/test/lib/Dialect/DLTI/CMakeLists.txt
index f889242b3fa96a..1f6198bec919fd 100644
--- a/mlir/test/lib/Dialect/DLTI/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/DLTI/CMakeLists.txt
@@ -5,10 +5,10 @@ add_mlir_library(MLIRDLTITestPasses
EXCLUDE_FROM_LIBMLIR
LINK_LIBS PUBLIC
- MLIRAnalysisBase
MLIRTestDialect
)
mlir_target_link_libraries(MLIRDLTITestPasses PUBLIC
+ MLIRAnalysisBase
MLIRDLTIDialect
MLIRPass
)
More information about the Mlir-commits
mailing list