)]}'
{
  "commit": "1f38d49ebe96417e368a567efa4d650b8a9ac30f",
  "tree": "ff7f829fd5f3612983863236adfb80c16c395ef9",
  "parents": [
    "905ee4424d62f80a45f26ac03e29adf3bb7a6c85"
  ],
  "author": {
    "name": "Peter Collingbourne",
    "email": "pcc@google.com",
    "time": "Tue Nov 11 19:49:53 2025 -0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Nov 11 19:49:53 2025 -0800"
  },
  "message": "ValueMapper: Delete unused initializers of replaced appending globals.\n\nA full LTO link time performance and memory regression was introduced\nby #137081 in cases where the modules contain large quantities of llvm.used\nglobals. This was unnoticed because it was not expected that this would\nbe a typical case, but this is exactly what coverage collection does,\nand when this feature is enabled together with full LTO we end up with\nquadratic memory consumption (from the unused constants) and quadratic\ncomplexity in the function Verifier::visitGlobalValue (which visits all\nthe unused constants in the use list of each global value). This is a\ntargeted fix that avoids reintroducing the quadratic complexity from\nbefore #137081, by having ValueMapper delete the old initializer of an\nappending global if it is unused, instead of visiting every global in\nthe context after every link.\n\nThe repro-cfi-64 reproducer from #167037 before and after this change:\n\n```\n        Elapsed time   Max RSS (KB)\nBefore   12:05.11        52537184\nAfter     3:27.68         7520696\n```\n\nFixes #167037.\n\nReviewers: nikic, teresajohnson\n\nReviewed By: teresajohnson\n\nPull Request: https://github.com/llvm/llvm-project/pull/167629\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "17b5d4b89123045f88a457b7a4aed3e55d5ef77e",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/Transforms/Utils/ValueMapper.h",
      "new_id": "28c4ae840b29f4a666fc5492f687f24dd963c493",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/Transforms/Utils/ValueMapper.h"
    },
    {
      "type": "modify",
      "old_id": "f78d9b016d8c95a6b0c3da6190641e5e583d7d41",
      "old_mode": 33188,
      "old_path": "llvm/lib/Linker/IRMover.cpp",
      "new_id": "f215f39f41bfb6efa774235659ae03b65b2ba2b3",
      "new_mode": 33188,
      "new_path": "llvm/lib/Linker/IRMover.cpp"
    },
    {
      "type": "modify",
      "old_id": "8d8a60b6918fe875c407cfc69d44a68976dc7dd1",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Utils/ValueMapper.cpp",
      "new_id": "9021d8b289bafe7980e7a2591cc934f9238696c2",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Utils/ValueMapper.cpp"
    }
  ]
}
