diff options
| author | Chia-hung Duan <chiahungduan@google.com> | 2022-03-23 21:37:26 +0000 |
|---|---|---|
| committer | Chia-hung Duan <chiahungduan@google.com> | 2022-03-23 22:13:48 +0000 |
| commit | 14ecafd0bdc2abaf232fd7761b45aed94461c959 (patch) | |
| tree | 8814c43e42f9b048c306f5f3e35bf8c40b810b42 /mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp | |
| parent | 00cc73044d8a8416b0c954d72bfe83bb27ec34e7 (diff) | |
[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
Diffstat (limited to 'mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp')
| -rw-r--r-- | mlir/lib/Conversion/LLVMCommon/VectorPattern.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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, |
