Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Turn optimizations on! (Except for full inlining...)
  • Loading branch information
Axel-Naumann committed Mar 27, 2017
commit 306f5de3b5953224f382c43cd12a46e29d73f41f
6 changes: 2 additions & 4 deletions interpreter/cling/lib/Interpreter/BackendPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void BackendPasses::CreatePasses(llvm::Module& M)
// DON'T: we will not find our symbols...
//CGOpts_.CXXCtorDtorAliases = 1;

// Default clang -O2 on Linux 64bit also has:
// Default clang -O2 on Linux 64bit also has the following, but see
// CIFactory.cpp.
#if 0
CGOpts_.DisableFPElim = 0;
CGOpts_.DiscardValueNames = 1;
Expand Down Expand Up @@ -71,9 +72,6 @@ void BackendPasses::CreatePasses(llvm::Module& M)
// Inlining = CGOpts.NoInlining;
}

OptLevel = 0; // we need to keep even "unused" values - until we
// feed incremental modules into the JIT.

llvm::PassManagerBuilder PMBuilder;
PMBuilder.OptLevel = OptLevel;
PMBuilder.SizeLevel = m_CGOpts.OptimizeSize;
Expand Down
9 changes: 9 additions & 0 deletions interpreter/cling/lib/Interpreter/CIFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,15 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
CI->getCodeGenOpts().EmitCodeView = 1;
CI->getCodeGenOpts().CXXCtorDtorAliases = 1;
#endif
// Reduce amount of emitted symbols by optimizing more.
CI->getCodeGenOpts().OptimizationLevel = 2;
// Taken from a -O2 run of clang:
CI->getCodeGenOpts().DiscardValueNames = 1;
CI->getCodeGenOpts().OmitLeafFramePointer = 1;
CI->getCodeGenOpts().UnrollLoops = 1;
CI->getCodeGenOpts().VectorizeLoop = 1;
CI->getCodeGenOpts().VectorizeSLP = 1;

//CI->getCodeGenOpts().setDebugInfo(clang::CodeGenOptions::FullDebugInfo);
// CI->getCodeGenOpts().EmitDeclMetadata = 1; // For unloading, for later
CI->getCodeGenOpts().CXXCtorDtorAliases = 0; // aliasing the complete
Expand Down