[PATCH] D92334: [CSSPGO][llvm-profgen] Pseudo probe decoding and disassembling

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 10:47:25 PST 2020


wlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/PseudoProbe.h:41
+// Use func GUID and index as the location info of the inline site
+struct InlineSite {
+  uint64_t GUID = 0;
----------------
hoy wrote:
> May just use `std::pair' which has predefined hash and equal operators?
Seems `std::pair` only support std::map predefine comparator, has to define the hash operator for unordered_map,
so it will be like:

```
using InlineSite = std::pair<uint64_t, uint64_t>;
 struct InlineSiteHash {
    uint64_t operator()(const InlineSite &Site) const {
      return Site.first^ Site.second;
    }
  };
  std::unordered_map<InlineSite, std::unique_ptr<PseudoProbeInlineTree>,
                     InlineSiteHash>    Children;

```
is that what you think?


================
Comment at: llvm/tools/llvm-profgen/PseudoProbe.h:183
+  /// SectionName used for debug
+  std::string SectionName;
+
----------------
hoy wrote:
> Make it a debug field? i.,e under #ifndef NDEBUG.
debug macro added, thanks for your suggestions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92334



More information about the llvm-commits mailing list