[PM] Introduce an analysis set used to preserve all analyses over

a function's CFG when that CFG is unchanged.

This allows transformation passes to simply claim they preserve the CFG
and analysis passes to check for the CFG being preserved to remove the
fanout of all analyses being listed in all passes.

I've gone through and removed or cleaned up as many of the comments
reminding us to do this as I could.

Differential Revision: https://reviews.llvm.org/D28627

llvm-svn: 292054
This commit is contained in:
Chandler Carruth
2017-01-15 06:32:49 +00:00
parent f1388ef006
commit ca68a3ec47
40 changed files with 182 additions and 73 deletions

View File

@@ -136,6 +136,8 @@ PreservedAnalyses InstSimplifierPass::run(Function &F,
bool Changed = runImpl(F, &DT, &TLI, &AC);
if (!Changed)
return PreservedAnalyses::all();
// FIXME: This should also 'preserve the CFG'.
return PreservedAnalyses::none();
PreservedAnalyses PA;
PA.preserveSet<CFGAnalyses>();
return PA;
}