[Mlir-commits] [flang] [mlir] [MLIR][LLVMIR][DLTI] Add #llvm.target, #llvm.data_layout and TargetAttrInterface (PR #145899)
Rolf Morel
llvmlistbot at llvm.org
Fri Jul 25 11:08:31 PDT 2025
================
@@ -14,12 +14,15 @@
#ifndef MLIR_DIALECT_LLVMIR_LLVMATTRS_H_
#define MLIR_DIALECT_LLVMIR_LLVMATTRS_H_
-#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
#include "mlir/IR/OpImplementation.h"
+#include "mlir/Interfaces/DataLayoutInterfaces.h"
#include <optional>
#include "mlir/Dialect/LLVMIR/LLVMOpsEnums.h.inc"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/Target/TargetMachine.h"
----------------
rolfmorel wrote:
As the `mlir::LLVM::TargetAttrInterface` has methods that return the DataLayout and TargetMachine.
Look at `mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h` to see that having dependency on LLVM's headers is not a big deal. For clarity's sake, due moving the parts that require linking to `mlir/Target` the `LLVM` dialect does not gain any linking dependencies.
https://github.com/llvm/llvm-project/pull/145899
More information about the Mlir-commits
mailing list