)]}'
{
  "commit": "04028a8af07d7e56d90478bf2229eeed41badfd6",
  "tree": "0a390275a831d7e0f06b26617b3fbb1bc2e8ecd6",
  "parents": [
    "cb9c3c8bdeb2fa07d0e4d552e6faca2f04156462"
  ],
  "author": {
    "name": "Yalong",
    "email": "yalong@multicorewareinc.com",
    "time": "Tue Oct 13 19:11:06 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Oct 13 13:11:06 2026 +0200"
  },
  "message": "[GlobalOptimization] Fold empty-set reductions to their init operand. (#24949)\n\nReductions over a zero-sized dimension (e.g. input shape 2x0x4 -\u003e 2x1x4)\nlower to a linalg.generic with a 0-extent input, which crashes codegen\ntiling (computeAllSliceParameters assertion).\n    \nWhen the reduced dimension has size 0, no input element is ever\ncombined,\nso the result of the reduction is exactly its init operand. This adds a\npattern in RemoveZeroExtentTensors that replaces such a reduction with\nits\nexisting init operand, so the 0-extent generic never reaches codegen.\n    \nForwarding the init (instead of synthesizing a linalg.fill of the\nreduction\nidentity) preserves the semantics of any initial accumulator value,\nincluding\nnon-identity ones, and avoids materializing a new fill. For ONNX\nempty-set\nreductions the init already carries the identity (sum -\u003e 0, prod -\u003e 1),\nso the observable result is unchanged.\n\nAdds lit coverage for the rewrite:\n  - a reduction with a non-identity initial accumulator (init preserved),\n  - dynamic output dimensions.\n    \nFixes 8 onnx_ops *_empty_set cases:\n    test_reduce_sum_empty_set\n    test_reduce_sum_square_empty_set\n    test_reduce_sum_square_empty_set_expanded\n    test_reduce_l1_empty_set\n    test_reduce_l1_empty_set_expanded\n    test_reduce_l2_empty_set\n    test_reduce_log_sum_empty_set\n    test_reduce_log_sum_exp_empty_set\n    \nRelated to iree-org/iree#24378\n    \nAssisted-by: Claude Code, Doubao, DeepSeek\n\nSigned-off-by: Yalong \u003cyalong@multicorewareinc.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "71bc4e779c9ae07631d34cf894d11f8aead98a0e",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/RemoveZeroExtentTensors.cpp",
      "new_id": "3e0bf74f27ce55efcedadf63bf0948dc1975340b",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/RemoveZeroExtentTensors.cpp"
    },
    {
      "type": "modify",
      "old_id": "449587073f2ca1b8d2407cfacaa7f27d9394bb70",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/test/remove_zero_extent_tensors.mlir",
      "new_id": "50f3bbee6eb2231c410ad04dddd558fb20849fa4",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/test/remove_zero_extent_tensors.mlir"
    },
    {
      "type": "modify",
      "old_id": "c8d9bf1dcbeacd39a0e080ff9d66c4f0d0d80a0f",
      "old_mode": 33188,
      "old_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_cpu_llvm_sync_O0.json",
      "new_id": "18c51a6b1eaf7bfeedaf09a1bdf1856184c62784",
      "new_mode": 33188,
      "new_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_cpu_llvm_sync_O0.json"
    },
    {
      "type": "modify",
      "old_id": "7b1552719e94a0b477b38cd4122166c39ee82ba6",
      "old_mode": 33188,
      "old_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_cpu_llvm_sync_O2.json",
      "new_id": "0ee8b701629528524d28605995db3aa2992f2dd3",
      "new_mode": 33188,
      "new_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_cpu_llvm_sync_O2.json"
    },
    {
      "type": "modify",
      "old_id": "d5174187c4e4c49fdb53ba7d1c4632eb201b6532",
      "old_mode": 33188,
      "old_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_gpu_hip_rdna3_O3.json",
      "new_id": "9842fd1b245cc921f10313924e15e4904b6d3766",
      "new_mode": 33188,
      "new_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_gpu_hip_rdna3_O3.json"
    },
    {
      "type": "modify",
      "old_id": "0238939f1a83208bd550bbd37cbe043966f46c27",
      "old_mode": 33188,
      "old_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_gpu_hip_rdna4_O3.json",
      "new_id": "e379796ac6fd49749097f6d05b013e2a5037b1b3",
      "new_mode": 33188,
      "new_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_gpu_hip_rdna4_O3.json"
    },
    {
      "type": "modify",
      "old_id": "26a6f9ba7595d9ee1b11e66297da1733268cbf2c",
      "old_mode": 33188,
      "old_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_gpu_vulkan_rdna3_O0.json",
      "new_id": "0397b352ee1caf3ce4cd08951d84c9932433df7c",
      "new_mode": 33188,
      "new_path": "tests/external/iree-test-suites/onnx_ops/onnx_ops_gpu_vulkan_rdna3_O0.json"
    }
  ]
}
