[all-commits] [llvm/llvm-project] ee5dcd: [mlir] fix assertion failure in remove-dead-values...

Menooker via All-commits all-commits at lists.llvm.org
Sun Jun 22 07:03:57 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ee5dcdc275b136172a5bfa85a098ae506a836c85
      https://github.com/llvm/llvm-project/commit/ee5dcdc275b136172a5bfa85a098ae506a836c85
  Author: Menooker <myjisgreat at live.cn>
  Date:   2025-06-22 (Sun, 22 Jun 2025)

  Changed paths:
    M mlir/lib/Transforms/RemoveDeadValues.cpp
    M mlir/test/Transforms/remove-dead-values.mlir

  Log Message:
  -----------
  [mlir] fix assertion failure in remove-dead-values (#144849)

Simple IR patterns will trigger assertion error:

```
  func.func @test_zero_operands(%I: memref<10xindex>, %I2: memref<10xf32>) {
    %v0 = arith.constant 0 : index
    %result = memref.alloca_scope -> index {
      %c = arith.addi %v0, %v0 : index
      memref.store %c, %I[%v0] : memref<10xindex>
      memref.alloca_scope.return %c: index
    }
    func.return
  }
```

with error: `mlir/include/mlir/IR/Operation.h:988:
mlir::detail::OperandStorage& mlir::Operation::getOperandStorage():
Assertion `hasOperandStorage && "expected operation to have operand
storage"' failed.`

This PR will fix this issue.

---------

Co-authored-by: Andrzej WarzyƄski <andrzej.warzynski at gmail.com>
Co-authored-by: Mehdi Amini <joker.eph at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list