Skip to content

Missing and Wrong Data Layout Transformation Checks #2566

@andrej

Description

@andrej

The compiler currently (1) rejects some data layout transformations that are legal and (2) fails to reject some data layout transformations that are not realizable in hardware (i..e, sub-32-bit accesses).

For (1), this check, introduced in #2435, effectively disables use of the lowest-dimension stride:

if (getBufferElementTypeWidthInBytes() > 4 && dims->back().getStride() != 1)

I don't know the background of why it was introduced, but I believe it effectively makes the lowest-dimension stride unusable.

For (2), as long as the lowest-dimension stride is 1 for smaller data types (e.g. int8) the compiler currently does not reject smaller-than-4-bytes transfers. Something like [<size=3, stride=4>, <size=2, stride=1>] should be rejected if the data type is int8, since the smallest unit of transfer here is 16 bits.

We have this function used elsewhere:

AIEX::verifyStridesWraps(mlir::Operation *forOp,

I think we should try to factor that out and use that for verification elsewhere as well. It probably contains mistakes too but not the above two.

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