[Mlir-commits] [mlir] [mlir][ArmSME] Add rudimentary support for tile spills to the stack (PR #76086)
Benjamin Maxwell
llvmlistbot at llvm.org
Thu Dec 21 07:06:11 PST 2023
================
@@ -246,16 +259,18 @@ struct AssignTileIDsPattern
// This case would require allocating a new tile for the result of the
// scf.if, and moving the contents of %tileA or %tileB to result tile (based
// on the %some_cond).
+ // Find all the ops that (transitively) depend on this tile.
+ SetVector<Operation *> dependantOps;
+ findDependantOps(tileOp->getResult(0), dependantOps);
auto tileIDAttr = rewriter.getI32IntegerAttr(*tileId);
- rewriter.updateRootInPlace(tileOp, [&]() { tileOp.setTileId(tileIDAttr); });
+ rewriter.updateRootInPlace(tileOp, [&] { tileOp.setTileId(tileIDAttr); });
for (auto *op : dependantOps) {
- if (auto tileOp = llvm::dyn_cast<ArmSMETileOpInterface>(op)) {
- auto currentTileId = tileOp.getTileId();
+ if (auto dependantTileOp = llvm::dyn_cast<ArmSMETileOpInterface>(op)) {
+ auto currentTileId = dependantTileOp.getTileId();
if (currentTileId && unsigned(currentTileId.getInt()) != tileId)
- return tileOp.emitOpError(
+ return dependantTileOp.emitOpError(
"already assigned different SME virtual tile!");
- rewriter.updateRootInPlace(tileOp,
----------------
MacDue wrote:
Because `tileOp` is not the root op here. I renamed it to `dependantTileOp` to make that clearer.
https://github.com/llvm/llvm-project/pull/76086
More information about the Mlir-commits
mailing list