Commit Graph

7 Commits

Author SHA1 Message Date
Arnold Schwaighofer
e5e11b9ade LoopRotate: Don't rotate single BB loops
Swift SVN r21123
2014-08-09 00:05:29 +00:00
Arnold Schwaighofer
6f2b8fae49 LoopRotate: Add option to disable rotation
Swift SVN r20097
2014-07-17 16:12:44 +00:00
Arnold Schwaighofer
8eba52fe4d LoopRotate: Silence unused variable warning in release mode
Swift SVN r19920
2014-07-14 03:42:40 +00:00
Arnold Schwaighofer
33502446e3 LoopRotate: Update comment to reflect reality
Swift SVN r19919
2014-07-14 03:42:40 +00:00
Arnold Schwaighofer
c50e396103 Add APIs to update preserved analysis information for dominance and loop info
Use it in loop rotation.

The pattern to update analysis information is:

  // The AnalysisInfo was preserved for this function.
  if (Changed) {
    // Preserve the analyis for this function by decoupling it from the analysis
    // cache.
    auto PreservedAnalysis = Analysis.preserveAnalysis(Function);

    // Invalidate analysis for this function.
    PM.invalidateAnalysis(Function, InvalidationKind::CFG);

    // Update the preserved analysis for this function.
    Analysis.updateAnalysis(F, std::move(PreservedAnalysis));
  }

Swift SVN r19918
2014-07-14 03:42:39 +00:00
Arnold Schwaighofer
fe5c3a2db7 LoopRotate: Don't assert on certain loop forms
Since we don't have guaranteed preheader insertion (yet). We can have the
situation where the new header (after rotation) is also a header of a nested
loop.  In such a case we must bail.

Try harder to created preheader for nested loops though.

Swift SVN r19881
2014-07-12 16:49:02 +00:00
Arnold Schwaighofer
5ad13207e5 Add a loop rotation pass
This is to support loop invariant code motion and bound check
hoisting.

Disabled for now.

Swift SVN r19635
2014-07-07 21:05:23 +00:00