)]}'
{
  "commit": "b5c64db0a49d4653418457a520648c4305e01e75",
  "tree": "bbc7822b4b9710d67983c89696e9d8800fd16528",
  "parents": [
    "d5320610cd3614a83ea1f2c8122a6cfbad987eab"
  ],
  "author": {
    "name": "Andrew Pinski",
    "email": "andrew.pinski@oss.qualcomm.com",
    "time": "Tue Nov 18 23:02:36 2025 -0800"
  },
  "committer": {
    "name": "Andrew Pinski",
    "email": "andrew.pinski@oss.qualcomm.com",
    "time": "Sat Dec 13 02:32:42 2025 -0800"
  },
  "message": "ch: Improve copy header when the bbs are predicated as non-executed [PR122734]\n\nThis is version based on https://gcc.gnu.org/pipermail/gcc-patches/2025-November/701533.html\nreview. Though the only thing is we still need an extra check for the edge probability\nlike it is done in single_likely_exit because probabilities are still not being tracked\ncorrectly it seems.\n\nI also added copy-headers-12.c which we fail by duplicating too much. But I think that is ok,\nas this pattern of being the \"correct\" part of the loop header leading to a\nnoreturn function does not happen that often and when it does the header would have had a\nstatically figured out conditional which is already being checked.\n\nBootstrapped and tested on x86_64-linux-gnu.\n\n\tPR tree-optimization/122734\n\ngcc/ChangeLog:\n\n\t* tree-ssa-loop-ch.cc (should_duplicate_loop_header_p): Add new argument,\n\tcanbe_neverexecuted. When canbe_neverexecuted is true, return if a loop\n\texit is \"never executed\" like we are doing an invariant conditional.\n\t(ch_base::copy_headers): Update call to should_duplicate_loop_header_p.\n\ngcc/testsuite/ChangeLog:\n\n\t* gcc.dg/tree-ssa/20030711-1.c: Update.\n\t* gcc.dg/tree-ssa/copy-headers-10.c: New test.\n\t* gcc.dg/tree-ssa/copy-headers-11.c: New test.\n\t* gcc.dg/tree-ssa/copy-headers-12.c: New test.\n\nSigned-off-by: Andrew Pinski \u003candrew.pinski@oss.qualcomm.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c3f75eff29ef77011d164cb11c94367e9ff9ab7c",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c",
      "new_id": "29e1df7a707ed1dfa07a30c205c1e4177a922b7a",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5641a9a1d3a245bff92079e16e189cc211f81ba6",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/copy-headers-10.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2223a72f0238334fa2b144f681cd06593e1a2956",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/copy-headers-11.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "99a8b419a2ea0a77f8ed799d1e9834bc85f265d9",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/copy-headers-12.c"
    },
    {
      "type": "modify",
      "old_id": "91a61dd4e80b0b46ec6afe1497a1f9ed6a347449",
      "old_mode": 33188,
      "old_path": "gcc/tree-ssa-loop-ch.cc",
      "new_id": "feecf91cf70094194c6173100ef17dd0b886d362",
      "new_mode": 33188,
      "new_path": "gcc/tree-ssa-loop-ch.cc"
    }
  ]
}
