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

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 27 10:20:18 PST 2016


On Tue, Dec 27, 2016 at 10:04 AM, Chandler Carruth via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> 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.
> -

Random thought: if you enforce the invariant that
AAResult::invalidate() is never called when all the analysis have been
preserved maybe the check can be turned into an assertion?

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list