diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -412,7 +412,9 @@ : LLVM_OneResultOp<"shufflevector", [NoSideEffect]>, Arguments<(ins LLVM_Type:$v1, LLVM_Type:$v2, ArrayAttr:$mask)>, LLVM_Builder< - "$res = builder.CreateShuffleVector($v1, $v2, extractPosition($mask));"> { + "SmallVector Position = extractPosition($mask);" + "SmallVector 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 attrs = {}">];