[PATCH] D142445: [mlir][tensor|memref] Harden the checks on dim op

Matthias Springer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 03:29:11 PST 2023


springerm added inline comments.


================
Comment at: mlir/include/mlir/IR/OpBase.td:757-766
+class Non0RankedTensorOf<list<Type> allowedTypes>
+  : TensorOf<allowedTypes, [HasRankGreaterOrEqualPred<1>],
+      "non-0-ranked.tensor">;
+
 def AnyRankedTensor : RankedTensorOf<[AnyType]>;
+def AnyNon0RankedTensor  : Non0RankedTensorOf<[AnyType]>;
+def AnyUnrankedTensor  : UnrankedTensorOf<[AnyType]>;
----------------
Side note: Adding a manual check to the op verifier would just be two lines. Are there any other ops that could benefit from `Non0RankedTensorOf` etc.?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142445



More information about the llvm-commits mailing list