diff options
author | Ian Romanick <[email protected]> | 2019-06-07 08:35:51 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2019-07-08 11:30:11 -0700 |
commit | 5450fd7a36469216ee0e075ed62f3d861e1bd2fa (patch) | |
tree | 8644679fcbd55297cd0c550e66970600aecbae94 /src | |
parent | 12217de08cb1fd3dcedcaacb8757ee2f26fc3002 (diff) |
nir: Allow nir_ssa_alu_instr_src_components to operate on non-SSA destinations
Existing users only operate on instructions with SSA destinations. Some
later patches add new direct calls and indirect calls (via existing NIR
functions) on instructions after going out of SSA. At the very least,
these calls are added by:
intel/vec4: Try to emit a VF source in try_immediate_source
intel/vec4: Try to emit a single load for multiple 3-src instruction operands
The first commit adds direct calls, and the second adds calls via
nir_alu_srcs_equal and nir_alu_srcs_negative_equal.
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/nir/nir.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 88300d739ff..4db3fb5e2b1 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1014,19 +1014,16 @@ nir_alu_instr_src_read_mask(const nir_alu_instr *instr, unsigned src) return read_mask; } -/* - * For instructions whose destinations are SSA, get the number of channels - * used for a source +/** + * Get the number of channels used for a source */ static inline unsigned nir_ssa_alu_instr_src_components(const nir_alu_instr *instr, unsigned src) { - assert(instr->dest.dest.is_ssa); - if (nir_op_infos[instr->op].input_sizes[src] > 0) return nir_op_infos[instr->op].input_sizes[src]; - return instr->dest.dest.ssa.num_components; + return nir_dest_num_components(instr->dest.dest); } bool nir_const_value_negative_equal(nir_const_value c1, nir_const_value c2, |