File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
src/dev/engine/internal/llvm Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
8282 if (m_procedurePrototype && m_warp)
8383 func->addFnAttr (llvm::Attribute::InlineHint);
8484 else {
85+ // NOTE: These attributes will be overriden by LLVMCompilerContext
86+ // TODO: Optimize all functions, maybe it doesn't take so long
8587 func->addFnAttr (llvm::Attribute::NoInline);
8688 func->addFnAttr (llvm::Attribute::OptimizeNone);
8789 }
Original file line number Diff line number Diff line change @@ -88,6 +88,10 @@ void LLVMCompilerContext::initJit()
8888 std::cout << " debug: optimizing function: " << functionNames.back () << std::endl;
8989#endif
9090 functionPassManager.run (func, functionAnalysisManager);
91+ } else if (func.hasFnAttribute (llvm::Attribute::OptimizeNone)) {
92+ // Remove this attribute to avoid JIT hangs
93+ // TODO: Optimize all functions, maybe it doesn't take so long
94+ func.removeFnAttr (llvm::Attribute::OptimizeNone);
9195 }
9296 }
9397 }
You can’t perform that action at this time.
0 commit comments