)]}'
{
  "commit": "a33726400ea0505c5f189abcad37416af5ac2ca1",
  "tree": "e063f2503e22ed240d7e76562f8ddfd7adb266c8",
  "parents": [
    "6b78497e50092a09c97c3af683bed0c41fba5293"
  ],
  "author": {
    "name": "Alex",
    "email": "hanweng9@gmail.com",
    "time": "Wed Jun 24 10:58:28 2026 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jun 24 14:58:28 2026 +0000"
  },
  "message": "[GlobalOpt] Fix crash in RaiseSpecialOps on buffer-semantics named ops (#24626)\n\n## Problem\n\nPassing a `linalg.matmul` (or any named contraction/convolution op) with\n**memref / buffer operands** to `iree-compile` crashes with a hard\nassert instead of a clean diagnostic:\n\n```\nAssertion failed: (index \u003c size() \u0026\u0026 \"invalid index into type range\"),\nfunction operator[], file TypeRange.h, line 156.\n...\nNamedImplicitCastOpConversion\u003clinalg::ContractionOpInterface\u003e::matchAndRewrite(...)\n```\n\n`NamedImplicitCastOpConversion::matchAndRewrite` in\n`GlobalOptimization/RaiseSpecialOps.cpp` reasons about the op\u0027s results\n(`getResultTypes()[0]`) and rewrites its body region, both of which\nassume tensor semantics. A buffer-semantics linalg op writes to an\noutput buffer and has **zero results**, so `getResultTypes()[0]` indexes\nan empty `TypeRange` and aborts.\n\n## Fix\n\nBail out via `hasPureTensorSemantics()` before touching results,\nmatching the guards already used elsewhere in this file (e.g. lines 48,\n231). The op is left untouched and compilation proceeds normally.\n\n## Verification (local, llvm-cpu)\n\nA/B on identical current `main` sources, exact reproducer from the\nissue:\n\n| Build | `iree-compile ... memref matmul` |\n|---|---|\n| unfixed (`main`) | exit **134**, assert in\n`NamedImplicitCastOpConversion` |\n| fixed (this PR) | exit **0**, compiles cleanly to a valid `.vmfb` |\n\n- Added lit test `@matmul_memref_no_crash` in `raise_special_ops.mlir`.\n- Full `raise_special_ops.mlir` lit suite passes.\n\nFixes #24624\n\nSigned-off-by: Alex-Wengg \u003chanweng9@gmail.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4077d76042549dade4f7580aa621d5bad7049ed7",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/RaiseSpecialOps.cpp",
      "new_id": "3ca4d331fcf0757590b832a9b47c050ae25fc208",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/RaiseSpecialOps.cpp"
    },
    {
      "type": "modify",
      "old_id": "877b169c70c5dbfa3913c674235efbd95621b073",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/GlobalOptimization/test/raise_special_ops.mlir",
      "new_id": "6b3e22abca76c0e7df0ab9af7b9ed0b6cb476450",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/GlobalOptimization/test/raise_special_ops.mlir"
    }
  ]
}
