@@ -136,8 +136,8 @@ def ExecuteRegionOp : SCF_Op<"execute_region", [
136136def ForOp : SCF_Op<"for",
137137 [AutomaticAllocationScope, DeclareOpInterfaceMethods<LoopLikeOpInterface,
138138 ["getInitsMutable", "getLoopResults", "getRegionIterArgs",
139- "getInductionVars", "getMixedLowerBound ", "getMixedStep ",
140- "getMixedUpperBound ", "getYieldedValuesMutable",
139+ "getInductionVars", "getLowerBounds ", "getSteps ",
140+ "getUpperBounds ", "getYieldedValuesMutable",
141141 "promoteIfSingleIteration", "replaceWithAdditionalYields",
142142 "yieldTiledValuesAndReplace"]>,
143143 AllTypesMatch<["lowerBound", "upperBound", "step"]>,
@@ -302,7 +302,7 @@ def ForallOp : SCF_Op<"forall", [
302302 AutomaticAllocationScope,
303303 DeclareOpInterfaceMethods<LoopLikeOpInterface,
304304 ["getInitsMutable", "getRegionIterArgs", "getInductionVars",
305- "getMixedLowerBound ", "getMixedUpperBound ", "getMixedStep ",
305+ "getLowerBounds ", "getUpperBounds ", "getSteps ",
306306 "promoteIfSingleIteration", "yieldTiledValuesAndReplace"]>,
307307 RecursiveMemoryEffects,
308308 SingleBlockImplicitTerminator<"scf::InParallelOp">,
@@ -510,6 +510,27 @@ def ForallOp : SCF_Op<"forall", [
510510 ];
511511
512512 let extraClassDeclaration = [{
513+ // Get lower bounds as OpFoldResult.
514+ SmallVector<OpFoldResult> getMixedLowerBound() {
515+ auto maybeLowerBounds = getLowerBounds();
516+ assert(maybeLowerBounds.has_value() && "expected values");
517+ return *maybeLowerBounds;
518+ }
519+
520+ // Get upper bounds as OpFoldResult.
521+ SmallVector<OpFoldResult> getMixedUpperBound() {
522+ auto maybeUpperBounds = getUpperBounds();
523+ assert(maybeUpperBounds.has_value() && "expected values");
524+ return *maybeUpperBounds;
525+ }
526+
527+ // Get steps as OpFoldResult.
528+ SmallVector<OpFoldResult> getMixedStep() {
529+ auto maybeSteps = getSteps();
530+ assert(maybeSteps.has_value() && "expected values");
531+ return *maybeSteps;
532+ }
533+
513534 /// Get lower bounds as values.
514535 SmallVector<Value> getLowerBound(OpBuilder &b) {
515536 return getValueOrCreateConstantIndexOp(b, getLoc(), getMixedLowerBound());
@@ -744,7 +765,7 @@ def ParallelOp : SCF_Op<"parallel",
744765 [AutomaticAllocationScope,
745766 AttrSizedOperandSegments,
746767 DeclareOpInterfaceMethods<LoopLikeOpInterface, ["getInductionVars",
747- "getMixedLowerBound ", "getMixedUpperBound ", "getMixedStep "]>,
768+ "getLowerBounds ", "getUpperBounds ", "getSteps "]>,
748769 RecursiveMemoryEffects,
749770 DeclareOpInterfaceMethods<RegionBranchOpInterface>,
750771 SingleBlockImplicitTerminator<"scf::ReduceOp">,
0 commit comments