Skip to content

Commit 76e5cfc

Browse files
committed
LLVMCompilerContext: Only optimize functions with external linkage
1 parent 1cf582f commit 76e5cfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dev/engine/internal/llvm/llvmcompilercontext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void LLVMCompilerContext::initJit()
8383
// Run the O3 pipeline for specific functions
8484
for (llvm::Function &func : m_module->functions()) {
8585
if (!func.isDeclaration()) {
86-
if (!func.hasFnAttribute(llvm::Attribute::OptimizeNone)) {
86+
if (func.hasExternalLinkage() && !func.hasFnAttribute(llvm::Attribute::OptimizeNone)) {
8787
#ifndef NDEBUG
8888
std::cout << "debug: optimizing function: " << functionNames.back() << std::endl;
8989
#endif

0 commit comments

Comments
 (0)