Okay, I realized we can't do the `instr->index < loop_start` trick (at least, not without rethinking the implementation), because currently `loop_start` holds the start of the outermost loop, so consider:
Right. I guess we'd have to keep a stack of the starting index of all the loops we're currently inside, and extend until the end of the outermost loop that doesn't contain the originating instruction.
I don't think there is a hard need to scramble over that, for the moment.