NCG: Handle loops in register allocator