)]}'
{
  "commit": "eaca0fdd031bbed1d2ff7dd86c3adfecef1c51cc",
  "tree": "51b9f3317e04076bd7f629ae863ab1afd4272c22",
  "parents": [
    "31fd60b80ae81191084d7999765329c132222970"
  ],
  "author": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Wed Aug 05 14:58:44 2026 +0200"
  },
  "committer": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Wed Aug 12 13:33:04 2026 +0200"
  },
  "message": "doc: describe the lane freedom of reduc_widen_[us]sum and WIDEN_SUM_EXPR\n\nThe documentation of the reduc_widen_ssum and reduc_widen_usum patterns says\nonly that operand 1 is added to operand 2, which reads as though each element\nof operand 1 has to be accumulated into the element of operand 0 at the same\nposition.  Nothing says the patterns are only ever used for a reassociable\nreduction, so a port cannot tell whether it is allowed to regroup the input\nelements, for example by using a pairwise widening add.\n\nvect_recog_widen_sum_pattern only forms WIDEN_SUM_EXPR\nthrough vect_reassociating_reduction_p, which requires the statement to be a\nreduction, refuses a statement nested in the inner loop of an outer-loop\nvectorization because the order of the computation matters there, and refuses\na type that needs a fold-left reduction.  The comment on the pattern already\ndescribes the idiom as producing N/2 results by summing up pairs of\nintermediate results.  The accumulator is only ever consumed by a horizontal\nsum in the epilogue, so the distribution of input elements over accumulator\nelements is not observable.\n\nSpell that out in md.texi, along with the constraint that comes with it: an\nimplementation that adds elements together before they reach the element width\nof operand 0 has to widen them first so that no intermediate sum can overflow.\nNote that the widen_[us]sum names are left free for a lane preserving pattern.\n\nGive WIDEN_SUM_EXPR the same statement in tree.def.  DOT_PROD_EXPR and SAD_EXPR\nare formed through vect_reassociating_reduction_p as well and read the same way,\nso add a sentence to each pointing at the WIDEN_SUM_EXPR rule.\n\ngcc/ChangeLog:\n\n\t* doc/md.texi (reduc_widen_ssum@var{n}@var{m}3)\n\t(reduc_widen_usum@var{n}@var{m}3): Document that the assignment of\n\tinput elements to accumulator elements is unconstrained, that\n\tintermediate sums must not overflow, and that the widen_[us]sum\n\tnames are reserved.  Fix a typo.\n\t* tree.def (WIDEN_SUM_EXPR): Document that the assignment of elements\n\tof the first argument to elements of the second is unconstrained.\n\t(DOT_PROD_EXPR, SAD_EXPR): Note the same freedom.\n\nSigned-off-by: Kyrylo Tkachov \u003cktkachov@nvidia.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4b3dc950aeb0ce9fbe358dda53b530411c2ebc07",
      "old_mode": 33188,
      "old_path": "gcc/doc/md.texi",
      "new_id": "f86fa8038e8a0a4498325ea12e041b9622b4e7d5",
      "new_mode": 33188,
      "new_path": "gcc/doc/md.texi"
    },
    {
      "type": "modify",
      "old_id": "ad8e676e9421f00f365b61382947a8836c159884",
      "old_mode": 33188,
      "old_path": "gcc/tree.def",
      "new_id": "2e767dbe045312aade34a89df95317c0aa0f0a19",
      "new_mode": 33188,
      "new_path": "gcc/tree.def"
    }
  ]
}
