[mlir][Transforms] Fix replaceUsesOfBlockArgument API (#144706)
Before this PR, users had to pass the "old" block argument when replacing the uses of a block argument in a newly converted block. Users can now pass the actual block argument that should be replaced. Note for LLVM integration: Make sure to pass the current block argument instead of the old one.
This commit is contained in:
committed by
GitHub
parent
278ece7c80
commit
a4e4527c4b
@@ -295,7 +295,7 @@ static void restoreByValRefArgumentType(
|
||||
cast<TypeAttr>(byValRefAttr->getValue()).getValue());
|
||||
|
||||
auto valueArg = rewriter.create<LLVM::LoadOp>(arg.getLoc(), resTy, arg);
|
||||
rewriter.replaceUsesOfBlockArgument(oldArg, valueArg);
|
||||
rewriter.replaceUsesOfBlockArgument(arg, valueArg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1743,7 +1743,7 @@ void ConversionPatternRewriter::replaceUsesOfBlockArgument(BlockArgument from,
|
||||
});
|
||||
impl->appendRewrite<ReplaceBlockArgRewrite>(from.getOwner(), from,
|
||||
impl->currentTypeConverter);
|
||||
impl->mapping.map(impl->mapping.lookupOrDefault(from), to);
|
||||
impl->mapping.map(from, to);
|
||||
}
|
||||
|
||||
Value ConversionPatternRewriter::getRemappedValue(Value key) {
|
||||
|
||||
Reference in New Issue
Block a user