From 14889897dab9dcb3d97c33a52f16fc57eb1ae5e1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 26 Dec 2012 18:33:16 +0100 Subject: [PATCH] Don't copy return values away from OFS_RETURN if they don't get locked. --- ir.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ir.c b/ir.c index ec87bd7..54cec7e 100644 --- a/ir.c +++ b/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 * and it's not "locked", write it to the OFS_PARM directly. */ - if (OPTS_OPTIMIZATION(OPTIM_CALL_STORES)) { - if (!v->locked && vec_size(v->reads) == 1 && vec_size(v->writes) == 1 && + if (OPTS_OPTIMIZATION(OPTIM_CALL_STORES) && !v->locked) { + if (vec_size(v->reads) == 1 && vec_size(v->writes) == 1 && (v->reads[0]->opcode == VINSTR_NRCALL || (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; } + 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) -- 2.39.2