[Mlir-commits] [mlir] [mlir][vector] Use `DenseI64ArrayAttr` in vector.multi_reduction (PR #102637)

Jakub Kuderski llvmlistbot at llvm.org
Fri Aug 9 10:05:59 PDT 2024


================
@@ -467,8 +466,8 @@ LogicalResult MultiDimReductionOp::verify() {
   Type inferredReturnType;
   auto sourceScalableDims = getSourceVectorType().getScalableDims();
   for (auto it : llvm::enumerate(getSourceVectorType().getShape()))
-    if (!llvm::any_of(getReductionDims().getValue(), [&](Attribute attr) {
-          return llvm::cast<IntegerAttr>(attr).getValue() == it.index();
+    if (!llvm::any_of(getReductionDims(), [&](int64_t dim) {
+          return dim == static_cast<int64_t>(it.index());
         })) {
       targetShape.push_back(it.value());
       scalableDims.push_back(sourceScalableDims[it.index()]);
----------------
kuhar wrote:

nit: we could use structured bindings for index and value here. This is existing code, so feel free to ignore.

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


More information about the Mlir-commits mailing list