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 @@ -410,9 +410,12 @@ } 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 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 = {}">];