[llvm] r271307 - [PM] BDCE: Fix caching of analyses.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Tue May 31 10:53:22 PDT 2016
Author: davide
Date: Tue May 31 12:53:22 2016
New Revision: 271307
URL: http://llvm.org/viewvc/llvm-project?rev=271307&view=rev
Log:
[PM] BDCE: Fix caching of analyses.
Another chapter in the story. GlobalsAA should be preserved, as
well as the CFG.
Modified:
llvm/trunk/lib/Transforms/Scalar/BDCE.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/BDCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/BDCE.cpp?rev=271307&r1=271306&r2=271307&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/BDCE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/BDCE.cpp Tue May 31 12:53:22 2016
@@ -71,9 +71,14 @@ static bool bitTrackingDCE(Function &F,
PreservedAnalyses BDCEPass::run(Function &F, FunctionAnalysisManager &AM) {
auto &DB = AM.getResult<DemandedBitsAnalysis>(F);
- if (bitTrackingDCE(F, DB))
- return PreservedAnalyses::none();
- return PreservedAnalyses::all();
+ if (!bitTrackingDCE(F, DB))
+ return PreservedAnalyses::all();
+
+ // FIXME: BDCE should also 'preserve the CFG'.
+ // The new pass manager has currently no way to do it.
+ auto PA = PreservedAnalyses();
+ PA.preserve<GlobalsAA>();
+ return PA;
}
namespace {
More information about the llvm-commits
mailing list