Concisely describe the proposed feature
It would be good to support continue in loops. E.g.,
@ti.kernel
def test():
for i in x:
if x[i] < 0:
continue # skip the rest of this loop body
x[i] -= 1
Note that there are a few different cases: parallel range/struct for loops, serial range for loops, and while loops. However, the semantics is the same: jump to the end of the loop body so that the next iteration can start after this instruction.
Describe the solution you'd like (if any)
FrontendContinueStmt and ContinueStmtlower_ast, ir_printer etc.In the parallel case, is this the same as just returning from that struct_for/range_for task?
Right, just a jump to the loop body (if you are using SSA + CFG as in LLVM), or simply a return (in the parallel loop_body_function)/continue in serial loops in source-2-source.
Taking this. I haven't been able to work on IR for a while, and need to catch up..
Closed by #716
Most helpful comment
Taking this. I haven't been able to work on IR for a while, and need to catch up..