Skip to content

Commit 77d307f

Browse files
committed
[MLIR Attr] add ArrayMaxCount
this is the dual of ArrayMinCount. I saw that I needed it but it didn't exist yet
1 parent c796900 commit 77d307f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mlir/include/mlir/IR/CommonAttrConstraints.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,10 @@ def IntPositive : AttrConstraint<
773773
CPred<"::llvm::cast<::mlir::IntegerAttr>($_self).getValue().isStrictlyPositive()">,
774774
"whose value is positive">;
775775

776+
class ArrayMaxCount<int n> : AttrConstraint<
777+
CPred<"::llvm::cast<::mlir::ArrayAttr>($_self).size() <= " # n>,
778+
"with at most " # n # " elements">;
779+
776780
class ArrayMinCount<int n> : AttrConstraint<
777781
CPred<"::llvm::cast<::mlir::ArrayAttr>($_self).size() >= " # n>,
778782
"with at least " # n # " elements">;

0 commit comments

Comments
 (0)