-
Notifications
You must be signed in to change notification settings - Fork 146
Description
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:
mlir-aie/lib/Dialect/AIE/IR/AIEDialect.cpp
Line 1809 in d98dd25
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:
mlir-aie/lib/Dialect/AIEX/IR/AIEXDialect.cpp
Line 171 in d98dd25
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.