[LoopRotate] Get and update MSSA only if available in legacy pass manager.
authorAlina Sbirlea <asbirlea@google.com>
Thu, 13 Feb 2020 18:49:44 +0000 (10:49 -0800)
committerAlina Sbirlea <asbirlea@google.com>
Fri, 14 Feb 2020 18:47:26 +0000 (10:47 -0800)
commit1326a5a4cfe004181f2ec8231d84ecda2b93cb25
tree5e0d38ad43c691994b80a3b21164a8cd5cf03697
parentbfbfa18591db4eff68a6692b8503efd1571cdb88
[LoopRotate] Get and update MSSA only if available in legacy pass manager.

Summary:
Potential fix for: https://bugs.llvm.org/show_bug.cgi?id=44889 and https://bugs.llvm.org/show_bug.cgi?id=44408

In the legacy pass manager, loop rotate need not compute MemorySSA when not being in the same loop pass manager with other loop passes.
There isn't currently a way to differentiate between the two cases, so this attempts to limit the usage in LoopRotate to only update MemorySSA when the analysis is already available.
The side-effect of this is that it will split the Loop pipeline.

This issue does not apply to the new pass manager, where we have a flag specifying if all loop passes in that loop pass manager preserve MemorySSA.

Reviewers: dmgreen, fedor.sergeev, nikic

Subscribers: Prazek, hiraditya, george.burgess.iv, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74574
llvm/lib/Transforms/Scalar/LoopRotation.cpp
llvm/test/Other/opt-O2-pipeline.ll
llvm/test/Other/opt-O3-pipeline.ll
llvm/test/Other/opt-Os-pipeline.ll
llvm/test/Other/pass-pipelines.ll