| 11 | |
| 12 | namespace { |
| 13 | void recursive_replace( |
| 14 | ThinHashMap<VarNode*, VarNode*>& old2new, OperatorNodeBase* opr) { |
| 15 | VarNodeArray rewritten_inputs; |
| 16 | for (auto inp : opr->input()) { |
| 17 | if (!old2new.count(inp)) |
| 18 | recursive_replace(old2new, inp->owner_opr()); |
| 19 | rewritten_inputs.push_back(old2new[inp]); |
| 20 | } |
| 21 | auto new_opr = |
| 22 | serialization::copy_opr_shallow(*opr, rewritten_inputs, opr->config()); |
| 23 | for (size_t i = 0; i < opr->output().size(); ++i) { |
| 24 | if (!opr->output(i)->contain_flag(VarNode::Flag::VOLATILE_CONTENT)) { |
| 25 | old2new[opr->output(i)] = new_opr->output(i); |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | InternalGraphPtr expand_executor_opr(const InternalGraphPtr& prev_igraph) { |
| 31 | bool has_jit_executor = false; |
no test coverage detected