@@ -403,32 +403,18 @@ isl::schedule makeScheduleTreeHelper(
403
403
404
404
schedule = body.insert_partial_schedule (mupa);
405
405
} else if (auto op = s.as <Halide::Internal::Block>()) {
406
- // Flatten a nested block. Halide Block statements always nest
407
- // rightwards. Flattening it is not strictly necessary, but it
408
- // keeps things uniform with the PET lowering path.
409
406
std::vector<Stmt> stmts;
410
407
stmts.push_back (op->first );
411
408
stmts.push_back (op->rest );
412
- while (const Halide::Internal::Block* b =
413
- stmts.back ().as <Halide::Internal::Block>()) {
414
- Stmt f = b->first ;
415
- Stmt r = b->rest ;
416
- stmts.pop_back ();
417
- stmts.push_back (f);
418
- stmts.push_back (r);
419
- }
420
409
421
- // Build a schedule tree for each member of the block and
422
- // collect them in a sequence.
410
+ // Build a schedule tree for both members of the block and
411
+ // combine them in a sequence.
412
+ std::vector<isl::schedule> schedules;
423
413
for (Stmt s : stmts) {
424
- auto mem = makeScheduleTreeHelper (
425
- s, set, outer, reads, writes, accesses, statements, iterators);
426
- if (schedule) {
427
- schedule = schedule.sequence (mem);
428
- } else {
429
- schedule = mem;
430
- }
414
+ schedules.push_back (makeScheduleTreeHelper (
415
+ s, set, outer, reads, writes, accesses, statements, iterators));
431
416
}
417
+ schedule = schedules[0 ].sequence (schedules[1 ]);
432
418
433
419
} else if (auto op = s.as <Provide>()) {
434
420
// Make an ID for this leaf statement. This *is* semantically
0 commit comments