From d18064f1f82f576a5d6069703de574206990d08a Mon Sep 17 00:00:00 2001 From: Prashant Kumar Date: Fri, 27 Sep 2024 00:38:09 +0530 Subject: [PATCH] =?UTF-8?q?[COMMON]=20Select=20the=20last=20compute=20op?= =?UTF-8?q?=20that=20has=20workgroup=20tilin=E2=80=A6=20(#18604)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …g level Remove the check "expected only one op with a workgroup tiling level". --- .../compiler/Codegen/Common/TileDispatchUsingForall.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/src/iree/compiler/Codegen/Common/TileDispatchUsingForall.cpp b/compiler/src/iree/compiler/Codegen/Common/TileDispatchUsingForall.cpp index 03d278047132..e722fcb8240b 100644 --- a/compiler/src/iree/compiler/Codegen/Common/TileDispatchUsingForall.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/TileDispatchUsingForall.cpp @@ -53,18 +53,17 @@ struct TilingInfo { static FailureOr getTiledAndDistributionInfo(RewriterBase &rewriter, ArrayRef computeOps) { - // It is expected that at most one compute op has a workgroup tiling level. + // TODO: It is expected that at most one compute op has a workgroup tiling + // level. Currently, it selects the last compute op that has workgroup tiling + // level. Operation *tilableOp = nullptr; for (Operation *op : llvm::reverse(computeOps)) { if (getLoweringConfig(op)) { if (!getLoweringConfig(op).hasWorkgroupTilingLevel()) { continue; } - if (tilableOp) { - return op->emitOpError("expected only one op with a workgroup tiling" - "level."); - } tilableOp = op; + break; } } if (!tilableOp) {