[PM] Preserve the correct set of analyses for GVN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271934 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano 2016-06-06 20:01:50 +00:00
parent d4b932e94b
commit 3ff92c7452

View File

@ -594,7 +594,12 @@ PreservedAnalyses GVN::run(Function &F, AnalysisManager<Function> &AM) {
auto &AA = AM.getResult<AAManager>(F);
auto &MemDep = AM.getResult<MemoryDependenceAnalysis>(F);
bool Changed = runImpl(F, AC, DT, TLI, AA, &MemDep);
return Changed ? PreservedAnalyses::none() : PreservedAnalyses::all();
if (!Changed)
return PreservedAnalyses::all();
PreservedAnalyses PA;
PA.preserve<DominatorTreeAnalysis>();
PA.preserve<GlobalsAA>();
return PA;
}
LLVM_DUMP_METHOD