Index: mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td =================================================================== --- mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -1436,6 +1436,8 @@ def LLVM_MinimumOp : LLVM_BinarySameArgsIntrinsicOp<"minimum">; def LLVM_SMaxOp : LLVM_BinarySameArgsIntrinsicOp<"smax">; def LLVM_SMinOp : LLVM_BinarySameArgsIntrinsicOp<"smin">; +def LLVM_UMaxOp : LLVM_BinarySameArgsIntrinsicOp<"umax">; +def LLVM_UMinOp : LLVM_BinarySameArgsIntrinsicOp<"umin">; def LLVM_MemcpyOp : LLVM_ZeroResultIntrOp<"memcpy", [0, 1, 2]> { let arguments = (ins LLVM_Type:$dst, LLVM_Type:$src, LLVM_Type:$len, Index: mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir =================================================================== --- mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir +++ mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir @@ -218,6 +218,24 @@ llvm.return } +// CHECK-LABEL: @umax_test +llvm.func @umax_test(%arg0: i32, %arg1: i32, %arg2: vector<8xi32>, %arg3: vector<8xi32>) { + // CHECK: call i32 @llvm.umax.i32 + "llvm.intr.umax"(%arg0, %arg1) : (i32, i32) -> i32 + // CHECK: call <8 x i32> @llvm.umax.v8i32 + "llvm.intr.umax"(%arg2, %arg3) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32> + llvm.return +} + +// CHECK-LABEL: @umin_test +llvm.func @umin_test(%arg0: i32, %arg1: i32, %arg2: vector<8xi32>, %arg3: vector<8xi32>) { + // CHECK: call i32 @llvm.umin.i32 + "llvm.intr.umin"(%arg0, %arg1) : (i32, i32) -> i32 + // CHECK: call <8 x i32> @llvm.umin.v8i32 + "llvm.intr.umin"(%arg2, %arg3) : (vector<8xi32>, vector<8xi32>) -> vector<8xi32> + llvm.return +} + // CHECK-LABEL: @vector_reductions llvm.func @vector_reductions(%arg0: f32, %arg1: vector<8xf32>, %arg2: vector<8xi32>) { // CHECK: call i32 @llvm.vector.reduce.add.v8i32