)]}'
{
  "commit": "3e05ab6322cbf2a96362dcacb5907ba519fe552d",
  "tree": "1f85d2e4b011ff5cde05bddf65c2a002c1ea22f1",
  "parents": [
    "e317f424557cbf76deaa568ab8a5416822453d50"
  ],
  "author": {
    "name": "yonghong-song",
    "email": "yhs@fb.com",
    "time": "Sat Feb 28 12:44:25 2026 -0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sat Feb 28 12:44:25 2026 -0800"
  },
  "message": "[ThinLTO] Reduce the number of renaming due to promotions (#183793)\n\nCurrently for thin-lto, the imported static global values (functions,\nvariables, etc) will be promoted/renamed from e.g., foo() to\nfoo.llvm.(). Such a renaming caused difficulties in live patching\nsince function name is changed ([1]).\n\nIt is possible that some global value names have to be promoted to avoid\nname collision and linker failure. But in practice, majority of name\npromotions can be avoided.\n\nIn [2], the suggestion is that thin-lto pre-link decides whether\na particular global value needs name promotion or not. If yes, later on\nin thinBackend() the name will be promoted.\n\nI compiled a particular linux kernel version (latest bpf-next tree)\nand found 1216 global values with suffix .llvm.. With this patch,\nthe number of promoted functions is 2, 98% reduction from the\noriginal kernel build.\n\nIf some native objects are not participating with LTO, name promotions\nhave to be done to avoid potential linker issues. So the current\nimplementation cannot be on by default. But in certain cases, e.g., linux kernel\nbuild, people can enable lld flag --lto-whole-program-visibility to reduce the\nnumber of functions like foo.llvm.().\n\nFor ThinLTOCodeGenerator.cpp which is used by llvm-lto tool and a\nfew other rare cases, reducing the number of renaming due to promotion,\nis not implemented as lld flag \u0027-lto-whole-program-visibility\u0027 is not\nsupported in ThinLTOCodeGenerator.cpp for now. In summary, this pull\nrequest only supports llvm-lto2 style workflow.\n\nThe feature is off by default. To enable the future, lld flag\n\u0027-lto-whole-program-visibility\u0027  and llvm flag\n\u0027-always-rename-promoted-locals\u003dfalse\u0027 are needed.\n\nThe link [3] has more context for the pull request discussions.\n\n[1] https://lpc.events/event/19/contributions/2212\n[2] https://discourse.llvm.org/t/rfc-avoid-functions-like-foo-llvm-for-kernel-live-patch/89400\n[3] https://github.com/llvm/llvm-project/pull/178587",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a5792eee8abfb8e1ed72ec9e3876c2c6944558b9",
      "old_mode": 33188,
      "old_path": "clang/test/CodeGen/distributed-thin-lto/cfi-devirt.ll",
      "new_id": "14938cbaa465bf30aeeb326c43e3d58d304700f5",
      "new_mode": 33188,
      "new_path": "clang/test/CodeGen/distributed-thin-lto/cfi-devirt.ll"
    },
    {
      "type": "modify",
      "old_id": "696f2dc4ea63418dc95269a30c76a2619ba31fdb",
      "old_mode": 33188,
      "old_path": "clang/test/CodeGen/distributed-thin-lto/cfi.ll",
      "new_id": "585602d43c79d72a25f9f3ce6ca4c52b1bb93e2f",
      "new_mode": 33188,
      "new_path": "clang/test/CodeGen/distributed-thin-lto/cfi.ll"
    },
    {
      "type": "modify",
      "old_id": "daaa6e2da804867c0a11db9a4f5a62ddfcbbbb3c",
      "old_mode": 33188,
      "old_path": "clang/test/CodeGen/thinlto-funcattr-prop.ll",
      "new_id": "e5f39ddd58a4fe962c1e72b733913e83ce920029",
      "new_mode": 33188,
      "new_path": "clang/test/CodeGen/thinlto-funcattr-prop.ll"
    },
    {
      "type": "modify",
      "old_id": "928da5c82e518e7c06ac7846df210438d84216f3",
      "old_mode": 33188,
      "old_path": "lld/test/ELF/lto/comdat-nodeduplicate.ll",
      "new_id": "96a78aa175e41738e7fd82744df304925e75d71a",
      "new_mode": 33188,
      "new_path": "lld/test/ELF/lto/comdat-nodeduplicate.ll"
    },
    {
      "type": "modify",
      "old_id": "5d5d70f89bde5f9ae460ba489a473776c28e5bde",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/AsmParser/LLToken.h",
      "new_id": "6c92c82188f1a813a932a1902b52196dccc63532",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/AsmParser/LLToken.h"
    },
    {
      "type": "modify",
      "old_id": "5ede26cc7923c8c483820760cfc1a3b3ff795b1e",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/IR/ModuleSummaryIndex.h",
      "new_id": "b0b5ef9908a5e14524489b205bea1f7d78c9b9ed",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/IR/ModuleSummaryIndex.h"
    },
    {
      "type": "modify",
      "old_id": "ccb77e75492afe074558bc417d0e6b44971457b4",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/IR/ModuleSummaryIndexYAML.h",
      "new_id": "d374e2eeb24a62f0a8e577932a4d80cc1b318bd6",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/IR/ModuleSummaryIndexYAML.h"
    },
    {
      "type": "modify",
      "old_id": "3e877d22c3f6c5a9b7aeb087865767b26a77b627",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/LTO/LTO.h",
      "new_id": "38349b604b6b39af8444340718bd635f35dd37bc",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/LTO/LTO.h"
    },
    {
      "type": "modify",
      "old_id": "2e33a4098be1b3fb8f9bed29c795d7b2ccbe3c0a",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h",
      "new_id": "ba0b22b799ebe9fa144cf2626d09446447b12e90",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h"
    },
    {
      "type": "modify",
      "old_id": "c4c7b403bed861863a45844ded06956ed1853db9",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h",
      "new_id": "e22bea53a18a6c301f454548db1d1a7b7d787237",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h"
    },
    {
      "type": "modify",
      "old_id": "069f4ae1790b1dbf8e60754d2eba3272edbbc74c",
      "old_mode": 33188,
      "old_path": "llvm/lib/Analysis/ModuleSummaryAnalysis.cpp",
      "new_id": "f504519ebb5a60d871ad76d1d02d02bba9c7ac3f",
      "new_mode": 33188,
      "new_path": "llvm/lib/Analysis/ModuleSummaryAnalysis.cpp"
    },
    {
      "type": "modify",
      "old_id": "8d20ff72a8505e67d2cd6e76259693b5b51ab582",
      "old_mode": 33188,
      "old_path": "llvm/lib/AsmParser/LLLexer.cpp",
      "new_id": "4840d04f6b78ddf8bb0d3d488d768430b65b3116",
      "new_mode": 33188,
      "new_path": "llvm/lib/AsmParser/LLLexer.cpp"
    },
    {
      "type": "modify",
      "old_id": "09b030b28dce83f0edb323fa11772c06d0de9ea3",
      "old_mode": 33188,
      "old_path": "llvm/lib/AsmParser/LLParser.cpp",
      "new_id": "551b88d8b435b3a120145d272c4564fabed9eb44",
      "new_mode": 33188,
      "new_path": "llvm/lib/AsmParser/LLParser.cpp"
    },
    {
      "type": "modify",
      "old_id": "c0807c7be3e4fa32c8baf8ad2130aca0b0698eb8",
      "old_mode": 33188,
      "old_path": "llvm/lib/Bitcode/Reader/BitcodeReader.cpp",
      "new_id": "a781a43112f8cddecf74b4030ce1c9a4a4715e6c",
      "new_mode": 33188,
      "new_path": "llvm/lib/Bitcode/Reader/BitcodeReader.cpp"
    },
    {
      "type": "modify",
      "old_id": "cc0491bd8577fb800f15e0a2cb98cd17ab6c002b",
      "old_mode": 33188,
      "old_path": "llvm/lib/Bitcode/Writer/BitcodeWriter.cpp",
      "new_id": "f0316116d010782cb748fbc45bed9bbce4f14811",
      "new_mode": 33188,
      "new_path": "llvm/lib/Bitcode/Writer/BitcodeWriter.cpp"
    },
    {
      "type": "modify",
      "old_id": "35a19091aa097da3bde3bd4413204b0b5946e2a3",
      "old_mode": 33188,
      "old_path": "llvm/lib/IR/AsmWriter.cpp",
      "new_id": "dd99b14d45d6ee12230d93a3fd869980425ea4f5",
      "new_mode": 33188,
      "new_path": "llvm/lib/IR/AsmWriter.cpp"
    },
    {
      "type": "modify",
      "old_id": "9a3bb970494a2ae37f33f38db68dd6e45543beed",
      "old_mode": 33188,
      "old_path": "llvm/lib/IR/ModuleSummaryIndex.cpp",
      "new_id": "98876c87ef6dbd9f1b51b7970da160c1b6f08794",
      "new_mode": 33188,
      "new_path": "llvm/lib/IR/ModuleSummaryIndex.cpp"
    },
    {
      "type": "modify",
      "old_id": "853f6427f9c8c2804eae833699c1b54cc8767cc2",
      "old_mode": 33188,
      "old_path": "llvm/lib/LTO/LTO.cpp",
      "new_id": "bf2d2e6b9da9dd9f5e5e12decab59d76bf7a634c",
      "new_mode": 33188,
      "new_path": "llvm/lib/LTO/LTO.cpp"
    },
    {
      "type": "modify",
      "old_id": "8c2420a45a24cb27d123c7c37e27e76ca324183b",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp",
      "new_id": "e0577612567754df03595a38e5a8709e22ff2a16",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp"
    },
    {
      "type": "modify",
      "old_id": "d31154fcf085d9e6c31fd7c6d8d32655b4d940aa",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Utils/FunctionImportUtils.cpp",
      "new_id": "475699c42b21ebf412a49eab9d05bdc85941b035",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Utils/FunctionImportUtils.cpp"
    },
    {
      "type": "modify",
      "old_id": "4e4a928c1f0248c9d2d85e9a2513f2234f969b7d",
      "old_mode": 33188,
      "old_path": "llvm/test/Assembler/thinlto-memprof-summary.ll",
      "new_id": "225fda60f8550648a78acaff04c7949cfd758bce",
      "new_mode": 33188,
      "new_path": "llvm/test/Assembler/thinlto-memprof-summary.ll"
    },
    {
      "type": "modify",
      "old_id": "117280a279d09f71b546a17709b6353ff85e95c6",
      "old_mode": 33188,
      "old_path": "llvm/test/Assembler/thinlto-multiple-summaries-for-guid.ll",
      "new_id": "83e0c8cbc8a138668296f9da94eec9010f1aacc7",
      "new_mode": 33188,
      "new_path": "llvm/test/Assembler/thinlto-multiple-summaries-for-guid.ll"
    },
    {
      "type": "modify",
      "old_id": "67ddcb961d7ae999eec5098e8d183d0c599fcc5e",
      "old_mode": 33188,
      "old_path": "llvm/test/Assembler/thinlto-summary-visibility.ll",
      "new_id": "08f7d06433505c9a3a5dfd28c0c083e58b423bb4",
      "new_mode": 33188,
      "new_path": "llvm/test/Assembler/thinlto-summary-visibility.ll"
    },
    {
      "type": "modify",
      "old_id": "21da14850b962cf1c01dd26e1fc65820807d649a",
      "old_mode": 33188,
      "old_path": "llvm/test/Assembler/thinlto-summary.ll",
      "new_id": "5b907f9a06039acf03ad3b23287893a352977fdb",
      "new_mode": 33188,
      "new_path": "llvm/test/Assembler/thinlto-summary.ll"
    },
    {
      "type": "modify",
      "old_id": "80720287f7a0916e6e08b64d70b699653ac11582",
      "old_mode": 33188,
      "old_path": "llvm/test/Assembler/thinlto-vtable-summary.ll",
      "new_id": "7b8e4f2a928a4b621524352a131d233db58a0d14",
      "new_mode": 33188,
      "new_path": "llvm/test/Assembler/thinlto-vtable-summary.ll"
    },
    {
      "type": "modify",
      "old_id": "7deb2d8259e328d098bb3a47e807658925849b5f",
      "old_mode": 33188,
      "old_path": "llvm/test/Bitcode/thinlto-alias.ll",
      "new_id": "4191983055b2c196b5f6a60b8ae3b5b1daa00c3a",
      "new_mode": 33188,
      "new_path": "llvm/test/Bitcode/thinlto-alias.ll"
    },
    {
      "type": "modify",
      "old_id": "576261e5392b219eb903d8a3236ae0c04fde3082",
      "old_mode": 33188,
      "old_path": "llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll",
      "new_id": "33288be2d2195045f4066b34b96e7ef6a3829e64",
      "new_mode": 33188,
      "new_path": "llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll"
    },
    {
      "type": "modify",
      "old_id": "22e27c45324af1ac8c7f3549d2e615df85b16f5f",
      "old_mode": 33188,
      "old_path": "llvm/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll",
      "new_id": "d50bad6cbc12844edc0e4a08535d79c301bafbc4",
      "new_mode": 33188,
      "new_path": "llvm/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll"
    },
    {
      "type": "modify",
      "old_id": "c76d70b8c4cc00f4d3d2d2e87004bd236af02a1b",
      "old_mode": 33188,
      "old_path": "llvm/test/Bitcode/thinlto-function-summary-refgraph.ll",
      "new_id": "a25901a572d3035a18c510696128a8958673e42e",
      "new_mode": 33188,
      "new_path": "llvm/test/Bitcode/thinlto-function-summary-refgraph.ll"
    },
    {
      "type": "modify",
      "old_id": "3f71a3dfe0591c8abef4840d07d9c5ac3536a854",
      "old_mode": 33188,
      "old_path": "llvm/test/Bitcode/thinlto-index-disassembled-by-llvm-dis.ll",
      "new_id": "74980ad76304cc171a256f54a778cc0f0eda02b9",
      "new_mode": 33188,
      "new_path": "llvm/test/Bitcode/thinlto-index-disassembled-by-llvm-dis.ll"
    },
    {
      "type": "modify",
      "old_id": "6dc49b849c2fe44d73500335e6eb9294f0753878",
      "old_mode": 33188,
      "old_path": "llvm/test/Bitcode/thinlto-type-tests.ll",
      "new_id": "6d329d5bce9499a9a1010bc13a22fcf8511e4a6a",
      "new_mode": 33188,
      "new_path": "llvm/test/Bitcode/thinlto-type-tests.ll"
    },
    {
      "type": "modify",
      "old_id": "16c93097101dfb92ff0d34917e2feeb619be9a13",
      "old_mode": 33188,
      "old_path": "llvm/test/Bitcode/thinlto-type-vcalls.ll",
      "new_id": "f10f6535c7f08e7b86da571ca079051f06a29664",
      "new_mode": 33188,
      "new_path": "llvm/test/Bitcode/thinlto-type-vcalls.ll"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5906da234b19911c89b9c162d7096ccdc3b0e68f",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/Inputs/reduce-promotion-same-file-local-name.ll"
    },
    {
      "type": "modify",
      "old_id": "abfe820075bb9f1b6fc27d92cc186a043df1a8d4",
      "old_mode": 33188,
      "old_path": "llvm/test/ThinLTO/X86/funcattrs-prop-maythrow.ll",
      "new_id": "5475ca1bf1d44ad58c13dcf6a70eaa774647ccda",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/funcattrs-prop-maythrow.ll"
    },
    {
      "type": "modify",
      "old_id": "67acc2a2892dbeff44223e1a54a8d17d74edcc43",
      "old_mode": 33188,
      "old_path": "llvm/test/ThinLTO/X86/funcimport_alwaysinline.ll",
      "new_id": "431e2a9254887ea70c01ee8ee1fbb617268a2799",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/funcimport_alwaysinline.ll"
    },
    {
      "type": "modify",
      "old_id": "72550fa4d6f0b2f14712465461da7ecec3bb74c7",
      "old_mode": 33188,
      "old_path": "llvm/test/ThinLTO/X86/import_callee_declaration.ll",
      "new_id": "c1b09c5b42fa9a9a955bfed069d8d6bba068588c",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/import_callee_declaration.ll"
    },
    {
      "type": "modify",
      "old_id": "b25308bf176168138b90793aea661e83639ac73e",
      "old_mode": 33188,
      "old_path": "llvm/test/ThinLTO/X86/load-store-caching.ll",
      "new_id": "85156881f0429b1b85abc1522fec51da0dc52d0a",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/load-store-caching.ll"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f9d26e7829fd9f09be20ea5b7e6b97ab98d7909f",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/reduce-promotion-devirt.ll"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cc7596c2fb385463b8505f51303828cc53959782",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/reduce-promotion-same-file-local-name.ll"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9ddcae6e7bc6dfad96d8663b4f989bf80ed9b773",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/reduce-promotion-same-local-name.ll"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e8900c365675b62f713c285c2285fe60287d06d5",
      "new_mode": 33188,
      "new_path": "llvm/test/ThinLTO/X86/reduce-promotion.ll"
    },
    {
      "type": "modify",
      "old_id": "f766c2d324163ec7e1e4f2d0cd661b4b32c2c956",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/LowerTypeTests/import-unsat.ll",
      "new_id": "578e7db70675c04c92436c7a4794dc0ff4bb76ce",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/LowerTypeTests/import-unsat.ll"
    },
    {
      "type": "modify",
      "old_id": "22533ed636a50a3f78df9c9a36e0745efb3e7c9f",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/WholeProgramDevirt/Inputs/import-indir.yaml",
      "new_id": "c7049f1126c5daed635da524a758a1b9bf047871",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/WholeProgramDevirt/Inputs/import-indir.yaml"
    },
    {
      "type": "modify",
      "old_id": "2c33059b6e126f389a771f704fd3562aa5053535",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/WholeProgramDevirt/import-indir.ll",
      "new_id": "7ef9e77808153e0c6ea3298ee97cb4b5bc1eaaa9",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/WholeProgramDevirt/import-indir.ll"
    }
  ]
}
