Skip to content

Commit

Permalink
[LLVM][RUNTIME] Fix CodeModel propagation to ORCJIT runtime executor
Browse files Browse the repository at this point in the history
  • Loading branch information
cbalint13 committed Sep 8, 2024
1 parent e468426 commit 5836db4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/target/llvm/llvm_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ class LLVMTargetInfo {
* \return `llvm::TargetOptions` object for this target
*/
const llvm::TargetOptions& GetTargetOptions() const { return target_options_; }
/*!
* \brief Get the LLVM target code model
* \return `llvm::CodeModel` object for this target
*/
const llvm::CodeModel::Model& GetTargetCodeModel() const { return code_model_; }
/*!
* \brief Get fast math flags
* \return `llvm::FastMathFlags` for this target
Expand Down
1 change: 1 addition & 0 deletions src/target/llvm/llvm_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ void LLVMModuleNode::InitORCJIT() {
tm_builder.setCPU(llvm_target->GetCPU());
tm_builder.setFeatures(llvm_target->GetTargetFeatureString());
tm_builder.setOptions(llvm_target->GetTargetOptions());
tm_builder.setCodeModel(llvm_target->GetTargetCodeModel());
#if TVM_LLVM_VERSION <= 170
tm_builder.setCodeGenOptLevel(llvm::CodeGenOpt::Aggressive);
#else
Expand Down

0 comments on commit 5836db4

Please sign in to comment.