From dbf016e25970c2421e1ebbdb7546600503588bde Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 1 Jul 2020 15:00:59 +1000 Subject: [PATCH] nir: fix implicit fallthrough warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/compiler/nir/nir.c | 4 ++-- src/compiler/nir/nir_gather_info.c | 2 +- src/compiler/nir/nir_lower_phis_to_scalar.c | 1 + src/compiler/nir/nir_opt_gcm.c | 13 ++++++++----- src/compiler/nir/nir_to_lcssa.c | 2 +- 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; } -- 2.30.2