dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] libjit ChangeLog jit/jit-function.c jit/jit-reg...


From: Aleksey Demakov
Subject: [dotgnu-pnet-commits] libjit ChangeLog jit/jit-function.c jit/jit-reg...
Date: Thu, 08 May 2008 06:39:51 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    libjit
Changes by:     Aleksey Demakov <avd>   08/05/08 06:39:51

Modified files:
        .              : ChangeLog 
        jit            : jit-function.c jit-reg-alloc.c 
                         jit-rules-x86-64.ins jit-rules-x86.ins 

Log message:
        let register allocator free unused values that result from 
JIT_OP_INCOMING_REG and JIT_OP_RETURN_REG instructions

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libjit/ChangeLog?cvsroot=dotgnu-pnet&r1=1.369&r2=1.370
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-function.c?cvsroot=dotgnu-pnet&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-reg-alloc.c?cvsroot=dotgnu-pnet&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-rules-x86-64.ins?cvsroot=dotgnu-pnet&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-rules-x86.ins?cvsroot=dotgnu-pnet&r1=1.36&r2=1.37

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/ChangeLog,v
retrieving revision 1.369
retrieving revision 1.370
diff -u -b -r1.369 -r1.370
--- ChangeLog   4 May 2008 16:53:08 -0000       1.369
+++ ChangeLog   8 May 2008 06:39:50 -0000       1.370
@@ -1,3 +1,16 @@
+2008-05-08  Aleksey Demakov  <address@hidden>
+
+       * jit/jit-rules-x86.ins: 
+       * jit/jit-rules-x86-64.ins: 
+       * jit/jit-function.c (compile_block): let register allocator see
+       JIT_OP_INCOMING_REG and JIT_OP_RETURN_REG instructions so it can
+       free unused values on these instructions rather than on the block
+       end.
+
+       * jit/jit-reg-alloc.c (_jit_regs_set_incoming): it is not possible
+       to correctly spill the old register value at this point so do not
+       attempt this and do not promise this.
+
 2008-05-04  Klaus Treichel  <address@hidden>
 
        * jit/jit-reg-alloc.c (_jit_regs_set_outgoing): Set the outgoing

Index: jit/jit-function.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-function.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- jit/jit-function.c  24 Mar 2008 11:43:59 -0000      1.37
+++ jit/jit-function.c  8 May 2008 06:39:51 -0000       1.38
@@ -532,6 +532,7 @@
                                _jit_regs_set_incoming
                                        (gen, 
(int)jit_value_get_nint_constant(insn->value2),
                                         insn->value1);
+                               _jit_gen_insn(gen, func, block, insn);
                        }
                        break;
 #endif

Index: jit/jit-reg-alloc.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-reg-alloc.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- jit/jit-reg-alloc.c 4 May 2008 15:06:33 -0000       1.57
+++ jit/jit-reg-alloc.c 8 May 2008 06:39:51 -0000       1.58
@@ -2915,8 +2915,8 @@
 /*@
  * @deftypefun void _jit_regs_set_incoming (jit_gencode_t gen, int reg, 
jit_value_t value)
  * Set pseudo register @code{reg} to record that it currently holds the
- * contents of @code{value}.  If the register was previously in use,
- * then spill its value first.
+ * contents of @code{value}.  The register must not contain any other
+ * live value at this point.
  * @end deftypefun
 @*/
 void
@@ -2934,12 +2934,18 @@
                other_reg = -1;
        }
 
+       /* avd: It's too late to spill here, if there was any
+          value it is already cloberred by the incoming value.
+          So for correct code generation the register must be
+          free by now (spilled at some earlier point). */
+#if 0
        /* Eject any values that are currently in the register */
        spill_register(gen, reg);
        if(other_reg >= 0)
        {
                spill_register(gen, other_reg);
        }
+#endif
 
        /* Record that the value is in "reg", but not in the frame */
 #ifdef JIT_REG_STACK
@@ -3018,6 +3024,7 @@
 
                _jit_gen_load_value(gen, reg, other_reg, value);
        }
+
        jit_reg_set_used(gen->inhibit, reg);
        if(other_reg >= 0)
        {

Index: jit/jit-rules-x86-64.ins
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-rules-x86-64.ins,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- jit/jit-rules-x86-64.ins    13 Apr 2008 17:55:36 -0000      1.4
+++ jit/jit-rules-x86-64.ins    8 May 2008 06:39:51 -0000       1.5
@@ -263,6 +263,17 @@
  * Stack pushes and pops.
  */
 
+JIT_OP_INCOMING_REG, JIT_OP_RETURN_REG: note
+        [reg] -> {
+               /*
+                * This rule does nothing itself. Also at this point
+                * the value is supposed to be already in the register
+                * so the "reg" pattern does not load it either. But
+                * it allows the allocator to check the liveness flags
+                * and free the register if the value is dead.
+                */
+       }
+
 JIT_OP_PUSH_INT: note
        [imm] -> {
                x86_64_push_imm(inst, $1);
@@ -428,11 +439,6 @@
                inst = jump_to_epilog(gen, inst, block);
        }
 
-JIT_OP_RETURN_REG: manual
-        [] -> {
-               /* Nothing to do here */;
-       }
-
 JIT_OP_RETURN_INT: note
        [reg("rax")] -> {
                inst = jump_to_epilog(gen, inst, block);

Index: jit/jit-rules-x86.ins
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-rules-x86.ins,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- jit/jit-rules-x86.ins       20 Apr 2008 08:10:46 -0000      1.36
+++ jit/jit-rules-x86.ins       8 May 2008 06:39:51 -0000       1.37
@@ -1990,9 +1990,15 @@
  * Stack pushes and pops.
  */
 
-JIT_OP_RETURN_REG: manual
-        [] -> {
-               /* Nothing to do here */;
+JIT_OP_INCOMING_REG, JIT_OP_RETURN_REG: note
+        [reg] -> {
+               /*
+                * This rule does nothing itself. Also at this point
+                * the value is supposed to be already in the register
+                * so the "reg" pattern does not load it either. But
+                * it allows the allocator to check the liveness flags
+                * and free the register if the value is dead.
+                */
        }
 
 JIT_OP_PUSH_INT: note




reply via email to

[Prev in Thread] Current Thread [Next in Thread]