Lines Matching defs:loopIdx
342 using LoopNestBuilder = std::function<LoopBodyBuilder(size_t loopIdx)>;
347 // computeBlockInductionVars[loopIdx] =
348 // lowerBound[loopIdx] + blockCoord[loopIdx] * step[loopIdx]
373 LoopNestBuilder workLoopBuilder = [&](size_t loopIdx) -> LoopBodyBuilder {
374 return [&, loopIdx](OpBuilder &nestedBuilder, Location loc, Value iv,
378 // Compute induction variable for `loopIdx`.
379 computeBlockInductionVars[loopIdx] = b.create<arith::AddIOp>(
380 lowerBounds[loopIdx], b.create<arith::MulIOp>(iv, steps[loopIdx]));
383 isBlockFirstCoord[loopIdx] = b.create<arith::CmpIOp>(
384 arith::CmpIPredicate::eq, iv, blockFirstCoord[loopIdx]);
385 isBlockLastCoord[loopIdx] = b.create<arith::CmpIOp>(
386 arith::CmpIPredicate::eq, iv, blockLastCoord[loopIdx]);
389 if (loopIdx > 0) {
390 isBlockFirstCoord[loopIdx] = b.create<arith::AndIOp>(
391 isBlockFirstCoord[loopIdx], isBlockFirstCoord[loopIdx - 1]);
392 isBlockLastCoord[loopIdx] = b.create<arith::AndIOp>(
393 isBlockLastCoord[loopIdx], isBlockLastCoord[loopIdx - 1]);
397 if (loopIdx < op.getNumLoops() - 1) {
398 if (loopIdx + 1 >= op.getNumLoops() - numBlockAlignedInnerLoops) {
401 b.create<scf::ForOp>(c0, tripCounts[loopIdx + 1], c1, ValueRange(),
402 workLoopBuilder(loopIdx + 1));
407 auto lb = b.create<arith::SelectOp>(isBlockFirstCoord[loopIdx],
408 blockFirstCoord[loopIdx + 1], c0);
410 auto ub = b.create<arith::SelectOp>(isBlockLastCoord[loopIdx],
411 blockEndCoord[loopIdx + 1],
412 tripCounts[loopIdx + 1]);
415 workLoopBuilder(loopIdx + 1));