won't be used again in the current block.
register allocation on stacked parameters because it confuses
the register spill logic.
+ * jit/jit-reg-alloc.c (_jit_regs_load_value): avoid unnecessary
+ spills if a temporary value won't be used again in the current block.
+
2004-06-09 Rhys Weatherley <rweather@southern-storm.com.au>
* jit/jit-rules-arm.c (flush_constants): update the instruction
}
else
{
+ if(gen->contents[reg].num_values == 1 &&
+ (value->in_frame || value->in_global_register || !used_again))
+ {
+ /* We are the only value in this register, and the
+ value is duplicated in the frame, or will never
+ be used again in this block. In this case,
+ we can disassociate the register from the value
+ and just return the register as-is */
+ value->in_register = 0;
+ gen->contents[reg].num_values = 0;
+ gen->contents[reg].used_for_temp = 1;
+ }
gen->contents[reg].age = gen->current_age;
if(need_pair)
{
jit_insn_return(function, temp4);
/* Compile the function */
+ jit_dump_function(stdout, function, "gcd");
jit_function_compile(function);
+ jit_dump_function(stdout, function, "gcd");
/* Unlock the context */
jit_context_build_end(context);