[Mlir-commits] [mlir] [mlir][ArmSVE] Add convert_to/from_svbool ops (PR #68586)

Cullen Rhodes llvmlistbot at llvm.org
Wed Oct 11 02:38:42 PDT 2023


================
@@ -481,10 +500,32 @@ class IsScalableVectorOfLengthPred<list<int> allowedLengths> :
                            == }]
                          # allowedlength>)>]>;
 
+class abs<int value> {
+  int ret = !if(!lt(value, 0), !sub(0, value), value);
+}
+
+// Whether the n-th (starting from 1) dim of the shape matches the given `size`.
+// Negative values index in reverse.
----------------
c-rhodes wrote:

I'm not sure I like the idea of positive indices starting from 1, it doesn't feel right. If I saw `IsNthDimSizeIsOneOfPred<1, ...>` I would expect this to be dim 1 and not dim 0. Looking for similar constraints I spotted the `IntArrayNthElem...` also defined in this file and these index from 0. I think the following would be better.

```
shape = (2, 4)

IsNthDimSizeIsOneOfPred<-1, ...> ; 4
IsNthDimSizeIsOneOfPred<0,  ...> ; 2
```

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


More information about the Mlir-commits mailing list