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

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


On Tue, Dec 27, 2016 at 10:20 AM Davide Italiano <davide at freebsd.org> wrote:

> 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?
>

My thought is that it is more of an optimization than an invariant... but
I'm open to suggestions here. It just seems a bit weird to assert it as
nothing about the function fails to get the correct result either way...


>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161227/13de4a0c/attachment.html>


More information about the llvm-commits mailing list