[PATCH] D78034: [mlir][spirv] Improve stride support in array types

Mahesh Ravishankar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 13:00:01 PDT 2020


mravishankar reopened this revision.
mravishankar added a comment.
This revision is now accepted and ready to land.

Sorry, just getting to this for review.

See comments below.



================
Comment at: mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h:157
   static ArrayType get(Type elementType, unsigned elementCount,
-                       LayoutInfo layoutInfo);
+                       unsigned stride);
 
----------------
Seems to be a mismatch here. elementCount and stride should be size_t. Of course on many devices unsigned is enough, but when possible we might need to support objects of large sizes. Maybe better to make both size_t?


================
Comment at: mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp:231
+// array-type ::= `!spv.array` `<` integer-literal `x` element-type
+//                (`,` `stride` `=` integer-literal)? `>`
 static Type parseArrayType(SPIRVDialect const &dialect,
----------------
This makes it too verbose. Why change the parsing/printing?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78034/new/

https://reviews.llvm.org/D78034





More information about the llvm-commits mailing list