Issue 159675
Summary [MLIR] Stack overflow in dialect conversion with circular SSA dependencies
Labels mlir
Assignees
Reporter sairam2661
    Test commit: [5a86dc996c26299de63effc927075dcbfb924167](https://github.com/llvm/llvm-project/pull/157520/commits/5a86dc996c26299de63effc927075dcbfb924167)

**Description**:
The dialect conversion system crashes with a stack overflow error when processing a malformed MLIR with some circular SSA value dependencies - this ends up causing a segmentation fault.

**Steps to reproduce**
- Minimal MLIR program (test.mlir)
```
"builtin.module"() ({
  %0 = "arith.addi"(%1, %0) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
  %1 = "arith.constant"() <{value = 0 : index}> : () -> index
  %2 = "arith.constant"() <{value = 1 : index}> : () -> index
}) : () -> ()
```

**Command**
```
mlir-opt -convert-ub-to-llvm test.mlir
```

**Output**
[output.txt](https://github.com/user-attachments/files/22416106/output.txt)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to