================ @@ -223,10 +249,31 @@ class StaleMatcher { return Hash1.InstrHash == Hash2.InstrHash; } + /// Returns true if a profiled block was matched with its pseudo probe. + bool isPseudoProbeMatch(BlendedBlockHash YamlBBHash) { + return MatchedWithPseudoProbes.find(YamlBBHash.combine()) != + MatchedWithPseudoProbes.end(); + } + + /// Returns the number of blocks matched with opcodes. + size_t getNumBlocksMatchedWithOpcodes() const { return MatchedWithOpcodes; } + + /// Returns the number of blocks matched with pseudo probes. + size_t getNumBlocksMatchedWithPseudoProbes() const { + return MatchedWithPseudoProbes.size(); + } + private: using HashBlockPairType = std::pair<BlendedBlockHash, FlowBlock *>; std::unordered_map<uint16_t, std::vector<HashBlockPairType>> OpHashToBlocks; std::unordered_map<uint64_t, std::vector<HashBlockPairType>> CallHashToBlocks; + std::unordered_map<uint64_t, std::vector<const MCDecodedPseudoProbe *>> ---------------- WenleiHe wrote:
@dcci DenseMap or LLVM ADT isn't generally better. we have a ton of undered_map throughout the code base, and we have benchmarked some cases carefully between the two, and DenseMap sometimes uses a lot more memory, as a result many uses of undered_map were intentional. If memory is of a concern (probe decoding and holding probe forest generally isn't cheap), I'm not sure DenseMap will help us. https://github.com/llvm/llvm-project/pull/99891 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits