@@ -286,55 +286,6 @@ void KrnlBuilder::simdReduce2DIE(IndexExpr lb, IndexExpr ub, int64_t VL,
286
286
reductionBodyFn, postReductionBodyFn);
287
287
}
288
288
289
- void KrnlBuilder::forExplicitlyParallelLoopIE (IndexExpr lb, IndexExpr ub,
290
- int64_t stepModifier, IndexExpr numThreads, StringAttr procBind,
291
- KrnlLoopBodyFn builderFn) const {
292
- IndexExpr zero = LitIE (0 );
293
- if (numThreads.isLiteralAndIdenticalTo (1 )) {
294
- // Noop. Invoke function with (0, lb, ub).
295
- SmallVector<Value, 4 > params = {
296
- zero.getValue (), lb.getValue (), ub.getValue ()};
297
- MultiDialectBuilder<KrnlBuilder> create (*this );
298
- builderFn (create.krnl , params);
299
- return ;
300
- }
301
- if (numThreads.isLiteralAndIdenticalTo (-1 )) {
302
- // Dynamic, get value from OMP.
303
- llvm_unreachable (" not implemented yet" ); // hi alex.
304
- }
305
- IndexExpr trip = ub - lb;
306
- if (stepModifier > 1 )
307
- trip = trip.ceilDiv (stepModifier);
308
- IndexExpr block = trip.ceilDiv (numThreads);
309
- if (stepModifier > 1 )
310
- block = block * stepModifier;
311
- // Create parallel loop with numThreads.
312
- ValueRange originalLoopDef = defineLoops (1 );
313
- llvm::SmallVector<Value, 1 > optLoopDef (1 , originalLoopDef[0 ]);
314
- parallel (optLoopDef[0 ], numThreads.getValue (), procBind);
315
- iterateIE (originalLoopDef, optLoopDef, {lb}, {ub},
316
- [&](const KrnlBuilder &kb, ValueRange loopInd) {
317
- // Compute current LB/UB for this thread.
318
- IndexExprScope currScope (kb);
319
- IndexExpr tid = DimIE (loopInd[0 ]);
320
- IndexExpr currLB = tid * SymIE (block);
321
- IndexExpr currUB = currLB + SymIE (block);
322
- currUB = IndexExpr::max (currUB, SymIE (ub));
323
- SmallVector<Value, 4 > params = {
324
- tid.getValue (), currLB.getValue (), currUB.getValue ()};
325
- // Invoke function with (tid, currLB, currUB).
326
- builderFn (kb, params);
327
- });
328
- }
329
-
330
- void KrnlBuilder::forExplicitlyParallelLoopIE (IndexExpr lb, IndexExpr ub,
331
- int64_t stepModifier, IndexExpr numThreads,
332
- KrnlLoopBodyFn builderFn) const {
333
- StringAttr procBind; // Empty == default, unspecified.
334
- forExplicitlyParallelLoopIE (
335
- lb, ub, stepModifier, numThreads, procBind, builderFn);
336
- }
337
-
338
289
void KrnlBuilder::yield (ValueRange iterArgs) const {
339
290
b ().create <KrnlYieldOp>(loc (), iterArgs);
340
291
}
0 commit comments