Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Operation interfaces: can't name the interface method same as free function on op #197

@bondhugula

Description

@bondhugula

With the way tablegen based operation interfaces are generated
https://github.com/tensorflow/mlir/blob/master/g3doc/OpDefinitions.md#operation-interfaces
it doesn't appear to be possible to use the same name for an interface method and a free function that it calls taking the concrete op as input. The latter would resolve to an internal op interface generated method from implicit conversion of the concrete op to Operation *, and thus lead to an infinite recursion. Normally, one would like to use the same name. For example, consider:

InterfaceMethod<"/*insert doc here*/",
      "unsigned", "computeSomeProperty", (ins), [{
        return computeSomeProperty(op);
    }]>,

computeSomeProperty(op) will resolve to an internally generated method:

unsigned computeSomeProperty(Operation *tablegen_opaque_op) final 

instead of the intended mlir::computeSomeProperty(ConcreteOpType opType);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions