Skip to content

Commit

Permalink
target:llvmir: Fix triplet conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Oct 6, 2023
1 parent 4711423 commit 535ea54
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/vast/Target/LLVMIR/Convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ namespace vast::target::llvmir
vast_module mlir_module, llvm::LLVMContext &llvm_ctx,const std::string &module_name
) {
clean_up_data_layout(mlir_module);

// TODO move to LLVM conversion and use attr replacer
if (auto target = mlir_module->getAttr(core::CoreDialect::getTargetTripleAttrName())) {
auto triple = mlir::cast< mlir::StringAttr>(target);
mlir_module->setAttr(mlir::LLVM::LLVMDialect::getTargetTripleAttrName(), triple);
mlir_module->removeAttr(core::CoreDialect::getTargetTripleAttrName());
}

return mlir::translateModuleToLLVMIR(mlir_module, llvm_ctx);
}

Expand Down

0 comments on commit 535ea54

Please sign in to comment.