mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 01:07:04 +08:00
[mlir] Let ModuleTranslate propagate LLVM triple
This adds LLVM triple propagation and updates the test that did not check it properly. Differential Revision: https://reviews.llvm.org/D92182
This commit is contained in:
@@ -946,6 +946,9 @@ std::unique_ptr<llvm::Module> ModuleTranslation::prepareLLVMModule(
|
||||
if (auto dataLayoutAttr =
|
||||
m->getAttr(LLVM::LLVMDialect::getDataLayoutAttrName()))
|
||||
llvmModule->setDataLayout(dataLayoutAttr.cast<StringAttr>().getValue());
|
||||
if (auto targetTripleAttr =
|
||||
m->getAttr(LLVM::LLVMDialect::getTargetTripleAttrName()))
|
||||
llvmModule->setTargetTriple(targetTripleAttr.cast<StringAttr>().getValue());
|
||||
|
||||
// Inject declarations for `malloc` and `free` functions that can be used in
|
||||
// memref allocation/deallocation coming from standard ops lowering.
|
||||
|
||||
@@ -1319,6 +1319,7 @@ module attributes {llvm.target_triple = "x86_64-pc-windows-msvc"} {}
|
||||
// -----
|
||||
|
||||
// CHECK-NOT: "CodeView", i32 1
|
||||
// CHECK: aarch64-linux-android
|
||||
module attributes {llvm.target_triple = "aarch64-linux-android"} {}
|
||||
|
||||
// -----
|
||||
|
||||
Reference in New Issue
Block a user