)]}'
{
  "commit": "cb9c3c8bdeb2fa07d0e4d552e6faca2f04156462",
  "tree": "b78f83d453f07c696889fd43c00497651c3126ec",
  "parents": [
    "d699c043d7f09e1a2d56e13b288be08e819a5a97"
  ],
  "author": {
    "name": "Artem Gindinson",
    "email": "gindinson@roofline.ai",
    "time": "Tue Oct 13 10:07:08 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Oct 13 10:07:08 2026 +0200"
  },
  "message": "[Stream] Always map aliases to resolved resource ranges of the source op (#25026)\n\nThis ensures that all operands in the tied operand chain for a resource\nwill get mapped to the correct buffer range.\n\nPreviously, if the resource\u0027s buffer received a new allocation,\n`stream.resource.subview` aliases (by nature of a byte subview, tied to\na different memory range) would still receive resource ranges relatively\nto the old resource.\nAdditionally, all aliases of a given source would be processed from the\n\"nearest\" subview in the alias chain. With multiple subviews in the same\ntied operand chain, the offsets weren\u0027t computed relative to one\nanother.\n\nAddressing the first problem enables the most practical use case.\nSplitParameterEncoding in \"consolidate\" mode may need to place an\nunmodified input weight into the output buffers, which means the weight\nmay end up in a packed allocation together with a pre-initialized output\nparameter. To later fetch that input weight for dynamic initialization,\nan explicit `subview` op is generated (*). Hoisting the constant out of\nthe execution scope establishes the new resource range, and the subview\nshould compute its resource range against that. Instead, the old\nsubrange would get used that was relative to the original SSA source\nbound for deletion.\nSee `Stream/Transforms/test/schedule_allocation_subviews_constant.mlir`\nfor illustration.\n\n(*) Whether that should be happening is a different matter. Accessing\nthe packed weight through `stream.async.slice` would\u0027ve been preferable,\nas per a [TODO in\nSplitParameterEncoder](https://github.com/iree-org/iree/blob/0df50f9a8e40ab1878479124b952f45d9f8c0650/compiler/src/iree/compiler/Dialect/Stream/Transforms/SplitParameterEncoder.cpp#L1971).\nGenerally, we should let ScheduleAllocation operate on that abstraction\nwhere a copy will implicitly be generated on writing to the range,\nrather than have it account for explicit aliases in that of\n`resource.subview`. For now I\u0027ve preferred not to go into that\ndirection, because that switch requires larger-scale testing, and\ncurrently explicit subview ops are expected to be supported in the input\nIR to the allocator.\n\nBy implementing alias mapping as a DFS worklist and simply ignoring\nvalues that have already been resolved to a resource range, nested\nsubviews, a.k.a. subview ops that reference each other, now correctly\ncalculate their offset by adding up their own offset to the earlier\noffsets in the tied operand chain. Not sure if that does/would come up\nin a real case, but at least that\u0027s a sensible side effect.\n\nAssisted-by: Codex\n\n---------\n\nSigned-off-by: Artem Gindinson \u003cgindinson@roofline.ai\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b206f275e765fac89a86e980972f67a514574662",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleAllocation.cpp",
      "new_id": "9637a0614c913d3478abd9bb3f76f9e56c3de4be",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/ScheduleAllocation.cpp"
    },
    {
      "type": "modify",
      "old_id": "6035df886914e5877dc32a29e3f52101c8c741c2",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/BUILD.bazel",
      "new_id": "c22b60a627d973f0abb59f16a52d01d4988bd587",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "9db48999b288ae647d1299772b3ca57cd7c0aa12",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/CMakeLists.txt",
      "new_id": "8f4ba258083789a583c4b6b15e84a034c381ba8b",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "ab20e414136c3f6ca969c2c81c50f5088f28bb19",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/schedule_allocation.mlir",
      "new_id": "b2194fea2eb9001734a95bbb7e024de9d92c3ec1",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/schedule_allocation.mlir"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a448547b6dad03a2d38d821713a48cc63dc44191",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/schedule_allocation_subviews_constant.mlir"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "56c8a1640da77b8f88a5ae2bda9783817a1eb676",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/schedule_allocation_subviews_nested.mlir"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c1b225fb5be9baf912a81e29360d03a1894823bd",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Dialect/Stream/Transforms/test/schedule_allocation_subviews_transient.mlir"
    }
  ]
}
