mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +00:00
Don't copy return values away from OFS_RETURN if they don't get locked.
This commit is contained in:
parent
456e80a7d5
commit
14889897da
1 changed files with 7 additions and 2 deletions
9
ir.c
9
ir.c
|
@ -2195,8 +2195,8 @@ bool ir_function_allocate_locals(ir_function *self)
|
||||||
* If the value is a parameter-temp: 1 write, 1 read from a CALL
|
* If the value is a parameter-temp: 1 write, 1 read from a CALL
|
||||||
* and it's not "locked", write it to the OFS_PARM directly.
|
* and it's not "locked", write it to the OFS_PARM directly.
|
||||||
*/
|
*/
|
||||||
if (OPTS_OPTIMIZATION(OPTIM_CALL_STORES)) {
|
if (OPTS_OPTIMIZATION(OPTIM_CALL_STORES) && !v->locked) {
|
||||||
if (!v->locked && vec_size(v->reads) == 1 && vec_size(v->writes) == 1 &&
|
if (vec_size(v->reads) == 1 && vec_size(v->writes) == 1 &&
|
||||||
(v->reads[0]->opcode == VINSTR_NRCALL ||
|
(v->reads[0]->opcode == VINSTR_NRCALL ||
|
||||||
(v->reads[0]->opcode >= INSTR_CALL0 && v->reads[0]->opcode <= INSTR_CALL8)
|
(v->reads[0]->opcode >= INSTR_CALL0 && v->reads[0]->opcode <= INSTR_CALL8)
|
||||||
)
|
)
|
||||||
|
@ -2224,6 +2224,11 @@ bool ir_function_allocate_locals(ir_function *self)
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (vec_size(v->writes) == 1 && v->writes[0]->opcode == INSTR_CALL0)
|
||||||
|
{
|
||||||
|
v->store = store_return;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (a = 0; a < vec_size(alloc.locals); ++a)
|
for (a = 0; a < vec_size(alloc.locals); ++a)
|
||||||
|
|
Loading…
Reference in a new issue