jcf94 commented on a change in pull request #6107: URL: https://github.com/apache/incubator-tvm/pull/6107#discussion_r459821753
########## File path: src/auto_scheduler/transform_step.cc ########## @@ -923,5 +958,272 @@ String ComputeRootStepNode::PrintAsPythonAPI(Array<te::Stage>* stages, return ss.str(); } +/********** Primitives adding new stages **********/ + +/*! + * \brief Common part for steps that add new stages(e.g. CacheReadStep, CacheWriteStep, + * RfactorStep). This will filter out all steps that can change the stages of ComputeDAG. + */ +Array<Step> GetStageModifiableSteps(Step current_step, const Array<Step>& transform_steps) { + Array<Step> ret_steps; + for (const Step& step : transform_steps) { + if (step->IsInstance<CacheWriteStepNode>() || step->IsInstance<CacheReadStepNode>()) { + ret_steps.push_back(step); + } + // TODO(jcf94): add rfactor support + if (step.same_as(current_step)) { Review comment: Updated. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org