[PM/MergedLoadStoreMotion] Preserve analyses more aggressively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272611 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano 2016-06-14 01:23:31 +00:00
parent cd472d1a69
commit a1a1144732

View File

@ -520,7 +520,12 @@ MergedLoadStoreMotionPass::run(Function &F, AnalysisManager<Function> &AM) {
auto *MD = AM.getCachedResult<MemoryDependenceAnalysis>(F);
if (!runMergedLoadStoreMotion(F, &AA, MD))
return PreservedAnalyses::all();
return PreservedAnalyses::none();
// FIXME: This pass should also 'preserve the CFG'.
// The new pass manager has currently no way to do it.
PreservedAnalyses PA;
PA.preserve<GlobalsAA>();
PA.preserve<MemoryDependenceAnalysis>();
return PA;
}
namespace {