tc/core/polyhedral/schedule_isl_conversion.cc
/*
 * Convert the internal "st" node along with its descendants
 * to nodes in an isl schedule tree and insert them at position "node".
 * Domain nodes are not supported because they can only appear
 * in the root node.
 * Expansion nodes are not supported yet because they require
 * some extra functionality in isl.
 */
Convert the internal "st" node along with its descendants
to nodes in an isl schedule tree and insert them at position "node".
Domain nodes are not supported because they can only appear
in the root node.
Expansion nodes are not supported yet because they require
some extra functionality in isl.
Convert the internal " st " node along with its descendants to nodes in an isl schedule tree and insert them at position " node " . Domain nodes are not supported because they can only appear in the root node . Expansion nodes are not supported yet because they require some extra functionality in isl .
isl::schedule_node insert(isl::schedule_node node, const ScheduleTree* st) {
  if (auto band = st->elemAs<ScheduleTreeElemBand>()) {
    node = node.insert_partial_schedule(band->mupa_);
    auto bandNode = node.as<isl::schedule_node_band>();
    bandNode = bandNode.set_permutable(band->permutable_);
    for (int i = 0; i < band->coincident_.size(); ++i) {
      bandNode = bandNode.member_set_coincident(i, band->coincident_[i]);
    }
    for (int i = 0; i < band->unroll_.size(); ++i) {
      if (band->unroll_[i]) {
        bandNode =
            bandNode.member_set_ast_loop_type(i, isl::ast_loop_type::unroll);
      }
    }
    node = bandNode;
  } else if (auto context = st->elemAs<ScheduleTreeElemContext>()) {
    node = node.insert_context(context->context_);
  } else if (auto filter = st->elemAsBase<ScheduleTreeElemFilter>()) {
    node = node.insert_filter(filter->filter_);
  } else if (
      st->elemAs<ScheduleTreeElemSet>() ||
      st->elemAs<ScheduleTreeElemSequence>()) {
    return insertBranch(node, st);
  } else if (st->elemAs<ScheduleTreeElemExtension>()) {
    return insertExtension(node, st);
  } else {
    LOG(FATAL) << "NYI: insert type: " << *st;
  }
  return extendChild(node, st);
}
isl :: schedule_node insert ( isl :: schedule_node node , const ScheduleTree * st ) { if ( auto band = st -> elemAs < ScheduleTreeElemBand > ( ) ) { node = node . insert_partial_schedule ( band -> mupa_ ) ; auto bandNode = node . as < isl :: schedule_node_band > ( ) ; bandNode = bandNode . set_permutable ( band -> permutable_ ) ; for ( int i = 0 ; i < band -> coincident_ . size ( ) ; ++ i ) { bandNode = bandNode . member_set_coincident ( i , band -> coincident_ [ i ] ) ; } for ( int i = 0 ; i < band -> unroll_ . size ( ) ; ++ i ) { if ( band -> unroll_ [ i ] ) { bandNode = bandNode . member_set_ast_loop_type ( i , isl :: ast_loop_type :: unroll ) ; } } node = bandNode ; } else if ( auto context = st -> elemAs < ScheduleTreeElemContext > ( ) ) { node = node . insert_context ( context -> context_ ) ; } else if ( auto filter = st -> elemAsBase < ScheduleTreeElemFilter > ( ) ) { node = node . insert_filter ( filter -> filter_ ) ; } else if ( st -> elemAs < ScheduleTreeElemSet > ( ) || st -> elemAs < ScheduleTreeElemSequence > ( ) ) { return insertBranch ( node , st ) ; } else if ( st -> elemAs < ScheduleTreeElemExtension > ( ) ) { return insertExtension ( node , st ) ; } else { LOG ( FATAL ) << " " << * st ; } return extendChild ( node , st ) ; }
Convert the internal "st" node along with its descendants
 to nodes in an isl schedule tree and insert them at position "node".
Convert the internal " st " node along with its descendants to nodes in an isl schedule tree and insert them at position " node " .