[PATCH] D73764: [mlir] Added RankedIntElementsAttr class
Alex Zinenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 31 00:37:19 PST 2020
ftynse requested changes to this revision.
ftynse added inline comments.
This revision now requires changes to proceed.
================
Comment at: mlir/include/mlir/IR/OpBase.td:1039
+ IntElementsAttr<width> {
+ let predicate = CPred<"$_self.isa<DenseIntElementsAttr>() && "
+ "$_self.cast<DenseIntElementsAttr>().getType()."
----------------
Would it be possible to make this a bit more readable than a 7-line flow of tokens? One suggestion is to use (1) reuse the predicate of IntElementsAttr and (2) use the `And` class to combine predicates instead of manual "&&". We actually have an expression simplifier in the op that relies on that.
================
Comment at: mlir/include/mlir/IR/OpBase.td:1044
+ "$_self.cast<DenseIntElementsAttr>().getType().getShape() == "
+ "llvm::ArrayRef<int64_t>({" # StrJoinInt<dims>.result # "})">;
+
----------------
Drop `llvm::`, ArrayRef is re-exported into the mlir namespace
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73764/new/
https://reviews.llvm.org/D73764
More information about the llvm-commits
mailing list