)]}'
{
  "commit": "47331ae73555b68535546170a76de2829b00d8a2",
  "tree": "5de5361a7e76f41b8a2ef748653c79bd9d68a7db",
  "parents": [
    "760f70711a7a6347aaa85df7d5e398f373ccac16"
  ],
  "author": {
    "name": "Artemiy Bulavin",
    "email": "artemiyb@graphcore.ai",
    "time": "Thu Feb 12 12:35:37 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Feb 12 12:35:37 2026 +0000"
  },
  "message": "Fix ownership based deallocation pass crash (#179357)\n\nThe `OwnershipBasedBufferDeallocation` pass crashes when the IR contains\nmemrefs that are live in the same Block but are defined in different\nBlocks. During this pass, live memrefs in a given block are sorted\naccording to the comparison function `ValueComparator`. This causes an\nassertion to be triggered when sorting memref values using\n`ValueComparator` as the comparison function. The assertion triggered is\nfound in `Operation::isBeforeInBlock`, which requires `this` and `other`\nto reside in the same block. (See the definition\n[here](https://github.com/llvm/llvm-project/blob/main/mlir/lib/IR/Operation.cpp#L385-L386).)\n\nThe fix is to handle values from different blocks in the\n`ValueComparator` by sorting based on Block number if the compared ops\naren\u0027t in the same block. While `computeBlockNumber` is intended for\ndebugging and error messages, it is a convenient utility that can\nprovide a sufficient weak ordering for `llvm::sort` while handling\noperations from different parent blocks. I\u0027m not aware of another\nordering relation for Blocks that would be appropriate as well as cheap\nto compute here.\n\nI\u0027ve added a test to exercise this that would fail otherwise. As I was\nalready editing the test file, I thought I would refactor it according\nto the recommendations of the [MLIR Testing\nGuide](https://mlir.llvm.org/getting_started/TestingGuide/#contributor-guidelines)\n\nFixes #137342  \nFixes #116363",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4dfba74a6dd3cdb0b9fcc978ad4b07f033aa434c",
      "old_mode": 33188,
      "old_path": "mlir/lib/Dialect/Bufferization/IR/BufferDeallocationOpInterface.cpp",
      "new_id": "a8703edfec7e2f62b507bfa172cef19a0cd550ee",
      "new_mode": 33188,
      "new_path": "mlir/lib/Dialect/Bufferization/IR/BufferDeallocationOpInterface.cpp"
    },
    {
      "type": "modify",
      "old_id": "fc137f1f2f722a22745dc8a2edba83e0d5af6765",
      "old_mode": 33188,
      "old_path": "mlir/test/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation/misc-other.mlir",
      "new_id": "f57e3473d9452f21a913a34291c7d32ede727876",
      "new_mode": 33188,
      "new_path": "mlir/test/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation/misc-other.mlir"
    }
  ]
}
