Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,10 @@ TCling::TCling(const char *name, const char *title, const char* const argv[])
fClingCallbacks->SetAutoParsingSuspended(fIsAutoParsingSuspended);
fInterpreter->setCallbacks(std::move(clingCallbacks));

// force optlevel 3
fInterpreter->getCI()->getCodeGenOpts().OptimizationLevel = 3;
fInterpreter->setDefaultOptLevel(3);

if (!fromRootCling) {
cling::DynamicLibraryManager& DLM = *fInterpreter->getDynamicLibraryManager();
// Make sure cling looks into ROOT's libdir, even if not part of LD_LIBRARY_PATH
Expand Down
3 changes: 3 additions & 0 deletions interpreter/cling/lib/Interpreter/BackendPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ void BackendPasses::CreatePasses(llvm::Module& M, int OptLevel)
// Inlining = CGOpts.NoInlining;
}

// force normal inlining (as above says: NoInlining is kills)
const_cast<CodeGenOptions&>(m_CGOpts).setInlining(CodeGenOptions::NormalInlining);

llvm::PassManagerBuilder PMBuilder;
PMBuilder.OptLevel = OptLevel;
PMBuilder.SizeLevel = m_CGOpts.OptimizeSize;
Expand Down
2 changes: 1 addition & 1 deletion interpreter/cling/lib/Interpreter/CIFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
// FIXME: We have a bug when we switch to -O2, for some cases it takes
// several minutes to optimize, while the same code compiled by clang -O2
// takes only a few seconds.
CGOpts.OptimizationLevel = 0;
CGOpts.OptimizationLevel = 3;
// Taken from a -O2 run of clang:
CGOpts.DiscardValueNames = 1;
CGOpts.OmitLeafFramePointer = 1;
Expand Down
2 changes: 1 addition & 1 deletion interpreter/cling/lib/Interpreter/IncrementalParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ namespace cling {
std::vector<ASTTPtr_t> ASTTransformers;
ASTTransformers.emplace_back(new AutoSynthesizer(TheSema));
ASTTransformers.emplace_back(new EvaluateTSynthesizer(TheSema));
if (hasCodeGenerator() && !m_Interpreter->getOptions().NoRuntime) {
if (0 && hasCodeGenerator() && !m_Interpreter->getOptions().NoRuntime) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which approach do you recommend to turn off pointer checks?

// Don't protect against crashes if we cannot run anything.
// cling might also be in a PCH-generation mode; don't inject our Sema
// pointer into the PCH.
Expand Down