)]}'
{
  "commit": "8a312e7a448a81d5447729c2743ec7b69b581402",
  "tree": "a247fbc18fd2d9c491483c4cd3d350c7fddfe878",
  "parents": [
    "4fc22cd1159e19a5b6830c8e3c70f7b1f44748fc"
  ],
  "author": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Mon Oct 05 22:47:09 2026 +0200"
  },
  "committer": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Tue Oct 06 15:25:36 2026 +0200"
  },
  "message": "genmatch: Relax DT_TRUE ordering barrier in decision_tree::find_node\n\nThe DT_TRUE merge barrier in find_node prevents a later pattern from\nmerging into an earlier equal sibling when a DT_TRUE node lies between\nthem.  The barrier was introduced for PR 64084 (r218141) to preserve\nsource order in cases where multiple patterns can match the same input.\n\nToday\u0027s match.pd is protected at a finer grain by the gen_kids flush:\nDT_TRUE and DT_MATCH kids each force a flush of collected alternatives\nbefore emitting their own subtrees.  The flush guarantees that patterns\nbefore a DT_TRUE are tried before patterns after it, so the barrier in\nfind_node is redundant for most cases.\n\nThe remaining cases where the barrier is necessary are those where an\nintermediate sibling (between the earlier and later equal nodes) has a\nDT_MATCH descendant.  A DT_MATCH descendant means the sibling\u0027s\nsubtree can match any input value, including inputs matched by the later\nnode\u0027s subtree.  If the later node merged into the earlier one, it would\nbe tried before the DT_MATCH sibling, violating source order for those\ninputs.\n\nWhen no intermediate sibling has a DT_MATCH descendant, every sibling\nmatches a disjoint set of inputs (since the top-level operand overlap\ncheck already ensures no sibling\u0027s top-level operation overlaps with\np\u0027s, and DT_MATCH is the only construct that can widen the match beyond\na specific operation).  In this case the merge is safe.\n\nReplace the unconditional DT_TRUE barrier refusal with a scan of the\nintermediate siblings: refuse only when at least one non-DT_TRUE sibling\nbetween the candidate and the insertion point has a DT_MATCH descendant.\nThis reduces the generated GIMPLE matcher by about 0.4% and the GENERIC\nmatcher by about 0.2%.\n\ngcc/ChangeLog:\n\n\t* genmatch.cc (subtree_has_match_p): New function.\n\t(decision_tree::find_node): Replace unconditional DT_TRUE barrier\n\twith a scan for DT_MATCH descendants in intermediate siblings.\n\nSigned-off-by: Kyrylo Tkachov \u003cktkachov@nvidia.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "249741e77cc622f8bda09e34495b0bf9560be40c",
      "old_mode": 33188,
      "old_path": "gcc/genmatch.cc",
      "new_id": "a67426b6313c5a7403409188d1ff5224656739cf",
      "new_mode": 33188,
      "new_path": "gcc/genmatch.cc"
    }
  ]
}
