nir/lower_alu_to_scalar: Return after lower_reduction
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 23 Sep 2015 00:16:59 +0000 (17:16 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 23 Sep 2015 03:37:35 +0000 (20:37 -0700)
We don't use any of the code after the switch anyway.  Since we check for
num_components == 1 and early-return, it doesn't get executed so
everything's ok.  However, it makes it much clearer what's going on if we
simply do an early return.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/nir/nir_lower_alu_to_scalar.c

index 5ef5ec2b316ae16136cf7cd7171779711d3cf57b..84d4943befcff2efadb2839176e54259ec8bb620 100644 (file)
@@ -86,7 +86,7 @@ lower_alu_instr_scalar(nir_alu_instr *instr, nir_builder *b)
    case name##3: \
    case name##4: \
       lower_reduction(instr, chan, merge, b); \
-      break;
+      return;
 
    switch (instr->op) {
    case nir_op_vec4: