nir/constant_folding: Fix source bit size logic

Instead of looking at input_sizes[i] which contains the number of
components for each source, we look at the bit size of input_types[i].
This fixes a regression in the 1-bit boolean series though I have no
idea how we haven't seen it before now.

Fixes: 35baee5dce "nir/constant_folding: fix incorrect bit-size check"
Fixes: 9076c4e289 "nir: update opcode definitions for different bit sizes"
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Jason Ekstrand 2018-12-06 14:31:20 -06:00 committed by Jason Ekstrand
parent 9f7bd843af
commit 3595a0abf4
1 changed files with 2 additions and 1 deletions

View File

@ -63,7 +63,8 @@ constant_fold_alu_instr(nir_alu_instr *instr, void *mem_ctx)
if (!instr->src[i].src.is_ssa)
return false;
if (bit_size == 0 && nir_op_infos[instr->op].input_sizes[i] == 0)
if (bit_size == 0 &&
!nir_alu_type_get_type_size(nir_op_infos[instr->op].input_types[i]))
bit_size = instr->src[i].src.ssa->bit_size;
nir_instr *src_instr = instr->src[i].src.ssa->parent_instr;