[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Simplify handling of dropped arguments (PR #96207)

Matthias Springer llvmlistbot at llvm.org
Fri Jun 21 03:28:52 PDT 2024


================
@@ -246,6 +246,13 @@ depending on the situation.
 
     -   An argument materialization is used when converting the type of a block
         argument during a [signature conversion](#region-signature-conversion).
+        The new block argument types are specified in a `SignatureConversion`
+        object. An original block argument can be converted into multiple
+        block arguments, which is not supported everywhere in the dialect
+        conversion. (E.g., adaptors support only a single replacement value for
+        each original value.) Therefore, an argument materialization is used to
+        convert potentially multiple new block arguments back into a single SSA
+        value.
----------------
matthias-springer wrote:

That is my understanding. Normally, we would pass on N values to the adaptor, but it only supports a single SSA value. @ingomueller-net's 1:N dialect conversion has new adapters that support multiple replacement values, but they cannot be used in the existing dialect conversion.

The adaptor does not see the old bbarg, but the result of `materializeArgumentConversion`. When that conversion it called, a result type is provided, which is `converter->convertType(oldBbArg.getType())`. So there is the expectation that the old bbarg type can be converted to a single new bbarg type. (Even though the block signature conversion that the user requested may split up the bbarg into multiple SSA block arguments.)


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


More information about the Mlir-commits mailing list