)]}'
{
  "commit": "82c7192a0874017a391ccfde44b0a2e4e07ca4c1",
  "tree": "9c8e40d4dd8645f6721e0faa7c109f1cc000c056",
  "parents": [
    "aea7db5a70c3ada06974059fa4ea4d9b590e2166"
  ],
  "author": {
    "name": "Mehdi Amini",
    "email": "joker.eph@gmail.com",
    "time": "Mon Apr 13 19:36:07 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Apr 13 19:36:07 2026 +0200"
  },
  "message": "[MLIR][Vector] Fix multi_reduction fold to handle empty reduction dims for any rank (#188983)\n\nThe fold for `vector.multi_reduction` only handled the rank-1 case with\nno reduction dimensions. For higher-rank vectors (e.g.,\n`vector\u003c2x3xf32\u003e`) with empty reduction dims `[]`, the fold returned\nnull, allowing `ElideUnitDimsInMultiDimReduction` to fire incorrectly.\nThat canonicalization pattern checks that all *reduced* dims have size\n1, but with zero reduction dims the check trivially passes, and the\npattern then computes `acc op source` (e.g., `acc + source`) instead of\nthe correct no-op result (`source`).\n\nThis caused `--canonicalize` to produce a different value than\n`--lower-vector-multi-reduction` for the same program:\n\n  vector.mask %m { vector.multi_reduction \u003cadd\u003e, %src, %src [] :\nvector\u003c3x3xi32\u003e to vector\u003c3x3xi32\u003e } : vector\u003c3x3xi1\u003e -\u003e vector\u003c3x3xi32\u003e\n\n  * Without --lower-vector-multi-reduction: `src + src` (e.g., 2)\n  * With    --lower-vector-multi-reduction: `src` (e.g., 1)\n\nFix the fold to return `source` for any rank when `reduction_dims` is\nempty. This makes the empty-dims case consistent: the operation is a\nnoop regardless of rank, and `ElideUnitDimsInMultiDimReduction` no\nlonger gets a chance to mishandle it.\n\nFixes #129415\n\nAssisted-by: Claude Code",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7d866d4011a09f5d211d900516beaa555f7a5267",
      "old_mode": 33188,
      "old_path": "mlir/lib/Dialect/Vector/IR/VectorOps.cpp",
      "new_id": "238f37ae57ac6b92cecb92919a88e0f4a1e697e1",
      "new_mode": 33188,
      "new_path": "mlir/lib/Dialect/Vector/IR/VectorOps.cpp"
    },
    {
      "type": "modify",
      "old_id": "71a18f796c27dce1883a6f99ed934dbd467bb0da",
      "old_mode": 33188,
      "old_path": "mlir/test/Dialect/Vector/canonicalize.mlir",
      "new_id": "23a35a3a8c62a043cf0727744a7114e0908287e3",
      "new_mode": 33188,
      "new_path": "mlir/test/Dialect/Vector/canonicalize.mlir"
    }
  ]
}
