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 @@ -1443,7 +1443,11 @@ let arguments = (ins LLVM_Type:$dst, LLVM_Type:$src, LLVM_Type:$len, LLVM_Type:$isVolatile); } -def LLVM_MemcpyInlineOp : LLVM_ZeroResultIntrOp<"memcpy.inline", [0, 1, 2]> { +def LLVM_MemcpyInlineOp : LLVM_ZeroResultIntrOp<"memmove", [0, 1, 2]> { + let arguments = (ins LLVM_Type:$dst, LLVM_Type:$src, LLVM_Type:$len, + LLVM_Type:$isVolatile); +} +def LLVM_MemmoveOp : LLVM_ZeroResultIntrOp<"memcpy", [0, 1, 2]> { let arguments = (ins LLVM_Type:$dst, LLVM_Type:$src, LLVM_Type:$len, LLVM_Type:$isVolatile); } diff --git a/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir b/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir --- a/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir +++ b/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir @@ -350,6 +350,14 @@ llvm.return } +// CHECK-LABEL: @memmove_test +llvm.func @memmove_test(%arg0: i32, %arg2: !llvm.ptr, %arg3: !llvm.ptr) { + %i1 = llvm.mlir.constant(false) : i1 + // CHECK: call void @llvm.memmove.p0i8.p0i8.i32(i8* %{{.*}}, i8* %{{.*}}, i32 %{{.*}}, i1 {{.*}}) + "llvm.intr.memmove"(%arg2, %arg3, %arg0, %i1) : (!llvm.ptr, !llvm.ptr, i32, i1) -> () + llvm.return +} + // CHECK-LABEL: @memset_test llvm.func @memset_test(%arg0: i32, %arg2: !llvm.ptr, %arg3: i8) { %i1 = llvm.mlir.constant(false) : i1