[Mlir-commits] [mlir] 6878426 - [mlir] Move constBuidlerCall from to ArrayAttrBase

Alex Zinenko llvmlistbot at llvm.org
Tue Feb 8 00:31:21 PST 2022


Author: Alex Zinenko
Date: 2022-02-08T09:31:11+01:00
New Revision: 68784267b1b378a1043c473e43fd37ada2507314

URL: https://github.com/llvm/llvm-project/commit/68784267b1b378a1043c473e43fd37ada2507314
DIFF: https://github.com/llvm/llvm-project/commit/68784267b1b378a1043c473e43fd37ada2507314.diff

LOG: [mlir] Move constBuidlerCall from to ArrayAttrBase

This makes it applicable to both ArrayAttr and its typed subclasses instead of
only the latter. There is no good reason why ArrayAttr shouldn't be
const-buildable while its typed subclasses are, this was likely just an
omission.

Depends On D119113

Reviewed By: rriddle, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D119114

Added: 
    

Modified: 
    mlir/include/mlir/IR/OpBase.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td
index 80a094930c2b5..064145724ab72 100644
--- a/mlir/include/mlir/IR/OpBase.td
+++ b/mlir/include/mlir/IR/OpBase.td
@@ -1655,6 +1655,7 @@ class ArrayAttrBase<Pred condition, string summary> : Attr<condition, summary> {
   let returnType = [{ ::mlir::ArrayAttr }];
   let valueType = NoneType;
   let convertFromStorage = "$_self";
+  let constBuilderCall = "$_builder.getArrayAttr($0)";
 }
 
 def ArrayAttr : ArrayAttrBase<CPred<"$_self.isa<::mlir::ArrayAttr>()">,
@@ -1672,7 +1673,6 @@ class TypedArrayAttrBase<Attr element, string summary>: ArrayAttrBase<
                                SubstLeaves<"$_self", "attr", element.predicate>,
                             "; })">]>,
     summary> {
-  let constBuilderCall = "$_builder.getArrayAttr($0)";
 
   Attr elementAttr = element;
 }


        


More information about the Mlir-commits mailing list