)]}'
{
  "commit": "6c7885dbdeaeea37e1f102efacf839beddbf59d7",
  "tree": "f26ebe3f3a07110c6b81949c51e8e7e20f780fd5",
  "parents": [
    "bd5bf754b1b09cb1a790110640f1c9e5d56fe9f7"
  ],
  "author": {
    "name": "Steven Perron",
    "email": "stevenperron@google.com",
    "time": "Fri Oct 29 10:46:43 2021 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Oct 29 10:46:43 2021 -0400"
  },
  "message": "Change branch handling in ADCE to fix errors (#4596)\n\nConsider the new test case.  The conditional branch in the continue\r\nblock is never marked as live.  However, `IsDead` will say it is not\r\ndead, so it does not get deleted.  Because it was never marked as live,\r\n`%false` was not mark as live either, but it gets deleted.  This results\r\nin invalid code.\r\n\r\nTo fix this properly, we had to reconsider how branches are handle.  We\r\nmake the following changes:\r\n\r\n1) Terminator instructions that are not branch or OpUnreachable must be\r\nkept, so they are marked as live when initializing the worklist.\r\n\r\n2) Branches and OpUnreachable instructions are marked as live if\r\n  a) the block does not have a merge instruction and another instruction\r\n     in the block is marked as live, or\r\n  b) the merge instruction in the same block is marked as live.\r\n\r\n3) Any instruction that is not marked as live is removed.\r\n\r\n4) If a terminator is to be removed, an OpUnreachable is added.  This\r\nhappens when the entire block is dead, and the block will be removed.\r\nThe OpUnreachable is generated to make sure the block still has a\r\nterminator, and is valid.\r\n\r\nFixes https://github.com/KhronosGroup/SPIRV-Tools/issues/4509.\r\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c83fb48cc60ee8da79321f1e48e165f5d7366927",
      "old_mode": 33188,
      "old_path": "source/opt/aggressive_dead_code_elim_pass.cpp",
      "new_id": "0b54d5e85adc5ed28f99562e7a83f37500f654d8",
      "new_mode": 33188,
      "new_path": "source/opt/aggressive_dead_code_elim_pass.cpp"
    },
    {
      "type": "modify",
      "old_id": "7d1679f63662db9c9ad896730cb32a953efc9234",
      "old_mode": 33188,
      "old_path": "source/opt/aggressive_dead_code_elim_pass.h",
      "new_id": "1b3fd1e8539075d4cd123454b67773d8ddc801d1",
      "new_mode": 33188,
      "new_path": "source/opt/aggressive_dead_code_elim_pass.h"
    },
    {
      "type": "modify",
      "old_id": "746569ab5dc3ab8ae0ee67292f1227987b9dd5d9",
      "old_mode": 33188,
      "old_path": "test/opt/aggressive_dead_code_elim_test.cpp",
      "new_id": "f228c8cb243b3818e7ab8cb7fbd1505542a6d7e6",
      "new_mode": 33188,
      "new_path": "test/opt/aggressive_dead_code_elim_test.cpp"
    }
  ]
}
