nir_loop_terminator *terminator =
rzalloc(state->loop->info, nir_loop_terminator);
- list_add(&terminator->loop_terminator_link,
- &state->loop->info->loop_terminator_list);
+ list_addtail(&terminator->loop_terminator_link,
+ &state->loop->info->loop_terminator_list);
terminator->nif = nif;
terminator->break_block = break_blk;
if (num_lt == 2) {
bool limiting_term_second = true;
nir_loop_terminator *terminator =
- list_last_entry(&loop->info->loop_terminator_list,
+ list_first_entry(&loop->info->loop_terminator_list,
nir_loop_terminator, loop_terminator_link);
if (terminator->nif == loop->info->limiting_terminator->nif) {
limiting_term_second = false;
terminator =
- list_first_entry(&loop->info->loop_terminator_list,
+ list_last_entry(&loop->info->loop_terminator_list,
nir_loop_terminator, loop_terminator_link);
}