From 14ecafd0bdc2abaf232fd7761b45aed94461c959 Mon Sep 17 00:00:00 2001 From: Chia-hung Duan Date: Wed, 23 Mar 2022 21:37:26 +0000 Subject: [mlir] Make OpBuilder::createOperation to accept raw inputs This provides a way to create an operation without manipulating OperationState directly. This is useful for creating unregistered ops. Reviewed By: rriddle, mehdi_amini Differential Revision: https://reviews.llvm.org/D120787 --- mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp') diff --git a/mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp b/mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp index 54c5b93877ff..95aedef7764f 100644 --- a/mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp +++ b/mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp @@ -130,11 +130,10 @@ LogicalResult LLVM::detail::vectorOneToOneRewrite( auto callback = [op, targetOp, &rewriter](Type llvm1DVectorTy, ValueRange operands) { - OperationState state(op->getLoc(), targetOp); - state.addTypes(llvm1DVectorTy); - state.addOperands(operands); - state.addAttributes(op->getAttrs()); - return rewriter.createOperation(state)->getResult(0); + return rewriter + .create(op->getLoc(), rewriter.getStringAttr(targetOp), operands, + llvm1DVectorTy, op->getAttrs()) + ->getResult(0); }; return handleMultidimensionalVectors(op, operands, typeConverter, callback, -- cgit v1.2.3