[Mlir-commits] [mlir] [mlir] Extend SCF loopUnrollByFactor to return the result loops (PR #114573)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Nov 4 10:30:07 PST 2024
================
@@ -111,11 +111,18 @@ LogicalResult coalescePerfectlyNestedSCFForLoops(scf::ForOp op);
void collapseParallelLoops(RewriterBase &rewriter, scf::ParallelOp loops,
ArrayRef<std::vector<unsigned>> combinedDimensions);
-/// Unrolls this for operation by the specified unroll factor. Returns failure
-/// if the loop cannot be unrolled either due to restrictions or due to invalid
-/// unroll factors. Requires positive loop bounds and step. If specified,
-/// annotates the Ops in each unrolled iteration by applying `annotateFn`.
-LogicalResult loopUnrollByFactor(
+struct UnrolledLoopInfo {
+ scf::ForOp mainLoopOp;
+ scf::ForOp epilogueLoopOp;
+};
+
+/// Unrolls this for operation by the specified unroll factor. Returns the
----------------
MaheshRavishankar wrote:
If both could be null, then both could be optional. I dont know if there is a consistency in MLIR on this, but I prefer optional to not having `nullptr`s floating around. `optional` makes it more clear that the value "could" be `nullopt`.
https://github.com/llvm/llvm-project/pull/114573
More information about the Mlir-commits
mailing list