Manually generates the name of the `loop_var_idx`-th NextIteration node of a loop being constructed with `scope`. This is used to define the backedge before the NextIteration node is created.
| 53 | // loop being constructed with `scope`. This is used to define the backedge |
| 54 | // before the NextIteration node is created. |
| 55 | string NextIterationName(const Scope& scope, int loop_var_idx) { |
| 56 | string result; |
| 57 | const string& prefix = scope.impl()->name(); |
| 58 | if (!prefix.empty()) strings::StrAppend(&result, prefix, "/"); |
| 59 | strings::StrAppend(&result, "NextIteration"); |
| 60 | if (loop_var_idx > 0) strings::StrAppend(&result, "_", loop_var_idx); |
| 61 | return result; |
| 62 | } |
| 63 | |
| 64 | // Creates the `loop_var_idx`-th Merge node of a loop being constructed with |
| 65 | // `scope`. `enter_output` is the `loop_var_idx`-th Enter node's output. |
no test coverage detected