[Mlir-commits] [mlir] [mlir][Arm] Fix invalid rewrite pattern API violations (PR #78246)
Matthias Springer
llvmlistbot at llvm.org
Tue Jan 16 03:47:09 PST 2024
================
@@ -263,14 +260,26 @@ struct AssignTileIDsPattern
SetVector<Operation *> dependantOps;
findDependantOps(tileOp->getResult(0), dependantOps);
auto tileIDAttr = rewriter.getI32IntegerAttr(*tileId);
- rewriter.updateRootInPlace(tileOp, [&] { tileOp.setTileId(tileIDAttr); });
for (auto *op : dependantOps) {
if (auto dependantTileOp = llvm::dyn_cast<ArmSMETileOpInterface>(op)) {
auto currentTileId = dependantTileOp.getTileId();
if (currentTileId && unsigned(currentTileId.getInt()) != tileId)
return dependantTileOp.emitOpError(
"already assigned different SME virtual tile!");
- dependantTileOp.setTileId(tileIDAttr);
+ }
+ }
+
+ // Rewrite IR.
+ if (!tileIsInMemory)
+ setDiscardableIntAttr(kTilesInUseAttr, tilesInUse);
+ else {
+ setDiscardableIntAttr(kNextInMemoryTileIdAttr, *tileId + 1);
+ }
+ rewriter.updateRootInPlace(tileOp, [&] { tileOp.setTileId(tileIDAttr); });
+ for (auto *op : dependantOps) {
+ if (auto dependantTileOp = llvm::dyn_cast<ArmSMETileOpInterface>(op)) {
+ rewriter.updateRootInPlace(
+ dependantTileOp, [&]() { dependantTileOp.setTileId(tileIDAttr); });
----------------
matthias-springer wrote:
Here's an attempt to improve the situation: #78260
https://github.com/llvm/llvm-project/pull/78246
More information about the Mlir-commits
mailing list