Skip to content

Commit 5836db4

Browse files
committed
[LLVM][RUNTIME] Fix CodeModel propagation to ORCJIT runtime executor
1 parent e468426 commit 5836db4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/target/llvm/llvm_instance.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ class LLVMTargetInfo {
215215
* \return `llvm::TargetOptions` object for this target
216216
*/
217217
const llvm::TargetOptions& GetTargetOptions() const { return target_options_; }
218+
/*!
219+
* \brief Get the LLVM target code model
220+
* \return `llvm::CodeModel` object for this target
221+
*/
222+
const llvm::CodeModel::Model& GetTargetCodeModel() const { return code_model_; }
218223
/*!
219224
* \brief Get fast math flags
220225
* \return `llvm::FastMathFlags` for this target

src/target/llvm/llvm_module.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ void LLVMModuleNode::InitORCJIT() {
476476
tm_builder.setCPU(llvm_target->GetCPU());
477477
tm_builder.setFeatures(llvm_target->GetTargetFeatureString());
478478
tm_builder.setOptions(llvm_target->GetTargetOptions());
479+
tm_builder.setCodeModel(llvm_target->GetTargetCodeModel());
479480
#if TVM_LLVM_VERSION <= 170
480481
tm_builder.setCodeGenOptLevel(llvm::CodeGenOpt::Aggressive);
481482
#else

0 commit comments

Comments
 (0)