[PATCH] D27243: Initial work on the XRay Graph tool.

Alexis Shaw via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 14:50:03 PST 2016


varno marked 5 inline comments as done.
varno added inline comments.


================
Comment at: tools/llvm-xray/xray-graph.cc:221-228
+  std::vector<uint64_t> Timings;
+  for (auto &V : IncommingEdges) {
+    for (auto &P : V.second) {
+      Timings.insert(Timings.begin(), P->Timings.begin(), P->Timings.end());
+    }
+    getStats(Timings.begin(), Timings.end(), VertexAttrs[V.first].S);
+    Timings.clear();
----------------
dberris wrote:
> dberris wrote:
> > Is there no way to do this in a single pass, in the same loop above? I could imagine building a map that contains a vertex as the key, then accumulating statistics as you go traversing the graph (or even just storing the data anyway like you do here for the timings), and another pass to collapse that data.
> It's thoroughly confusing too that you're using Timings here, but there's a data member named Timings as well. :)
Really not, the way here has linear space and uses the required memory for each section. If we did not care about memory I could store the accumulation data for both edges and vertices. but otherwise ???


https://reviews.llvm.org/D27243





More information about the llvm-commits mailing list