[llvm] r290614 - [PM] Remove a pointless optimization.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 27 10:04:11 PST 2016


Author: chandlerc
Date: Tue Dec 27 12:04:11 2016
New Revision: 290614

URL: http://llvm.org/viewvc/llvm-project?rev=290614&view=rev
Log:
[PM] Remove a pointless optimization.

There is no need to do this within an analysis. That method shouldn't
even be reached if this predicate holds as the actual useful
optimization is in the analysis manager itself.

Modified:
    llvm/trunk/lib/Analysis/AliasAnalysis.cpp
    llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=290614&r1=290613&r2=290614&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Dec 27 12:04:11 2016
@@ -72,9 +72,6 @@ AAResults::~AAResults() {
 
 bool AAResults::invalidate(Function &F, const PreservedAnalyses &PA,
                            FunctionAnalysisManager::Invalidator &Inv) {
-  if (PA.areAllPreserved())
-    return false; // Nothing to do, everything is still valid.
-
   // Check if the AA manager itself has been invalidated.
   auto PAC = PA.getChecker<AAManager>();
   if (!PAC.preserved() && !PAC.preservedSet<AllAnalysesOn<Function>>())

Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=290614&r1=290613&r2=290614&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Dec 27 12:04:11 2016
@@ -65,9 +65,6 @@ static const unsigned MaxLookupSearchDep
 
 bool BasicAAResult::invalidate(Function &F, const PreservedAnalyses &PA,
                                FunctionAnalysisManager::Invalidator &Inv) {
-  if (PA.areAllPreserved())
-    return false; // Nothing to do, everything is still valid.
-
   // We don't care if this analysis itself is preserved, it has no state. But
   // we need to check that the analyses it depends on have been. Note that we
   // may be created without handles to some analyses and in that case don't




More information about the llvm-commits mailing list