Skip to content

Commit

Permalink
make -O1 a bit more useful by disabling more optimization passes (#27028
Browse files Browse the repository at this point in the history
)
  • Loading branch information
JeffBezanson authored May 9, 2018
1 parent b81b118 commit 04fe0f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, bool dump
#if defined(JL_MSAN_ENABLED)
PM->add(llvm::createMemorySanitizerPass(true));
#endif
if (opt_level == 0) {
if (opt_level < 2) {
PM->add(createCFGSimplificationPass()); // Clean up disgusting code
if (opt_level == 1) {
PM->add(createSROAPass()); // Break up aggregate allocas
PM->add(createInstructionCombiningPass()); // Cleanup for scalarrepl.
PM->add(createEarlyCSEPass());
}
#if JL_LLVM_VERSION < 50000
PM->add(createBarrierNoopPass());
PM->add(createLowerExcHandlersPass());
Expand Down

0 comments on commit 04fe0f4

Please sign in to comment.