@@ -647,20 +647,20 @@ LoopPipelinerInternal::emitEpilogue(RewriterBase &rewriter,
647647 // Emit different versions of the induction variable. They will be
648648 // removed by dead code if not used.
649649
650- auto getConst = [&](int v) {
650+ auto createConst = [&](int v) {
651651 return rewriter.create <arith::ConstantOp>(loc,
652652 rewriter.getIntegerAttr (t, v));
653653 };
654654
655655 // total_iterations = cdiv(range_diff, step);
656656 // - range_diff = ub - lb
657657 // - total_iterations = (range_diff + step + (step < 0 ? 1 : -1)) / step
658- Value zero = getConst (0 );
659- Value one = getConst (1 );
658+ Value zero = createConst (0 );
659+ Value one = createConst (1 );
660660 Value stepLessZero = rewriter.create <arith::CmpIOp>(
661661 loc, arith::CmpIPredicate::slt, step, zero);
662662 Value stepDecr =
663- rewriter.create <arith::SelectOp>(loc, stepLessZero, one, getConst (-1 ));
663+ rewriter.create <arith::SelectOp>(loc, stepLessZero, one, createConst (-1 ));
664664
665665 Value rangeDiff = rewriter.create <arith::SubIOp>(loc, ub, lb);
666666 Value rangeIncrStep = rewriter.create <arith::AddIOp>(loc, rangeDiff, step);
@@ -671,8 +671,8 @@ LoopPipelinerInternal::emitEpilogue(RewriterBase &rewriter,
671671 // If total_iters < max_stage, start the epilogue at zero to match the
672672 // ramp-up in the prologue.
673673 // start_iter = max(0, total_iters - max_stage)
674- Value iterI =
675- rewriter. create <arith::SubIOp>(loc, totalIterations, getConst (maxStage));
674+ Value iterI = rewriter. create <arith::SubIOp>(loc, totalIterations,
675+ createConst (maxStage));
676676 iterI = rewriter.create <arith::MaxSIOp>(loc, zero, iterI);
677677
678678 // Capture predicates for dynamic loops.
@@ -692,7 +692,7 @@ LoopPipelinerInternal::emitEpilogue(RewriterBase &rewriter,
692692 // Disable stages when `i` is greater than total_iters.
693693 // pred = total_iters >= i
694694 predicates[i] = rewriter.create <arith::CmpIOp>(
695- loc, arith::CmpIPredicate::sge, totalIterations, getConst (i));
695+ loc, arith::CmpIPredicate::sge, totalIterations, createConst (i));
696696 }
697697 }
698698
0 commit comments