mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-24 03:22:42 +00:00
Don't store off CALL results if they're never read
This commit is contained in:
parent
cff74493a7
commit
3ef30e850d
1 changed files with 3 additions and 5 deletions
8
ir.c
8
ir.c
|
@ -2564,10 +2564,6 @@ static bool ir_block_life_propagate(ir_block *self, ir_block *prev, bool *change
|
||||||
* (A) doesn't.
|
* (A) doesn't.
|
||||||
*/
|
*/
|
||||||
tempbool = ir_value_life_merge(value, instr->eid);
|
tempbool = ir_value_life_merge(value, instr->eid);
|
||||||
/*
|
|
||||||
if (tempbool)
|
|
||||||
con_err( "value added id %s %i\n", value->name, (int)instr->eid);
|
|
||||||
*/
|
|
||||||
*changed = *changed || tempbool;
|
*changed = *changed || tempbool;
|
||||||
/* Then remove */
|
/* Then remove */
|
||||||
vec_remove(self->living, idx, 1);
|
vec_remove(self->living, idx, 1);
|
||||||
|
@ -2928,7 +2924,9 @@ tailcall:
|
||||||
code_push_statement(&stmt, instr->context.line);
|
code_push_statement(&stmt, instr->context.line);
|
||||||
|
|
||||||
retvalue = instr->_ops[0];
|
retvalue = instr->_ops[0];
|
||||||
if (retvalue && retvalue->store != store_return && (vec_size(retvalue->life) || retvalue->store == store_global))
|
if (retvalue && retvalue->store != store_return &&
|
||||||
|
(retvalue->store == store_global || (vec_size(retvalue->life) && vec_size(retvalue->reads)))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
/* not to be kept in OFS_RETURN */
|
/* not to be kept in OFS_RETURN */
|
||||||
if (retvalue->vtype == TYPE_FIELD && OPTS_FLAG(ADJUST_VECTOR_FIELDS))
|
if (retvalue->vtype == TYPE_FIELD && OPTS_FLAG(ADJUST_VECTOR_FIELDS))
|
||||||
|
|
Loading…
Reference in a new issue