)]}'
{
  "commit": "4b23615964a55134cc9210a05fd9b909f9d6c34e",
  "tree": "1975c8da9ee40d301379fad2a09766dd9d568507",
  "parents": [
    "823446210fe229bc2b5e2b343d94639af8baf1ae"
  ],
  "author": {
    "name": "z combinator",
    "email": "49233942+hsqStephenZhang@users.noreply.github.com",
    "time": "Tue Jul 07 16:53:24 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Jul 07 14:53:24 2026 +0000"
  },
  "message": "[Stream] Fix crash in ConvertSplatConstantsIntoSplats for dense_resource (#24683)\n\n## Description\n\nhttps://github.com/iree-org/iree/issues/24448 crashes because:\n\n1. the frontend generates `DenseResourceElementsAttr` instead of\n`SplatElementsAttr` for models, it satisfies `isSplat()` because the\n`isSplat` has a default implementation and the tensor\u0027s elements share\nthe same value(for batchnorm, the weight is 1.0, the mean is 0.0 by\ndefault)\n2. the subsequent code attempts to `dyn_cast` the attribute to\n`SplatElementsAttr` , which returns `nullptr` and causes a segfault upon\ndereference.\n\n## Solution\n\n1. restrict the initial cast to `DenseElementsAttr`. since\n`DenseResourceElementsAttr` does not inherit from `DenseElementsAttr`,\nthe cast will safely fail and we could return `failure()` as expected.\n2. retrieve the splat value directly via\n`DenseElementsAttr::getSplatValue()` , which is natively supported for\nall splat-valued dense attributes\n\n## E2E test\n\nrun\nhttps://gist.github.com/hsqStephenZhang/31c9516a5b8788e7036061aae0ff46ba\n\nbefore the fix, it leads to segfault. after the fix, it exit\nsuccessfully.\n\n---------\n\nSigned-off-by: hsqStephenZhang \u003cstephenzhang666666@gmail.com\u003e\nCo-authored-by: Artem Gindinson \u003cgindinson@roofline.ai\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0305edffde685cb239a4ac6736d0b06c7393f6c9",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Stream/IR/StreamOpFolders.cpp",
      "new_id": "665531a8fb4e127646d9461905f972ebe10560b7",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/IR/StreamOpFolders.cpp"
    },
    {
      "type": "modify",
      "old_id": "ee6c739932f70cc60ec7f9608033356bdfdf8b6e",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Stream/IR/test/async_folding.mlir",
      "new_id": "b8977e4889dc059571b407386e1e2cbc7787b8e6",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/IR/test/async_folding.mlir"
    }
  ]
}
