[Mlir-commits] [mlir] [mlir][Arm] Fix invalid rewrite pattern API violations (PR #78246)
Benjamin Maxwell
llvmlistbot at llvm.org
Tue Jan 16 02:20:51 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); });
----------------
MacDue wrote:
nit:
```suggestion
dependantTileOp, [&] { dependantTileOp.setTileId(tileIDAttr); });
```
https://github.com/llvm/llvm-project/pull/78246
More information about the Mlir-commits
mailing list