[PATCH] D93556: [CSSPGO][llvm-profgen] Compress recursive cycles in calling context

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 16:10:42 PST 2021


wlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.h:108-110
+          // Populate the non-common-suffix part of the adjacent sequence.
+          std::copy(BeginIter + Right + 1, BeginIter + Left + I + 1,
+                    BeginIter + End);
----------------
wmi wrote:
> wlei wrote:
> > wmi wrote:
> > > Could you give an example of what the sequence looks like after the population?
> > Sure, an example is added in the code comments
> Thanks for the example. I can understand where are the redundent comparisons but I havn't understood how to skip the windows by doing the population (std::copy). I don't see the std::copy change anything for the example below. Could you clarify? 
> 
> Similarly I don't see how the duplicated str is removed from Context sequence when Duplication is found above (if (Right - Left == I) is true). Could you also clarify that?
Yeah, our original design is to use a new vector to store the compressed result, then we changed to use in-place algorithm to reduce the memcpy which make readability worse. 
rewrote the code comments, added another example, please see this version is clear or not?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93556



More information about the llvm-commits mailing list