[Mlir-commits] [mlir] Add support of param type for transform.structured.tile_using_forall (PR #72097)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Nov 13 04:13:29 PST 2023


================
@@ -98,12 +98,34 @@ static DiagnosedSilenceableFailure unpackSingleIndexResultPayloadOperations(
       result.push_back(ofr);
       continue;
     }
-    auto payloadOps = state.getPayloadOps(ofr.get<Value>());
+
+    Value transformValue = ofr.get<Value>();
+    if (isa<ParamType>(transformValue.getType())) {
+      ArrayRef<Attribute> params = state.getParams(transformValue);
+      if (!isa<IntegerAttr>(params[0]))
+        return transformOp.emitDefiniteFailure() << "expected IntegerAttr";
+      result.push_back(params[0]);
+      continue;
+    }
+    if (isa<AnyParamType>(transformValue.getType())) {
+      ArrayRef<Attribute> params = state.getParams(transformValue);
+      if (!isa<ArrayAttr>(params[0]))
----------------
ftynse wrote:

Please add a check that there is exactly one parameter associated. The association may be an empty list, at which point this code will crash.

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


More information about the Mlir-commits mailing list