[LICM] Refactoring + Improvements + Exclusivity Support

Major refactoring + tuning of LICM. Includes:
Support for hosting more array semantic calls
Remove restrictions for sinking instructions
Add support for hoisting and sinking instruction pairs (begin and end accesses)

Testing with Exclusivity enabled on a couple of benchmarks shows:
ReversedArray 7x improvement
StringWalk 2.6x improvement
This commit is contained in:
Joe Shajrawi
2018-06-08 13:08:07 -07:00
parent 73ca2f4234
commit bc59eaad70
4 changed files with 468 additions and 219 deletions

View File

@@ -193,7 +193,12 @@ void addHighLevelLoopOptPasses(SILPassPipelinePlan &P) {
P.addHighLevelCSE();
P.addSILCombine();
P.addSimplifyCFG();
// Optimize access markers for better LICM: might merge accesses
// It will also set the no_nested_conflict for dynamic accesses
P.addAccessEnforcementOpts();
P.addHighLevelLICM();
// Simplify CFG after LICM that creates new exit blocks
P.addSimplifyCFG();
// Start of loop unrolling passes.
P.addArrayCountPropagation();
// To simplify induction variable.
@@ -446,7 +451,12 @@ static void addLateLoopOptPassPipeline(SILPassPipelinePlan &P) {
// Perform the final lowering transformations.
P.addCodeSinking();
// Optimize access markers for better LICM: might merge accesses
// It will also set the no_nested_conflict for dynamic accesses
P.addAccessEnforcementOpts();
P.addLICM();
// Simplify CFG after LICM that creates new exit blocks
P.addSimplifyCFG();
// Optimize overflow checks.
P.addRedundantOverflowCheckRemoval();