)]}'
{
  "commit": "76dd742f7b32e4d3acf50fab1dbbd897f215837e",
  "tree": "7615d664966b39302c45ff409448013047b288e6",
  "parents": [
    "bad3df476457db2fd7dd36729c47fb1d2bddad3a"
  ],
  "author": {
    "name": "Zhaoxuan Jiang",
    "email": "jiangzhaoxuan94@gmail.com",
    "time": "Fri Aug 15 04:49:09 2025 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Aug 14 13:49:09 2025 -0700"
  },
  "message": "[CGData] Lazy loading support for stable function map (#151660)\n\nThe stable function map could be huge for a large application. Fully\nloading it is slow and consumes a significant amount of memory, which is\nunnecessary and drastically slows down compilation especially for\nnon-LTO and distributed-ThinLTO setups. This patch introduces an opt-in\nlazy loading support for the stable function map. The detailed changes\nare:\n\n- `StableFunctionMap`\n- The map now stores entries in an `EntryStorage` struct, which includes\noffsets for serialized entries and a `std::once_flag` for thread-safe\nlazy loading.\n- The underlying map type is changed from `DenseMap` to\n`std::unordered_map` for compatibility with `std::once_flag`.\n- `contains()`, `size()` and `at()` are implemented to only load\nrequested entries on demand.\n\n- Lazy Loading Mechanism\n- When reading indexed codegen data, if the newly-introduced\n`-indexed-codegen-data-lazy-loading` flag is set, the stable function\nmap is not fully deserialized up front. The binary format for the stable\nfunction map now includes offsets and sizes to support lazy loading.\n- The safety of lazy loading is guarded by the once flag per function\nhash. This guarantees that even in a multi-threaded environment, the\ndeserialization for a given function hash will happen exactly once. The\nfirst thread to request it performs the load, and subsequent threads\nwill wait for it to complete before using the data. For single-threaded\nbuilds, the overhead is negligible (a single check on the once flag).\nFor multi-threaded scenarios, users can omit the flag to retain the\nprevious eager-loading behavior.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "38b96b72ccac6b85fdebc3797af32c9a95ffead8",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/CGData/CodeGenData.h",
      "new_id": "e44497a40824515a1078baaa3693e641346a2c03",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/CGData/CodeGenData.h"
    },
    {
      "type": "modify",
      "old_id": "94de4c0b017a2aaad578aeff7bde8c118de0b064",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/CGData/CodeGenData.inc",
      "new_id": "d5fbe2fb97718247f0a9455ed425cfb927284caf",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/CGData/CodeGenData.inc"
    },
    {
      "type": "modify",
      "old_id": "bcb72e82169733b361718f6d5037a3e9614e58ef",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/CGData/StableFunctionMap.h",
      "new_id": "ea3523c3a32993f4979702e421909dfb854de4bb",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/CGData/StableFunctionMap.h"
    },
    {
      "type": "modify",
      "old_id": "a75cb12a70ba66bc91cd86781c90217c75cdb123",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/CGData/StableFunctionMapRecord.h",
      "new_id": "2d8b573a3cb467cd3cc0ba6803398d988c463a39",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/CGData/StableFunctionMapRecord.h"
    },
    {
      "type": "modify",
      "old_id": "cd012342e1958f2ab5a4f54380430a5c751ffc8a",
      "old_mode": 33188,
      "old_path": "llvm/lib/CGData/CodeGenData.cpp",
      "new_id": "b4f08c3d13b0dd38eb28cfc8c20de180e2df75f5",
      "new_mode": 33188,
      "new_path": "llvm/lib/CGData/CodeGenData.cpp"
    },
    {
      "type": "modify",
      "old_id": "0ab35499c89861a738f8b3755d8b4dfb13f5a509",
      "old_mode": 33188,
      "old_path": "llvm/lib/CGData/CodeGenDataReader.cpp",
      "new_id": "fc59be8df525a6dc8f0047f9231a2c383e9cc072",
      "new_mode": 33188,
      "new_path": "llvm/lib/CGData/CodeGenDataReader.cpp"
    },
    {
      "type": "modify",
      "old_id": "87f1e76afb60bb5deb37f0e7e30d4dd0fa4f7ab1",
      "old_mode": 33188,
      "old_path": "llvm/lib/CGData/StableFunctionMap.cpp",
      "new_id": "2f54fad0aa0844b24d3d07c7bb455f2e7166163f",
      "new_mode": 33188,
      "new_path": "llvm/lib/CGData/StableFunctionMap.cpp"
    },
    {
      "type": "modify",
      "old_id": "423e068023088ce196e0806ea023343a9afab437",
      "old_mode": 33188,
      "old_path": "llvm/lib/CGData/StableFunctionMapRecord.cpp",
      "new_id": "e585995ba6a314345ebea287391b07e3563103a0",
      "new_mode": 33188,
      "new_path": "llvm/lib/CGData/StableFunctionMapRecord.cpp"
    },
    {
      "type": "modify",
      "old_id": "73f11c1345dafc56595103f8375f0be080b6f7d4",
      "old_mode": 33188,
      "old_path": "llvm/lib/CodeGen/GlobalMergeFunctions.cpp",
      "new_id": "47640c4aac6df5ff114187a26ef220ec17238666",
      "new_mode": 33188,
      "new_path": "llvm/lib/CodeGen/GlobalMergeFunctions.cpp"
    },
    {
      "type": "modify",
      "old_id": "a4022eb885b43fb469e26ab73c989ad4d41a535b",
      "old_mode": 33188,
      "old_path": "llvm/test/ThinLTO/AArch64/cgdata-merge-write.ll",
      "new_id": "47042d23cc2ca602424ca36d60d52c616f799706",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/AArch64/cgdata-merge-write.ll"
    },
    {
      "type": "modify",
      "old_id": "0d2b0e848a2c97779f7e5f205232b067d7338fc4",
      "old_mode": 33188,
      "old_path": "llvm/test/tools/llvm-cgdata/empty.test",
      "new_id": "2082eca58f073d00b50af46e8049d0a6161abfa9",
      "new_mode": 33188,
      "new_path": "llvm/test/tools/llvm-cgdata/empty.test"
    },
    {
      "type": "modify",
      "old_id": "92ff484e31caf72f80d78537989de04ed87415b6",
      "old_mode": 33188,
      "old_path": "llvm/test/tools/llvm-cgdata/error.test",
      "new_id": "9484371848a728b44884d17b8a8c636e85dc230f",
      "new_mode": 33188,
      "new_path": "llvm/test/tools/llvm-cgdata/error.test"
    },
    {
      "type": "modify",
      "old_id": "b060872113b1ba8956b8aea85f52c216d2ebc44c",
      "old_mode": 33188,
      "old_path": "llvm/test/tools/llvm-cgdata/merge-combined-funcmap-hashtree.test",
      "new_id": "70b83af407e5ae84124382b9c838e0c8cb975262",
      "new_mode": 33188,
      "new_path": "llvm/test/tools/llvm-cgdata/merge-combined-funcmap-hashtree.test"
    },
    {
      "type": "modify",
      "old_id": "2936086321028d8382b9519da776ca51016cde1e",
      "old_mode": 33188,
      "old_path": "llvm/test/tools/llvm-cgdata/merge-funcmap-archive.test",
      "new_id": "c088ffbb4e83f1c8749699a98dec4b178b1c51b6",
      "new_mode": 33188,
      "new_path": "llvm/test/tools/llvm-cgdata/merge-funcmap-archive.test"
    },
    {
      "type": "modify",
      "old_id": "d2965456a19992e061ddaf18af6db210c74d0381",
      "old_mode": 33188,
      "old_path": "llvm/test/tools/llvm-cgdata/merge-funcmap-concat.test",
      "new_id": "90b5992973b4952343027e330b12f0bd2bbd9743",
      "new_mode": 33188,
      "new_path": "llvm/test/tools/llvm-cgdata/merge-funcmap-concat.test"
    },
    {
      "type": "modify",
      "old_id": "8277e3272d77e3619440ca6928dfb11cb2cd13fb",
      "old_mode": 33188,
      "old_path": "llvm/test/tools/llvm-cgdata/merge-funcmap-double.test",
      "new_id": "b986aef26f1d78f4b48393c47f5048d34861b1f3",
      "new_mode": 33188,
      "new_path": "llvm/test/tools/llvm-cgdata/merge-funcmap-double.test"
    },
    {
      "type": "modify",
      "old_id": "9469f1cbda331ca7d4905dd8780a8648ce53c13f",
      "old_mode": 33188,
      "old_path": "llvm/test/tools/llvm-cgdata/merge-funcmap-single.test",
      "new_id": "eac852ff7e7100c6d8b9cb9decaea036d3b36ed6",
      "new_mode": 33188,
      "new_path": "llvm/test/tools/llvm-cgdata/merge-funcmap-single.test"
    },
    {
      "type": "modify",
      "old_id": "8da933f744e87a43ccd08a6058c135120d93ce72",
      "old_mode": 33188,
      "old_path": "llvm/tools/llvm-cgdata/Opts.td",
      "new_id": "2b515a0140e67b3f5d2247b7ec5de0898c24a5a1",
      "new_mode": 33188,
      "new_path": "llvm/tools/llvm-cgdata/Opts.td"
    },
    {
      "type": "modify",
      "old_id": "98fa5c565735320a108608d17d231c05196293be",
      "old_mode": 33188,
      "old_path": "llvm/tools/llvm-cgdata/llvm-cgdata.cpp",
      "new_id": "047557e5a7fae920f993bda07f34fec3333befd1",
      "new_mode": 33188,
      "new_path": "llvm/tools/llvm-cgdata/llvm-cgdata.cpp"
    },
    {
      "type": "modify",
      "old_id": "d551ac8a814f4f35e8bc638f036d68f308ae44c6",
      "old_mode": 33188,
      "old_path": "llvm/unittests/CGData/StableFunctionMapTest.cpp",
      "new_id": "5cf62ae0b39435c4775a8e4ecb23f51cdfd87f30",
      "new_mode": 33188,
      "new_path": "llvm/unittests/CGData/StableFunctionMapTest.cpp"
    }
  ]
}
