Skip to content

[Encoding] Revisit the need of EncodingNopLayout resolver #20846

Closed

Description

@hanhanW

There are no codegen specifics in the resolver, and we have a similar resolver -- IdentityEncodingAttr. This is the issue for tracking EncodingNopLayout deprecation. We should maybe rename IdentityEncodingAttr to IdentityResolverAttr. I will list out all the encodings, encoding resolvers in #20742 and fix it later.

//===---------------------------------------------------------------------===//
// iree_encoding.identity_encoding
//===---------------------------------------------------------------------===//
def IdentityEncodingAttr :
IREEEncoding_Attr<"IdentityEncoding", [
DeclareAttrInterfaceMethods<IREEEncoding_EncodingLayoutResolverAttrInterface, [
"cloneWithSimplifiedConfig",
"getLayout",
]>
]> {
let mnemonic = "identity_encoding";
let summary = [{A layout resolver that behaves like an identity function.}];
let description = [{
A layout resolver that behaves like an identity function. I.e., it resolves
the layout to the same layout without encodings.
}];
let genVerifyDecl = 0;
}

cc @jtuyls

Activity

  1. self-assigned this
    on May 17, 2025
  2. hanhanW commented on May 19, 2025

    @hanhanW
    ContributorAuthor

    I think the EncodingNopLayout resolver is easier to drop after we finish the interface work and collapse two codegen encoding materialization passes: #20160

    I'll help remove it after that. The immediate need is to rename it to identity_resolver and introduce the identity encoding attribute. This reduces the confusion when we abuse pad_encoding_layout with zero values to represent identity layout.

  3. hanhanW commented on Sep 16, 2025

    @hanhanW
    ContributorAuthor

    The renamed identity resolver is

    def IdentityResolverAttr :
    IREEEncoding_Attr<"IdentityResolver", [
    DeclareAttrInterfaceMethods<IREEEncoding_LayoutResolverAttr, [
    "cloneWithSimplifiedConfig",
    "getLayout",
    ]>
    ]> {
    let mnemonic = "identity_resolver";
    let summary = [{A layout resolver that behaves like an identity function.}];
    let description = [{
    A layout resolver that behaves like an identity function. I.e., it resolves
    the layout to the same layout without encodings.
    }];
    let genVerifyDecl = 0;
    }

    We are able to implement the interface methods for the resolver and drops EncodingNopLayout resolver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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