[llvm] r271303 - [PM] ADCE: Fix caching of analyses.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Tue May 31 10:39:40 PDT 2016
Author: davide
Date: Tue May 31 12:39:39 2016
New Revision: 271303
URL: http://llvm.org/viewvc/llvm-project?rev=271303&view=rev
Log:
[PM] ADCE: Fix caching of analyses.
When this pass was originally ported, AA wasn't available for the
new PM. Now it is, so we can cache properly.
Modified:
llvm/trunk/lib/Transforms/Scalar/ADCE.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=271303&r1=271302&r2=271303&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Tue May 31 12:39:39 2016
@@ -146,9 +146,14 @@ static bool aggressiveDCE(Function& F) {
}
PreservedAnalyses ADCEPass::run(Function &F) {
- if (aggressiveDCE(F))
- return PreservedAnalyses::none();
- return PreservedAnalyses::all();
+ if (!aggressiveDCE(F))
+ return PreservedAnalyses::all();
+
+ // FIXME: ADCE 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