cornell-zhang / hcl-dialect

HeteroCL-MLIR dialect for accelerator design
https://cornell-zhang.github.io/heterocl/index.html
Other
38 stars 17 forks source link

[Op] Semi-affine modulo operation is not suppoted in MLIR #127

Open chhzh123 opened 2 years ago

chhzh123 commented 2 years ago

As the title says, sometimes we may get the following indices after we outline and parameterize the operation, but it is not yet supported by MLIR.

%0 = affine.load %arg0[%arg6, %arg7 mod symbol(%arg5), %arg8, %arg9] {from = "layer2_0_avgpool"} : memref<1x32x16x16xf32, #map0>

It throws the error.

error: semi-affine expressions (modulo by non-const) are not supported
chhzh123 commented 2 years ago

Similar issue in IREE project: https://github.com/iree-org/iree/issues/9279

chhzh123 commented 2 years ago

Currently we can only rewrite this kind of affine.load to memref.load