[PATCH] D72432: [mlir] Add shaped container component type interface

Jacques Pienaar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 19:57:17 PST 2020


jpienaar created this revision.
jpienaar added a reviewer: rriddle.
Herald added subscribers: llvm-commits, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, mehdi_amini.
Herald added a project: LLVM.

- Add shaped container type interface which allows infering the shape, element type and attribute of shaped container type separately. Show usage by way of tensor type inference trait which combines the shape & element type in infering a tensor type;
  - All components need not be specified;
  - Attribute is added to allow for layout attribute that was previously discussed;
- Expand the test driver to make it easier to test new creation instances (adding new operands or ops with attributes or regions would trigger build functions/type inference methods);
  - The verification part will be moved out of the test and to verify method instead of ops implementing the type inference interface in a follow up;
- Add MLIRContext as arg to possible to create type for ops without arguments, region or location;
- Also move out the section in OpDefinitions doc to separate ShapeInference doc where the shape function requirements can be captured;
  - Part of this would move to the shape dialect and/or shape dialect ops be included as subsection of this doc;
- Update ODS's variable usage to match camelBack format for builder, state and arg variables;
  - I could have split this out, but I had to make some changes around these and the inconsistency bugged me :)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72432

Files:
  mlir/docs/OpDefinitions.md
  mlir/docs/ShapeInference.md
  mlir/include/mlir/Analysis/InferTypeOpInterface.h
  mlir/include/mlir/Analysis/InferTypeOpInterface.td
  mlir/include/mlir/IR/OpBase.td
  mlir/lib/Analysis/InferTypeOpInterface.cpp
  mlir/test/lib/TestDialect/TestDialect.cpp
  mlir/test/lib/TestDialect/TestOps.td
  mlir/test/lib/TestDialect/TestPatterns.cpp
  mlir/test/mlir-tblgen/op-attribute.td
  mlir/test/mlir-tblgen/op-decl.td
  mlir/test/mlir-tblgen/op-operand.td
  mlir/test/mlir-tblgen/op-result.td
  mlir/test/mlir-tblgen/return-types.mlir
  mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72432.236955.patch
Type: text/x-patch
Size: 42354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200109/e300c70c/attachment-0001.bin>


More information about the llvm-commits mailing list