summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_loop_analyze.c4
-rw-r--r--src/compiler/nir/nir_opt_loop_unroll.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c
index 438e1fac3ea..d564296aa67 100644
--- a/src/compiler/nir/nir_loop_analyze.c
+++ b/src/compiler/nir/nir_loop_analyze.c
@@ -330,8 +330,8 @@ find_loop_terminators(loop_info_state *state)
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;
diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c
index 04caa7c346d..955dfede694 100644
--- a/src/compiler/nir/nir_opt_loop_unroll.c
+++ b/src/compiler/nir/nir_opt_loop_unroll.c
@@ -530,14 +530,14 @@ process_loops(nir_shader *sh, nir_cf_node *cf_node, bool *innermost_loop)
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);
}