)]}'
{
  "commit": "c8d065bf914d7c8feb06aa7978fe43b2a800b17f",
  "tree": "1d6191391520ea0576211c4d7fe52ce3d7f3264b",
  "parents": [
    "ef1539c1d4e205b05bd8662c9d4e90382d2381a5"
  ],
  "author": {
    "name": "Florian Hahn",
    "email": "flo@fhahn.com",
    "time": "Fri Sep 05 15:51:54 2025 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Sep 05 14:51:54 2025 +0000"
  },
  "message": "[Clang] Allow non-constant sizes for __builtin_assume_dereferenceable. (#156929)\n\nUpdate Clang\u0027s __builtin_assume_dereferenceable to support non-constant\nlengths. The corresponding assume bundle has been updated to support\nnon-constant sizes in cad62df49a7.\n\nThe current docs for the builtin don\u0027t mention the constant requirement\nfor the size argument, so don\u0027t need to be updated:\nhttps://clang.llvm.org/docs/LanguageExtensions.html#builtin-assume-dereferenceable\n\nA number of patches landed recently to make the optimizer make better\nuse of the dereferenceable assumptions, and once\nhttps://github.com/llvm/llvm-project/pull/156730 lands, it can be used\nto vectorize some early-exit loops, for example std::find with\nstd::vector::iterator: https://godbolt.org/z/qo58PKG37\n```\n  #include \u003calgorithm\u003e\n  #include \u003ccstddef\u003e\n  #include \u003cvector\u003e\n\n  auto find(std::vector\u003cshort\u003e::iterator first, short s, unsigned size) {\n    auto Addr \u003d __builtin_assume_aligned(std::to_address(first),  2);\n    __builtin_assume_dereferenceable(std::to_address(first), size * sizeof(short));\n    return std::find(first, first + size, s);\n  }\n```\n\nPR: https://github.com/llvm/llvm-project/pull/156929",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8522f4123cd97f5626ecb1878cbc53ba9b876b6f",
      "old_mode": 33188,
      "old_path": "clang/docs/ReleaseNotes.rst",
      "new_id": "8720262c33959227deddfe28bad85625c645fdd9",
      "new_mode": 33188,
      "new_path": "clang/docs/ReleaseNotes.rst"
    },
    {
      "type": "modify",
      "old_id": "27fc6f008d743d0cafaf97d5425dff0e0ce7f90b",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Basic/Builtins.td",
      "new_id": "27639f06529cb6e3a9f445b3d11348e8fe64ec59",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Basic/Builtins.td"
    },
    {
      "type": "modify",
      "old_id": "cadffd4a84c26489f8733636aef9c6de71618632",
      "old_mode": 33188,
      "old_path": "clang/test/CodeGen/builtin-assume-dereferenceable.c",
      "new_id": "0dc4ba089ee3a418fb41501bf0da2c67c690739b",
      "new_mode": 33188,
      "new_path": "clang/test/CodeGen/builtin-assume-dereferenceable.c"
    },
    {
      "type": "modify",
      "old_id": "b79b7c059567e17f82b59a34f8d23e00874a5fd7",
      "old_mode": 33188,
      "old_path": "clang/test/SemaCXX/builtin-assume-dereferenceable.cpp",
      "new_id": "2cbd7ac3507bfced68b1b549666221d2b7a8f08c",
      "new_mode": 33188,
      "new_path": "clang/test/SemaCXX/builtin-assume-dereferenceable.cpp"
    }
  ]
}
