[llvm-branch-commits] [BOLT] Emit intra-function control flow in YAMLBAT (PR #76911)

Rafael Auler via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 21 21:37:30 PDT 2024


================
@@ -128,6 +128,26 @@ class BoltAddressTranslation {
   /// Returns BB index by function output address (after BOLT) and basic block
   /// input offset.
   unsigned getBBIndex(uint64_t FuncOutputAddress, uint32_t BBInputOffset) const;
+
+  using BBHashMap = std::map<uint32_t, std::pair<unsigned, size_t>>;
+  /// Return a mapping from basic block input offset to hash and block index for a given function.
+  const BBHashMap &getBBHashMap(uint64_t OutputAddress) const {
+    return FuncHashes.at(OutputAddress).second;
----------------
rafaelauler wrote:

I realized you used "at" a number of times now in this stack of diffs. Isn't this supposed to throw exceptions? Isn't LLVM codebase exception free?

https://github.com/llvm/llvm-project/pull/76911


More information about the llvm-branch-commits mailing list