[Mlir-commits] [mlir] [MLIR] Add missing analysis_gen dependency to ExecutionEngine targets (PR #186936)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Mar 16 18:59:07 PDT 2026
https://github.com/tmimmanuel created https://github.com/llvm/llvm-project/pull/186936
Fixes #186867.
`MLIRExecutionEngineUtils` and `MLIRExecutionEngine` both include headers that transitively require the generated file `TargetLibraryInfo.inc` (`OptUtils.cpp` → `PassBuilder.h` → `CGSCCPassManager.h` → `LazyCallGraph.h` → `TargetLibraryInfo.h` → `TargetLibraryInfo.inc`).
This file is produced by the `analysis_gen` tablegen target defined in `llvm/include/llvm/Analysis/CMakeLists.txt`. Both MLIR targets declared `LINK_COMPONENTS Analysis` and `DEPENDS intrinsics_gen`, but were missing `analysis_gen`. Because `LINK_COMPONENTS` only affects linking and does not create build-order dependencies on tablegen targets, parallel builds
can attempt to compile `OptUtils.cpp` before `TargetLibraryInfo.inc` exists.
This patch adds `analysis_gen` to the `DEPENDS` list of both targets, matching how `LLVMAnalysis` itself declares this dependency in `llvm/lib/Analysis/CMakeLists.txt`. Other MLIR targets that include Analysis headers (e.g. `MLIRTargetLLVM`) link against
`MLIRExecutionEngineUtils` and inherit the build-order dependency transitively.
Verified with a clean build of `MLIRExecutionEngineUtils` after removing the generated `.inc` file — the build succeeds with the fix applied.
>From b851dbbdffcac94156a183030ab809c28525031e Mon Sep 17 00:00:00 2001
From: tmimmanuel <14046872+tmimmanuel at users.noreply.github.com>
Date: Tue, 17 Mar 2026 02:56:57 +0100
Subject: [PATCH] Add missing analysis_gen dependency to ExecutionEngine
targets
---
mlir/lib/ExecutionEngine/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt
index 2176ccaa6031f..6e9c27c97d676 100644
--- a/mlir/lib/ExecutionEngine/CMakeLists.txt
+++ b/mlir/lib/ExecutionEngine/CMakeLists.txt
@@ -34,6 +34,7 @@ add_mlir_library(MLIRExecutionEngineUtils
DEPENDS
intrinsics_gen
+ analysis_gen
LINK_COMPONENTS
Analysis
@@ -73,6 +74,7 @@ add_mlir_library(MLIRExecutionEngine
DEPENDS
intrinsics_gen
+ analysis_gen
LINK_COMPONENTS
Core
More information about the Mlir-commits
mailing list