[Mlir-commits] [mlir] Add support of param type for transform.structured.tile_using_forall (PR #72097)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Fri Jan 19 01:22:58 PST 2024
================
@@ -123,14 +135,25 @@ static DiagnosedSilenceableFailure unpackSingleIndexResultPayloadOperations(
return DiagnosedSilenceableFailure::success();
}
-// Given a list of OpFoldResults that are either index attrs or op
-// handles, return a list of OpFoldResults where all op handles are
-// replaced with the first (and only) OpResult of that payload op. (There
-// must be exactly one mapped payload op and it must have exactly one
-// index result.)
+// Given a list of params that are index attrs or a list of OpFoldResults
+// that are either index attrs or op handles, return a list of OpFoldResults
+// of index attrs or a list of OpFoldResults where all op handles are
+// replaced with the first (and only) OpResult of that payload op.
+// (There must be exactly one parameter associated with the AnyParamType or
+// one mapped payload op which must have exactly one index result.)
static DiagnosedSilenceableFailure unpackSingleIndexResultPayloadOperations(
transform::TransformState &state, TransformOpInterface transformOp,
SmallVector<OpFoldResult> &result, Value packedHandle) {
+ if (isa<AnyParamType>(packedHandle.getType())) {
+ ArrayRef<Attribute> params = state.getParams(packedHandle);
+ for (auto param : params) {
+ if (!isa<IntegerAttr>(param))
+ return transformOp.emitDefiniteFailure() << "expected IntegerAttr";
----------------
ftynse wrote:
Nit: something like "expected the parameter to be associated with an integer attribute" would be much more descriptive for the user here.
https://github.com/llvm/llvm-project/pull/72097
More information about the Mlir-commits
mailing list