diff options
author | Jason Ekstrand <[email protected]> | 2019-04-17 17:10:18 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-04-18 17:12:44 +0000 |
commit | 85c35885b383477ac4f92a11695fc85c6d45c98c (patch) | |
tree | b9cb1e3ce1c4e484908019ec13d55ed9e7bae288 /src/intel/compiler | |
parent | eee994e769259887ea17ec653ee1ea277416ea8b (diff) |
nir: Rework nir_src_as_alu_instr to not take a pointer
Other nir_src_as_* functions just take a nir_src. It's not that much
more memory copying and the constness preserving really isn't worth the
cognitive dissonance.
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r-- | src/intel/compiler/brw_fs_nir.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index f611b261784..ac566be7476 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -387,7 +387,7 @@ fs_visitor::nir_emit_if(nir_if *if_stmt) /* If the condition has the form !other_condition, use other_condition as * the source, but invert the predicate on the if instruction. */ - nir_alu_instr *const cond = nir_src_as_alu_instr(&if_stmt->condition); + nir_alu_instr *cond = nir_src_as_alu_instr(if_stmt->condition); if (cond != NULL && cond->op == nir_op_inot) { assert(!cond->src[0].negate); assert(!cond->src[0].abs); @@ -754,8 +754,7 @@ fs_visitor::resolve_inot_sources(const fs_builder &bld, nir_alu_instr *instr, fs_reg *op) { for (unsigned i = 0; i < 2; i++) { - nir_alu_instr *const inot_instr = - nir_src_as_alu_instr(&instr->src[i].src); + nir_alu_instr *inot_instr = nir_src_as_alu_instr(instr->src[i].src); if (inot_instr != NULL && inot_instr->op == nir_op_inot && !inot_instr->src[0].abs && !inot_instr->src[0].negate) { @@ -778,7 +777,7 @@ fs_visitor::try_emit_b2fi_of_inot(const fs_builder &bld, if (devinfo->gen < 6 || devinfo->gen >= 12) return false; - nir_alu_instr *const inot_instr = nir_src_as_alu_instr(&instr->src[0].src); + nir_alu_instr *inot_instr = nir_src_as_alu_instr(instr->src[0].src); if (inot_instr == NULL || inot_instr->op != nir_op_inot) return false; @@ -1242,8 +1241,7 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr) case nir_op_inot: if (devinfo->gen >= 8) { - nir_alu_instr *const inot_src_instr = - nir_src_as_alu_instr(&instr->src[0].src); + nir_alu_instr *inot_src_instr = nir_src_as_alu_instr(instr->src[0].src); if (inot_src_instr != NULL && (inot_src_instr->op == nir_op_ior || |