Skip to content

Commit

Permalink
Merge pull request #26990 from JuliaLang/kf/yyc/codegen/alloc2
Browse files Browse the repository at this point in the history
WIP: Rebase #24478
  • Loading branch information
Keno authored May 7, 2018
2 parents 71f6bfe + 3113017 commit 8eb3dcc
Show file tree
Hide file tree
Showing 3 changed files with 1,046 additions and 318 deletions.
13 changes: 13 additions & 0 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, bool dump

PM->add(createEarlyCSEPass()); //// ****

#if JL_LLVM_VERSION >= 50000
// Load forwarding above can expose allocations that aren't actually used
// remove those before optimizing loops.
PM->add(createAllocOptPass());
#endif
PM->add(createLoopIdiomPass()); //// ****
PM->add(createLoopRotatePass()); // Rotate loops.
#ifdef USE_POLLY
Expand All @@ -216,6 +221,10 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, bool dump
PM->add(createSimpleLoopUnrollPass()); // Unroll small loops
//PM->add(createLoopStrengthReducePass()); // (jwb added)

#if JL_LLVM_VERSION >= 50000
// Run our own SROA on heap objects before LLVM's
PM->add(createAllocOptPass());
#endif
// Re-run SROA after loop-unrolling (useful for small loops that operate,
// over the structure of an aggregate)
PM->add(createSROAPass()); // Break up aggregate allocas
Expand All @@ -232,6 +241,10 @@ void addOptimizationPasses(legacy::PassManagerBase *PM, int opt_level, bool dump
PM->add(createJumpThreadingPass()); // Thread jumps
PM->add(createDeadStoreEliminationPass()); // Delete dead stores

#if JL_LLVM_VERSION >= 50000
// More dead allocation (store) deletion before loop optimization
PM->add(createAllocOptPass());
#endif
// see if all of the constant folding has exposed more loops
// to simplification and deletion
// this helps significantly with cleaning up iteration
Expand Down
Loading

0 comments on commit 8eb3dcc

Please sign in to comment.