)]}'
{
  "commit": "06c1aa3ca74cf73df07d1ef3fff9b476e5aedaab",
  "tree": "cd355080c2004f5bf5d0505f5c0af2171f336a76",
  "parents": [
    "a044447a1ef8a02dce387e6837c967610b87c6e3"
  ],
  "author": {
    "name": "Weibo He",
    "email": "NewSigma@163.com",
    "time": "Tue Apr 14 17:31:15 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Apr 14 17:31:15 2026 +0800"
  },
  "message": "[CoroEarly][IR] Clarify semantic of llvm.coro.end (#191752)\n\nWe introduced a workaround for the following pattern in #139243:\n``` LLVM\ndefine void @fn() presplitcoroutine {\n  %__promise \u003d alloca ptr, align 8\n  ...\n\ncoro.ret:\n  call void @llvm.coro.end(ptr null, i1 false, token none)\n  store ptr null, ptr %__promise, align 8\n  ret void\n}\n```\nwhere DSE considers `__promise` dead after the return and eliminates the\nstore, leading to a miscompilation.\n\nHowever, after #151067, the problematic pattern is gone. And it\ncurrently looks like:\n``` LLVM\ngro.conv:\n  store ptr null, ptr %__promise, align 8\n  br label %after.gro.conv\n\nafter.gro.conv:\n  br i1 %body.done, label %coro.cleanup, label %coro.ret\n\ncoro.ret:\n  call void @llvm.coro.end(ptr null, i1 false, token none)\n  ret void\n```\nDSE cannot eliminate the store because `__promise` escapes through\n`coro.id`, and `coro.end` post-dominates the store. It turns out that\naccessing the coroutine frame after `coro.end` is not safe. This patch\nproposes clarifying the semantics of `coro.end` and reverting the\nworkaround, as it confuses alias analyses. I have scanned the tests and\nupdated the uses of the coroutine frame after `coro.end`.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d1c4ffe4c6f3599f4a047d6ee55556d123ce9cc9",
      "old_mode": 33188,
      "old_path": "llvm/docs/Coroutines.rst",
      "new_id": "bb38343ef294e2a13b301041e64e326ca03fd586",
      "new_mode": 33188,
      "new_path": "llvm/docs/Coroutines.rst"
    },
    {
      "type": "modify",
      "old_id": "c90d1885569601e5b4514ac893ba282a22465582",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/Transforms/Coroutines/CoroShape.h",
      "new_id": "f4673d61f097d953373ee1d995da28bd09b9058c",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/Transforms/Coroutines/CoroShape.h"
    },
    {
      "type": "modify",
      "old_id": "e003812f81192ff80d3796cd2333d08ec227554c",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Coroutines/CoroEarly.cpp",
      "new_id": "0c67ceccf4c4d0caca58ede0dac7920492a16a58",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Coroutines/CoroEarly.cpp"
    },
    {
      "type": "modify",
      "old_id": "a9f96e0309d2f622ad7eb5c97fadff46b94159db",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Coroutines/Coroutines.cpp",
      "new_id": "9e798ccbaacee128f3166a1f4fa91c83864b133e",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Coroutines/Coroutines.cpp"
    },
    {
      "type": "modify",
      "old_id": "109be51ffea854a31774cc8f02082110e1d86c26",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/Coroutines/coro-debug.ll",
      "new_id": "4c66cb94667b5c3d4f7a16b3d89ff21f7d74a141",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/Coroutines/coro-debug.ll"
    },
    {
      "type": "delete",
      "old_id": "0efe21216e9989196f5cc6268a5c8b0a4783ad46",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/Coroutines/gh105595.ll",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    }
  ]
}
