Skip to content

[MLIR] Stack overflow in dialect conversion with circular SSA dependencies #159675

@sairam2661

Description

@sairam2661

Test commit: 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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions