]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Try to further clear up confusion re notation for live range in
authorJulian Seward <jseward@acm.org>
Mon, 25 Oct 2004 00:43:36 +0000 (00:43 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 25 Oct 2004 00:43:36 +0000 (00:43 +0000)
reg-alloc.  I think it is much improved.  This commit also undoes
the bogus fix rev 119.

git-svn-id: svn://svn.valgrind.org/vex/trunk@413

VEX/priv/host-generic/reg_alloc.c

index 5b6c6f478dea35221cf4e7a1dfa1ea00326a6d20..da20a106f8ccc9f568ce7ca8b9c61116b1b5f279 100644 (file)
@@ -628,8 +628,8 @@ HInstrArray* doRegisterAllocation (
          entry in the rreg_info array. */
       for (j = 0; j < n_available_real_regs; j++) {
          vassert(state[j].disp == Free 
-                || state[j].disp == Unavail
-                || state[j].disp == Bound);
+                 || state[j].disp == Unavail
+                 || state[j].disp == Bound);
          if (state[j].disp != Unavail)
             continue;
          for (k = 0; k < rreg_info_used; k++) 
@@ -680,7 +680,7 @@ HInstrArray* doRegisterAllocation (
          m = hregNumber(vregD);
          vassert(k >= 0 && k < n_vregs);
          vassert(m >= 0 && m < n_vregs);
-         if (vreg_info[k].dead_before != ii) goto cannot_coalesce;
+         if (vreg_info[k].dead_before != ii + 1) goto cannot_coalesce;
          if (vreg_info[m].live_after != ii) goto cannot_coalesce;
 #        if DEBUG_REGALLOC
          vex_printf("COALESCE ");
@@ -755,7 +755,7 @@ HInstrArray* doRegisterAllocation (
                   still live. */
                m = hregNumber(state[k].vreg);
                vassert(m >= 0 && m < n_vregs);
-               if (vreg_info[m].dead_before >= ii) {
+               if (vreg_info[m].dead_before > ii) {
                   vassert(vreg_info[m].reg_class != HRcINVALID);
                   EMIT_INSTR( (*genSpill)( state[k].rreg,
                                            vreg_info[m].spill_offset ) );
@@ -974,7 +974,7 @@ HInstrArray* doRegisterAllocation (
          after this instruction, and if so mark them as free. */
      post_insn_actions:
       for (j = 0; j < rreg_info_used; j++) {
-         if (rreg_info[j].dead_before == ii+0) {
+         if (rreg_info[j].dead_before == ii) {
             /* rreg_info[j].rreg is exiting a hard live range.  Mark
                it as such in the main state array. */
             for (k = 0; k < n_state; k++)