diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td index 54ace65efa08..6f19e4a6bbab 100644 --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -770,11 +770,6 @@ def LLVM_InsertValueOp : LLVM_Op< DenseI64ArrayAttr:$position); let results = (outs LLVM_AnyAggregate:$res); - let builders = [ - OpBuilder<(ins "Value":$container, "Value":$value, - "ArrayRef":$position)> - ]; - let assemblyFormat = [{ $value `,` $container `` $position attr-dict `:` type($container) custom(type($value), ref(type($container)), diff --git a/mlir/include/mlir/IR/Builders.h b/mlir/include/mlir/IR/Builders.h index 29e42768b2b9..687f6679913a 100644 --- a/mlir/include/mlir/IR/Builders.h +++ b/mlir/include/mlir/IR/Builders.h @@ -138,6 +138,7 @@ public: DenseIntElementsAttr getIndexTensorAttr(ArrayRef values); /// Tensor-typed DenseArrayAttr getters. + DenseBoolArrayAttr getDenseBoolArrayAttr(ArrayRef values); DenseI8ArrayAttr getDenseI8ArrayAttr(ArrayRef values); DenseI16ArrayAttr getDenseI16ArrayAttr(ArrayRef values); DenseI32ArrayAttr getDenseI32ArrayAttr(ArrayRef values); diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td index 4047440d11f9..330d26cf9b74 100644 --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -1291,6 +1291,7 @@ class DenseArrayAttrBase { let storageType = "::mlir::" # denseAttrName; let returnType = "::llvm::ArrayRef<" # cppType # ">"; + let constBuilderCall = "$_builder.get" # denseAttrName # "($0)"; } def DenseBoolArrayAttr : DenseArrayAttrBase<"DenseBoolArrayAttr", "bool", "i1">; def DenseI8ArrayAttr : DenseArrayAttrBase<"DenseI8ArrayAttr", "int8_t", "i8">; diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp index a92cfbd46fc5..5c604e4b0c3e 100644 --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp @@ -1619,13 +1619,6 @@ LogicalResult InsertValueOp::verify() { return success(); } -void InsertValueOp::build(OpBuilder &builder, OperationState &state, - Value container, Value value, - ArrayRef position) { - build(builder, state, container.getType(), container, value, - builder.getAttr(position)); -} - //===----------------------------------------------------------------------===// // ReturnOp //===----------------------------------------------------------------------===// diff --git a/mlir/lib/IR/Builders.cpp b/mlir/lib/IR/Builders.cpp index eb841da88f6d..50f84a699822 100644 --- a/mlir/lib/IR/Builders.cpp +++ b/mlir/lib/IR/Builders.cpp @@ -124,6 +124,10 @@ DenseIntElementsAttr Builder::getIndexVectorAttr(ArrayRef values) { values); } +DenseBoolArrayAttr Builder::getDenseBoolArrayAttr(ArrayRef values) { + return DenseBoolArrayAttr::get(context, values); +} + DenseI8ArrayAttr Builder::getDenseI8ArrayAttr(ArrayRef values) { return DenseI8ArrayAttr::get(context, values); }