[PATCH] D79541: [WIP][mlir] RFC - Simplify and better document std.view semantics
Mahesh Ravishankar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 7 09:40:10 PDT 2020
mravishankar added inline comments.
================
Comment at: mlir/include/mlir/Dialect/StandardOps/IR/Ops.td:2919
+ The "view" operation gives a structured indexing form to a flat 1-D buffer.
+ Unlike "subview" it can perform a type change. The type change behavior
----------------
There is another problem w.r.t to view operation w.r.t to lowering to SPIR-V dialect. This is doing a type-cast. The SPIR-V spec is very restrictive in pointer casts it allows to the effect that current plan is to not use pointer casts at all within the SPIR-V dialect. While it is a SPIR-V restriction, I am not sure what the type casting here gives us. Specifically this is always type-casting (cause the base memref is i8). The requirement of creating a multi-dimension memref can be done using an AllocOp directly. If the need is to model aliasing between different uses you can use a memref_cast. The memref_cast can also be done for changing element type. That would then be an "opt-in". You do it only when you need it. For now I am not sure whether we need the ViewOp at all.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79541/new/
https://reviews.llvm.org/D79541
More information about the llvm-commits
mailing list