diff --git a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h --- a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h +++ b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h @@ -164,6 +164,9 @@ /// constructed. llvm::OpenMPIRBuilder *getOpenMPBuilder(); + /// Returns the LLVM module in which the IR is being constructed. + llvm::Module *getLLVMModule() { return llvmModule.get(); } + /// Translates the given location. const llvm::DILocation *translateLoc(Location loc, llvm::DILocalScope *scope); diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp --- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp @@ -771,6 +771,10 @@ } } + for (auto op : getModuleBody(mlirModule).getOps()) + if (failed(convertDialectAttributes(op))) + return failure(); + return success(); }