Define spv.Image Operantion.
Create SPIRVImageOps.td for image related operations since there is no .td file for image operations in spirv.
co-authered-by: Alan Liu <alanliu.yf@gmail.com>
Paths
| Differential D98270
[mlir][spirv] Define spv.Image Operation ClosedPublic Authored by Weiwei-2021 on Mar 9 2021, 9:48 AM.
Details Summary Define spv.Image Operantion. Create SPIRVImageOps.td for image related operations since there is no .td file for image operations in spirv. co-authered-by: Alan Liu <alanliu.yf@gmail.com>
Diff Detail
Event TimelineComment Actions One thing I noticed that if we define the operation's type format as "type($sampledimage) -> type($result)", the operation seems a little bit log due to the image type. Please let me know whether it is a problem. antiagainst added inline comments.
This revision now requires changes to proceed.Mar 9 2021, 1:10 PM
Weiwei-2021 added inline comments. antiagainst added inline comments.
This revision is now accepted and ready to land.Mar 10 2021, 12:42 PM This revision was landed with ongoing or failed builds.Mar 10 2021, 12:48 PM Closed by commit rG619c1505f944: [mlir][spirv] Define spv.Image Operation (authored by Weiwei-2021, committed by antiagainst). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 329743 mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVImageOps.td
mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.td
mlir/test/Dialect/SPIRV/IR/image-ops.mlir
mlir/test/Target/SPIRV/image-ops.mlir
|
Ah this is fairly verbose: we don't want both the image and sampled image to appear. Given the sampled image it's very clear what would be the resultant image. I think for this case we want to avoid use assemblyFormat and manually write the parser/printer to have an assembly format like %1 = spv.Image %0 : !spv.sampled_image<...> (so omitting the -> !spv.image<...> part).