[Mlir-commits] [mlir] [mlir][TilingInterface] Extend option to yield replacement for multiple results case (PR #93144)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jun 4 00:06:42 PDT 2024


================
@@ -190,10 +190,14 @@ tileAndFuseProducerOfSlice(RewriterBase &rewriter,
 /// where `%0` had other uses as well. If not reconstructed from within the loop
 /// body, uses of `%0` could not be replaced, making it still live and the
 /// fusion immaterial.
+///
+/// The @param `yieldResultNumber` decides which result would be yield. If not
+/// given, yield all `opResult` of fused producer.
----------------
Yun-Fly wrote:

Good question, I understand what your concern. IMO, whether yield replacement for fused producer or not is controlled by `fusionControlFn` rather than this function. If user does not want to yield replacement for fused producer, this function should never be called, Otherwise, it expects for the non-empty `yieldResultNumber` and that is why `std::nullopt` represents all results here. As for `ArrayRef<unsigned>{}`, here is some possible solution:
1. throw failure.
2. treat it as same as `std::nullopt`. 
3. use `ArraryRef{}` as default argument, then no ambiguity between `std::nullopt` and `ArraryRef{}`.

Let me know your thought.

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


More information about the Mlir-commits mailing list