[clang] [clang-tools-extra] [llvm] [mlir] [mlir][TilingInterface] Early return cloned ops if tile sizes are zeros. (PR #75410)

Han-Chung Wang via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 10:00:07 PST 2023


================
@@ -362,14 +362,20 @@ mlir::scf::tileUsingSCFForOp(RewriterBase &rewriter, TilingInterface op,
   auto clonedOp = cast<TilingInterface>(
       cloneOpAndUpdateDestinationArgs(rewriter, op, clonedOpDestination));
 
-  // 5b. Tile the cloned operation.
+  // 5b. Early return cloned op if tiling is not happening.
----------------
hanhanW wrote:

I just tested it locally, and think it makes sense to return the cloned op. The suggestion will lead to `rewriter.replace(op, op->getResults())` and get the crash. Returning the cloned op instead of `op` itself or `failure` makes more sense in this case. I will add some comments to it.

https://github.com/llvm/llvm-project/pull/75410


More information about the cfe-commits mailing list