[PATCH] D10059: New alias analysis for static global variables

hfinkel at anl.gov hfinkel at anl.gov
Wed Jul 8 17:04:32 PDT 2015


hfinkel added a comment.

In http://reviews.llvm.org/D10059#200254, @samparker wrote:

> In http://reviews.llvm.org/D10059#200100, @hfinkel wrote:
>
> > In http://reviews.llvm.org/D10059#199160, @samparker wrote:
> >
> > > In http://reviews.llvm.org/D10059#198488, @hfinkel wrote:
> > >
> > > > In http://reviews.llvm.org/D10059#198472, @samparker wrote:
> > > >
> > > > > In http://reviews.llvm.org/D10059#198221, @hfinkel wrote:
> > > > >
> > > > > > In http://reviews.llvm.org/D10059#197850, @samparker wrote:
> > > > > >
> > > > > > > In http://reviews.llvm.org/D10059#197376, @hfinkel wrote:
> > > > > > >
> > > > > > > > In http://reviews.llvm.org/D10059#197018, @samparker wrote:
> > > > > > > >
> > > > > > > > > http://llvm.org/docs/AliasAnalysis.html#limitations
> > > > > > > >
> > > > > > > >
> > > > > > > > That's a bit misleading. You can preserve underlying AA passes (although not the AliasAnalysis analysis group itself). The problems is that if *any* pass does not preserve it, it will be invalidated, and nothing will cause it to be regenerated (unless it is inserted again specifically in the pass manager).
> > > > > > > >
> > > > > > > > The question here is: Do we have *any* passes in-tree that would not preserve the cache trivially?
> > > > > > >
> > > > > > >
> > > > > > > I'm not sure I follow. The immutable AA passes have no state so how are they invalidated, or does being an ImmutablePass mean that they always run?
> > > > > >
> > > > > >
> > > > > > An immutable pass is never invalidated and always available.
> > > > > >
> > > > > > > The previous patch used a ModulePass that created a cache, but was not actually queried unless run directly before some of the transformations, so how would you propose querying the cache once its created?
> > > > > >
> > > > > >
> > > > > > The reason it is only available when run directly before a transformation is because no transformation preserved the analysis, so it was always invalidated. If all transformations were marked as preserving the analysis then it would stick around.
> > > > >
> > > > >
> > > > > ok, thanks for the clarification. Would it be sensible to only mark the pass as preserved for the passes that already state they preserve the AliasAnalysis group? Then run the pass before these passes? Would this be accepted, it seems quite a departure from the current method?
> > > >
> > > >
> > > > No, I think we'd need to mark all passes, and just have it run once. But I don't think we have any passes that would not preserve this particular analysis, do we? They'd need to take the address of a global variable such that the address might no longer appear derived from the original global symbol. This is certainly possible to do, but I can't think of any transformation that would actually do this currently.
> > >
> > >
> > > Ok. I think the only problem is when global variables get split or renamed.
> >
> >
> > Can you be more specific. Since we have a conservative fallback for unknown globals, why are these a problem?
>
>
> Sorry, problem is probably the wrong word, the analysis pass just won't be as effective if it isn't updated when new global values are introduced.


Agreed; but I'm not sure we have passes that really do that. Do we?


http://reviews.llvm.org/D10059







More information about the llvm-commits mailing list