[PATCH] D65350: [DDG] Data Dependence Graph Basics

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 07:15:22 PDT 2019


bmahjour marked an inline comment as done.
bmahjour added a comment.

In D65350#1652123 <https://reviews.llvm.org/D65350#1652123>, @fhahn wrote:

> In D65350#1639499 <https://reviews.llvm.org/D65350#1639499>, @bmahjour wrote:
>
> > In D65350#1636205 <https://reviews.llvm.org/D65350#1636205>, @fhahn wrote:
> >
> > > > This patch contains support for a basic DDGs containing only atomic nodes (one node for each instruction). The edges are two fold: def-use edges and memory-dependence edges. The idea behind the DependenceGraphBuilder and why we need it are summarized in https://ibm.ent.box.com/v/directed-graph-and-ddg.
> > >
> > > I think it would be good to summarize the information in-tree as well, to ensure the information is accessible later on as well. Some of the docs fit in the headers, for some of it a new documentation page might be worth adding. Ideally it would include some info about  design decisions, the intended/example uses cases and how the DDG helps and the benefits over the existing infrastructure.
> >
> >
> > Sure I can create a page or two of documentation, however I'm not very familiar with the doc infrastructure in LLVM. Could you point me to some examples to follow? Would an rts file under llvm/docs/DDG be sufficient? Are they rendered by any tool and if so how can I test it?
> >
> > > 
>
>
> Great thanks! Yep adding a .rts should be sufficient.  I think you need sphinx installed to build the docs and set `LLVM_BUILD_DOCS`.


No Problem. Thank you for bringing it up. The latest uploaded patch contains the .rst and the relevant images.

@fhahn @Meinersbur If there are no further comments I'd appreciate an approval so we can move on to the next patches. Thanks.



================
Comment at: llvm/include/llvm/Analysis/DDG.h:199
+  // queried it is recomputed using @DI.
+  const DependenceInfo DI;
+};
----------------
fhahn wrote:
> bmahjour wrote:
> > fhahn wrote:
> > > Why do we need a copy here? Wouldn't a reference be enough?
> > The reason is that the target of the reference may go out of scope, while the DDG (as an analysis result) lives on. For instance if you look at `DDGAnalysis::run`, an object of `DependenceInfo` is created inside the function which is used to construct the DDG. The function returns a unique_ptr to that DDG. The DDG lives on and needs to answer queries about the dependencies, while the `DependenceInfo` object is local to the function and gets destroyed upon return of the `run` function. 
> Ah right, it's unfortunate that the new pass manager does not really allow to get DI easily from a loop pass. I might be worth moving the DI into DependenceInfo, to make the ownership a bit more explicit.
> might be worth moving the DI into DependenceInfo, to make the ownership a bit more explicit.
I'm not sure what you mean by moving the DI into DependenceInfo. Could you please clarify?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65350/new/

https://reviews.llvm.org/D65350





More information about the llvm-commits mailing list