[Mlir-commits] [mlir] [mlir][vector] Canonicalize gathers/scatters with trivial offsets (PR #117939)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Dec 31 08:21:11 PST 2024


================
@@ -5184,6 +5184,23 @@ std::optional<SmallVector<int64_t, 4>> GatherOp::getShapeForUnroll() {
   return llvm::to_vector<4>(getVectorType().getShape());
 }
 
+/// Cheeck if `indexVec` is constant 1D vec of consecutive values [0, 1, 2, ...]
+static LogicalResult isContiguousIndices(Value indexVec) {
----------------
banach-space wrote:

This method doesn't care where the input came from (it could be indices, but it could be sth else). I suggest generalising the name.
```suggestion
static LogicalResult isZeroBasedContiguousSeq(Value indexVec) {
```

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


More information about the Mlir-commits mailing list