[Mlir-commits] [mlir] Fix the description of the semantics of math.clampf (PR #175012)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jan 8 08:21:29 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-math

Author: Jack (jack-slingsby)

<details>
<summary>Changes</summary>

The semantics of `math.clampf` as described in the op definition are incorrect. This fixes that. There isn't a folder (yet) for clamp so only the description needs updating.

---
Full diff: https://github.com/llvm/llvm-project/pull/175012.diff


1 Files Affected:

- (modified) mlir/include/mlir/Dialect/Math/IR/MathOps.td (+1-1) 


``````````diff
diff --git a/mlir/include/mlir/Dialect/Math/IR/MathOps.td b/mlir/include/mlir/Dialect/Math/IR/MathOps.td
index af65af6fedec6..432f08b14a989 100644
--- a/mlir/include/mlir/Dialect/Math/IR/MathOps.td
+++ b/mlir/include/mlir/Dialect/Math/IR/MathOps.td
@@ -365,7 +365,7 @@ def Math_ClampFOp : Math_FloatTernaryOp<"clampf"> {
 
     The semantics of the operation are described by:
     ```
-      clampf(value, min, max) = maxf(minf(value, min), max)
+      clampf(value, min, max) = minf(maxf(value, min), max)
     ```
 
     Example:

``````````

</details>


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


More information about the Mlir-commits mailing list