src/lima/pp_lir/peephole.c
//if has_texload_use() returns true, tells if there are any other uses of the
//register
if has_texload_use() returns true, tells if there are any other uses of the
register
if has_texload_use () returns true tells if there are any other uses of the register
static bool has_non_texload_use(lima_pp_lir_scheduled_instr_t* instr,
								lima_pp_lir_reg_t* reg)
{
	if (instr->texld_instr && instr_has_use(instr->texld_instr, reg))
		return true;
	if (instr->uniform_instr && instr_has_use(instr->uniform_instr, reg))
		return true;
	unsigned i;
	for (i = 0; i < 5; i++)
		if (instr->alu_instrs[i] && instr_has_use(instr->alu_instrs[i], reg))
			return true;
	if (instr->temp_store_instr && instr_has_use(instr->temp_store_instr, reg))
		return true;
	if (instr->branch_instr && instr_has_use(instr->branch_instr, reg))
		return true;
	return false;
}
static bool has_non_texload_use ( lima_pp_lir_scheduled_instr_t * instr , lima_pp_lir_reg_t * reg ) { if ( instr -> texld_instr && instr_has_use ( instr -> texld_instr , reg ) ) return true ; if ( instr -> uniform_instr && instr_has_use ( instr -> uniform_instr , reg ) ) return true ; unsigned i ; for ( i = 0 ; i < 5 ; i ++ ) if ( instr -> alu_instrs [ i ] && instr_has_use ( instr -> alu_instrs [ i ] , reg ) ) return true ; if ( instr -> temp_store_instr && instr_has_use ( instr -> temp_store_instr , reg ) ) return true ; if ( instr -> branch_instr && instr_has_use ( instr -> branch_instr , reg ) ) return true ; return false ; }
if has_texload_use() returns true, tells if there are any other uses of the
register
if has_texload_use () returns true tells if there are any other uses of the register