[Mlir-commits] [mlir] [mlir][vector-to-gpu]: Extend MMA Lowerings (PR #176785)

Hsiangkai Wang llvmlistbot at llvm.org
Tue Jan 27 01:53:00 PST 2026


================
@@ -130,7 +147,13 @@ static std::optional<int64_t> getStaticallyKnownRowStride(ShapedType type) {
   if (failed(memrefType.getStridesAndOffset(strides, offset)) ||
       strides.back() != 1)
     return std::nullopt;
-  int64_t stride = strides[strides.size() - 2];
+
+  int stridePostion = strides.size() - 2;
+  if (!permutationMap.isPermutation()) {
+    if (auto outerResult = dyn_cast<AffineDimExpr>(permutationMap.getResult(0)))
----------------
Hsiangkai wrote:

So, permutationMap must be 2D. Do we need to add some checking in this function?
When permutationMap[0] is not affine dimension, you skip the updating of `stridePostion` instead of returning std::nullopt. Can you add a test case to show it is still correct even when permutationMap[0] is not affine dimension.

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


More information about the Mlir-commits mailing list