diff --git a/mlir/lib/Target/LLVMIR/DebugTranslation.cpp b/mlir/lib/Target/LLVMIR/DebugTranslation.cpp --- a/mlir/lib/Target/LLVMIR/DebugTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/DebugTranslation.cpp @@ -51,6 +51,13 @@ // is set explicitly. Windows/MSVC should use CodeView instead. llvmModule.addModuleFlag(llvm::Module::Warning, "CodeView", 1); } + + if (targetTriple.isRISCV()) { + llvmModule.addModuleFlag( + llvm::Module::Warning, "target-abi", + llvm::MDString::get(llvmCtx, + targetTriple.isRISCV32() ? "ilp32d" : "lp64d")); + } } }