Skip to content

[mlir] transform.include does not handle nested specs with the same name #119578

Open
@kuhar

Description

@kuhar

Repro:

// RUN: mlir-opt %s --transform-interpreter

module @td_module_4 attributes {transform.with_named_sequence} {
  module @foo_module attributes {transform.with_named_sequence} {
    transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) -> () {
      transform.print {name="foo_module"}
      transform.yield
    }
  }
  module @bar_module attributes {transform.with_named_sequence} {
    transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) -> () {
      transform.print {name="bar_module"}
      transform.yield
    }
  }
  transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) -> () {
    transform.include @foo_module::@__transform_main failures(suppress) (%arg0) : (!transform.any_op) -> ()
    transform.include @bar_module::@__transform_main failures(suppress) (%arg0) : (!transform.any_op) -> ()
    transform.yield
  }
}

This prints [[[ IR printer: foo_module top-level ]]] only but I'd expect it to also print [[[ IR printer: bar_module top-level ]]].

If I rename the nested specs to __transform_main1 and __transform_main2, both foo_module and bar_module get printed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviormlir:transform_dialect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions