nir/opt_dead_cf: correction of side effect check
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 29 Apr 2016 18:31:58 +0000 (20:31 +0200)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 30 Apr 2016 19:16:22 +0000 (12:16 -0700)
Parenthesis are needed here as ! takes precedence over the &. The
check had the opposite effect than intended.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_dead_cf.c

index 2e04c179073e3357034d0ec625f5ddc2c5d492f2..7450b1c474213218c80ce97c068ce3b59e6b3db1 100644 (file)
@@ -155,8 +155,8 @@ cf_node_has_side_effects(nir_cf_node *node)
             continue;
 
          nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
-         if (!nir_intrinsic_infos[intrin->intrinsic].flags &
-             NIR_INTRINSIC_CAN_ELIMINATE)
+         if (!(nir_intrinsic_infos[intrin->intrinsic].flags &
+             NIR_INTRINSIC_CAN_ELIMINATE))
             return true;
       }
    }