Page MenuHomePhabricator

[MemorySSA & LoopPassManager] Enable MemorySSA as loop dependency. Update tests.
Needs ReviewPublic

Authored by asbirlea on Feb 15 2019, 3:34 PM.

Details

Summary

This patch enables the use of MemorySSA in the old and new loop pass managers.

Passes that currently use MemorySSA:

  • EarlyCSE

Passes that use MemorySSA after this patch:

  • EarlyCSE
  • LICM
  • SimpleLoopUnswitch

Loop passes that update MemorySSA (and do not use it yet, but could use it after this patch):

  • LoopInstSimplify
  • LoopSimplifyCFG
  • LoopUnswitch
  • LoopRotate

Function passes that update/preserve MemorySSA only in the old pass manager:

  • LoopSimplify
  • LCSSA

Loop passes that do *not* update MemorySSA:

  • IndVarSimplify
  • LoopDelete
  • LoopIdiom
  • LoopSink
  • LoopUnroll
  • LoopInterchange
  • LoopUnrollAndJam
  • LoopVectorize
  • LoopReroll
  • IRCE

Diff Detail

Event Timeline

asbirlea created this revision.Feb 15 2019, 3:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2019, 3:34 PM
asbirlea updated this revision to Diff 191570.Mar 20 2019, 1:31 PM

Rebase and ping for comments.

chandlerc added inline comments.Mar 20 2019, 6:46 PM
test/Other/opt-O2-pipeline.ll
159

This is weird.

If simplify loops and LCSSA aren't using MemorySSA we shouldn't be building it here only to trash it and rebuild it below. This will basically double the compile time cost (from building).

asbirlea marked an inline comment as done.Thu, Mar 28, 4:51 PM
asbirlea added inline comments.
test/Other/opt-O2-pipeline.ll
159

To clarify this in writing, yes, currently MemorySSA is built twice in the old pass manager, due to the order of analysis. LoopSimplify and LCSSA need to preserve MemorySSA to resolve this.

The new pass manager does not have this issue.

sanjoy removed a reviewer: sanjoy.Mon, Apr 1, 11:08 AM
asbirlea marked 2 inline comments as done.
asbirlea added inline comments.
test/Other/opt-O2-pipeline.ll
159

Added dependent revisions that update LCSSA and LoopSimplify. PTAL.

asbirlea updated this revision to Diff 195834.Thu, Apr 18, 4:06 PM

Rebase on top of patches updating LCSSA and LoopSimplify.