[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N support to `replaceUsesOfBlockArgument` (PR #145171)

2025-06-21 Thread Jeremy Kun via llvm-branch-commits

https://github.com/j2kun approved this pull request.


https://github.com/llvm/llvm-project/pull/145171
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [mlir][Transforms] Dialect conversion: Add missing erasure notifications (PR #145030)

2025-06-20 Thread Jeremy Kun via llvm-branch-commits

https://github.com/j2kun approved this pull request.

LGTM!

https://github.com/llvm/llvm-project/pull/145030
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [mlir][Transforms] Add 1:N support to `replaceUsesOfBlockArgument` (PR #145171)

2025-06-21 Thread Jeremy Kun via llvm-branch-commits


@@ -1434,12 +1439,15 @@ Block 
*ConversionPatternRewriterImpl::applySignatureConversion(
 if (!inputMap) {
   // This block argument was dropped and no replacement value was provided.
   // Materialize a replacement value "out of thin air".
-  buildUnresolvedMaterialization(
-  MaterializationKind::Source,
-  OpBuilder::InsertPoint(newBlock, newBlock->begin()), 
origArg.getLoc(),
-  /*valuesToMap=*/{origArg}, /*inputs=*/ValueRange(),
-  /*outputTypes=*/origArgType, /*originalType=*/Type(), converter);
-  appendRewrite(block, origArg, converter);

j2kun wrote:

Was it a bug here that this step did not update `mapping`? (and in this PR now 
it does via replaceUsesOfBlockArgument)

https://github.com/llvm/llvm-project/pull/145171
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Store per-pattern IR modifications in separate state (PR #145319)

2025-06-23 Thread Jeremy Kun via llvm-branch-commits

https://github.com/j2kun approved this pull request.


https://github.com/llvm/llvm-project/pull/145319
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] Store per-pattern IR modifications in separate state (PR #145319)

2025-06-23 Thread Jeremy Kun via llvm-branch-commits


@@ -2131,6 +2150,15 @@ OperationLegalizer::legalize(Operation *op,
   return failure();
 }
 
+/// Helper function that moves and returns the given object. Also resets the
+/// original object, so that it is in a valid, empty state again.

j2kun wrote:

I am no C++ whiz but this unusual. Perhaps the comment could be expanded to 
explain why this is needed?

https://github.com/llvm/llvm-project/pull/145319
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits