[Mlir-commits] [mlir] 2d9a02a - Update LLVMOps for CreateShuffleVector deprecation and rework
Eric Christopher
llvmlistbot at llvm.org
Mon Apr 20 15:50:56 PDT 2020
Author: Eric Christopher
Date: 2020-04-20T15:50:29-07:00
New Revision: 2d9a02a63a101a5b73424f2881de8c978180c3bc
URL: https://github.com/llvm/llvm-project/commit/2d9a02a63a101a5b73424f2881de8c978180c3bc
DIFF: https://github.com/llvm/llvm-project/commit/2d9a02a63a101a5b73424f2881de8c978180c3bc.diff
LOG: Update LLVMOps for CreateShuffleVector deprecation and rework
creation string.
Differential Revision: https://reviews.llvm.org/D78519
Added:
Modified:
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index eac663795453..c9ee88c77010 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -410,9 +410,12 @@ def LLVM_InsertValueOp : LLVM_OneResultOp<"insertvalue", [NoSideEffect]>,
}
def LLVM_ShuffleVectorOp
: LLVM_OneResultOp<"shufflevector", [NoSideEffect]>,
- Arguments<(ins LLVM_Type:$v1, LLVM_Type:$v2, ArrayAttr:$mask)>,
- LLVM_Builder<
- "$res = builder.CreateShuffleVector($v1, $v2, extractPosition($mask));"> {
+ Arguments<(ins LLVM_Type:$v1, LLVM_Type:$v2, ArrayAttr:$mask)> {
+ string llvmBuilder = [{
+ SmallVector<unsigned, 4> position = extractPosition($mask);
+ SmallVector<int, 4> mask(position.begin(), position.end());
+ $res = builder.CreateShuffleVector($v1, $v2, mask);
+ }];
let builders = [OpBuilder<
"Builder *b, OperationState &result, Value v1, Value v2, "
"ArrayAttr mask, ArrayRef<NamedAttribute> attrs = {}">];
More information about the Mlir-commits
mailing list