[Mlir-commits] [mlir] [MLIR][Linalg] More Linalg named ops (PR #90236)

Jianhui Li llvmlistbot at llvm.org
Fri Apr 26 11:33:20 PDT 2024


================
@@ -239,6 +299,25 @@ def max(
     O[None] = BinaryFn.max_signed(lhs[None], rhs[None])
 
 
+ at linalg_structured_op
+def min(
+    lhs=TensorDef(T1),
+    rhs=TensorDef(T1),
+    O=TensorDef(T1, output=True),
+):
+    """Takes the min (signed) between two inputs, elementwise.
+
+    The shapes and element types must be identical. The appropriate casts,
+    broadcasts and reductions should be done previously to calling this op.
+
+    This means reduction/broadcast/element cast semantics is explicit. Further
+    passes can take that into account when lowering this code. For example,
+    a `linalg.broadcast` + `linalg.div` sequence can be lowered to a
----------------
Jianhui-Li wrote:

linalg.div => linalg.min

https://github.com/llvm/llvm-project/pull/90236


More information about the Mlir-commits mailing list