[Mlir-commits] [mlir] [mlir][Vector] Add utility for computing scalable value bounds (PR #83876)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Mar 19 10:38:13 PDT 2024


================
@@ -0,0 +1,140 @@
+// RUN: mlir-opt %s -test-affine-reify-value-bounds -cse -verify-diagnostics \
+// RUN:   -verify-diagnostics -split-input-file | FileCheck %s
+
+#fixedDim0Map = affine_map<(d0)[s0] -> (-d0 + 32400, s0)>
+#fixedDim1Map = affine_map<(d0)[s0] -> (-d0 + 16, s0)>
+
+// Here the upper bound for min_i is 4 x vscale, as we know 4 x vscale is
+// always less than 32400. The bound for min_j is 16 as at vscale > 4,
+// 4 x vscale will be > 16, so the value will be clamped at 16.
----------------
banach-space wrote:

[nit] IMHO, the comment would be clearer if it read:
* "UB for min_i is X, because we know that X is always less than Y"
* "UB for min_i is V, because we know that V is always less than U"

```suggestion
// Here the upper bound for min_i is 4 x vscale, as we know 4 x vscale is
// always less than 32400. The bound for min_j is 16 as 16 is always less
// 4 x vscale_max (vscale_max is the UB for vscale).
```

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


More information about the Mlir-commits mailing list