aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2020-07-01 15:00:59 +1000
committerMarge Bot <[email protected]>2020-07-02 23:52:52 +0000
commitdbf016e25970c2421e1ebbdb7546600503588bde (patch)
treec747ad105736f2dcbacff89e75584a317c4f5046 /src/compiler/nir
parent31dcc173b1552d1c332490367f71ac26a8615bc1 (diff)
nir: fix implicit fallthrough warnings
Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5705>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir.c4
-rw-r--r--src/compiler/nir/nir_gather_info.c2
-rw-r--r--src/compiler/nir/nir_lower_phis_to_scalar.c1
-rw-r--r--src/compiler/nir/nir_opt_gcm.c13
-rw-r--r--src/compiler/nir/nir_to_lcssa.c2
5 files changed, 13 insertions, 9 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 2567be6efa0..37c1a953e85 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1609,8 +1609,8 @@ nir_block_cf_tree_next(nir_block *block)
return nir_if_first_else_block(if_stmt);
assert(block == nir_if_last_else_block(if_stmt));
- /* fall through */
}
+ /* fallthrough */
case nir_cf_node_loop:
return nir_cf_node_as_block(nir_cf_node_next(parent));
@@ -1645,8 +1645,8 @@ nir_block_cf_tree_prev(nir_block *block)
return nir_if_last_then_block(if_stmt);
assert(block == nir_if_first_then_block(if_stmt));
- /* fall through */
}
+ /* fallthrough */
case nir_cf_node_loop:
return nir_cf_node_as_block(nir_cf_node_prev(parent));
diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c
index 3a65c27b02e..1fc37403721 100644
--- a/src/compiler/nir/nir_gather_info.c
+++ b/src/compiler/nir/nir_gather_info.c
@@ -301,7 +301,7 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader,
case nir_intrinsic_demote:
case nir_intrinsic_demote_if:
shader->info.fs.uses_demote = true;
- /* fallthrough: quads with helper lanes only might be discarded entirely */
+ /* fallthrough - quads with helper lanes only might be discarded entirely */
case nir_intrinsic_discard:
case nir_intrinsic_discard_if:
/* Freedreno uses the discard_if intrinsic to end GS invocations that
diff --git a/src/compiler/nir/nir_lower_phis_to_scalar.c b/src/compiler/nir/nir_lower_phis_to_scalar.c
index 22f8f448557..9389c8f787b 100644
--- a/src/compiler/nir/nir_lower_phis_to_scalar.c
+++ b/src/compiler/nir/nir_lower_phis_to_scalar.c
@@ -109,6 +109,7 @@ is_phi_src_scalarizable(nir_phi_src *src,
break;
}
}
+ /* fallthrough */
default:
/* We can't scalarize this type of instruction */
diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c
index dbadd584055..02aced6b45c 100644
--- a/src/compiler/nir/nir_opt_gcm.c
+++ b/src/compiler/nir/nir_opt_gcm.c
@@ -162,6 +162,8 @@ is_src_scalarizable(nir_src *src)
default:
break;
}
+
+ return false;
}
default:
@@ -199,11 +201,12 @@ gcm_pin_instructions(nir_function_impl *impl, struct gcm_state *state)
instr->pass_flags = GCM_INSTR_SCHEDULE_EARLIER_ONLY;
break;
- case nir_op_mov:
- if (!is_src_scalarizable(&(nir_instr_as_alu(instr)->src[0].src))) {
- instr->pass_flags = GCM_INSTR_PINNED;
- break;
- }
+ case nir_op_mov:
+ if (!is_src_scalarizable(&(nir_instr_as_alu(instr)->src[0].src))) {
+ instr->pass_flags = GCM_INSTR_PINNED;
+ break;
+ }
+ /* fallthrough */
default:
instr->pass_flags = 0;
diff --git a/src/compiler/nir/nir_to_lcssa.c b/src/compiler/nir/nir_to_lcssa.c
index 64e260fe3b2..327de85d36d 100644
--- a/src/compiler/nir/nir_to_lcssa.c
+++ b/src/compiler/nir/nir_to_lcssa.c
@@ -178,8 +178,8 @@ instr_is_invariant(nir_instr *instr, nir_loop *loop)
nir_intrinsic_instr *intrinsic = nir_instr_as_intrinsic(instr);
if (!(nir_intrinsic_infos[intrinsic->intrinsic].flags & NIR_INTRINSIC_CAN_REORDER))
return not_invariant;
- /* fallthrough */
}
+ /* fallthrough */
default:
return nir_foreach_src(instr, src_is_invariant, loop) ? invariant : not_invariant;
}