[Mlir-commits] [mlir] [mlir][AMGPU] Replace use of SmallVector with ArrayRef, NFC (PR #163770)

Jakub Kuderski llvmlistbot at llvm.org
Thu Oct 16 06:51:25 PDT 2025


================
@@ -757,8 +757,8 @@ struct PackScales final : OpRewritePattern<ScaledMFMAOp> {
         offset = numElements - 4l;
       }
       Type scaleSrcElemType = scaleSrcType.getElementType();
-      auto newSrcType = VectorType::get(SmallVector<int64_t>({numElements}),
-                                        scaleSrcElemType);
+      auto newSrcType =
+          VectorType::get(ArrayRef<int64_t>{numElements}, scaleSrcElemType);
----------------
kuhar wrote:

```suggestion
          VectorType::get(ArrayRef{numElements}, scaleSrcElemType);
```

You should be able to omit the type here based on CTAD: https://en.cppreference.com/w/cpp/language/class_template_argument_deduction.html

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


More information about the Mlir-commits mailing list