[PATCH] D66376: [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 17:55:33 PDT 2019


asbirlea created this revision.
asbirlea added a reviewer: chandlerc.
Herald added subscribers: sanjoy.google, george.burgess.iv, Prazek, mehdi_amini.
Herald added a project: LLVM.

Add a flag to the FunctionToLoopAdaptor that allows enabling MemorySSA only for the loop pass managers that are known to preserve it.

If an LPM is known to have only loop transforms that *all* preserve MemorySSA, then use MemorySSA if `EnableMSSALoopDependency` is set.
If an LPM has loop passes that do not preserve MemorySSA, then the flag passed is `false`, regardless of the value of `EnableMSSALoopDependency`.

When using a custom loop pass pipeline via `passes=...`, use keyword `loop` vs `loop-mssa` to use MemorySSA in that LPM. If a loop that does not preserve MemorySSA is added while using the `loop-mssa` keyword, that's an error.

Add the new `loop-mssa` keyword to a few tests where a difference occurs when enabling MemorySSA.


Repository:
  rL LLVM

https://reviews.llvm.org/D66376

Files:
  include/llvm/Analysis/LoopAnalysisManager.h
  include/llvm/Transforms/Scalar/LoopPassManager.h
  lib/Analysis/LoopAnalysisManager.cpp
  lib/Passes/PassBuilder.cpp
  test/Analysis/BasicAA/store-promote.ll
  test/Transforms/LICM/argmemonly-call.ll
  test/Transforms/LICM/atomics.ll
  test/Transforms/LICM/guards.ll
  test/Transforms/LICM/hoist-deref-load.ll
  test/Transforms/LICM/hoist-phi.ll
  test/Transforms/LICM/promote-order.ll
  test/Transforms/LICM/read-only-calls.ll
  test/Transforms/LICM/store-hoisting.ll
  test/Transforms/LoopInstSimplify/basic.ll
  test/Transforms/LoopRotate/basic.ll
  test/Transforms/LoopRotate/pr35210.ll
  test/Transforms/SimpleLoopUnswitch/basictest-profmd.ll
  test/Transforms/SimpleLoopUnswitch/basictest.ll
  test/Transforms/SimpleLoopUnswitch/guards.ll
  test/Transforms/SimpleLoopUnswitch/msan.ll
  test/Transforms/SimpleLoopUnswitch/trivial-unswitch-iteration.ll
  test/Transforms/SimpleLoopUnswitch/trivial-unswitch-profmd.ll
  test/Transforms/SimpleLoopUnswitch/trivial-unswitch.ll
  test/Transforms/SimpleLoopUnswitch/update-scev.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66376.215725.patch
Type: text/x-patch
Size: 29803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190817/9527f924/attachment.bin>


More information about the llvm-commits mailing list