|
From: <sv...@va...> - 2008-05-01 11:48:41
|
Author: sewardj
Date: 2008-05-01 12:48:46 +0100 (Thu, 01 May 2008)
New Revision: 1831
Log:
Refinement to r1830: sanity check spill slot alignments at the time
they are created, rather than at the time they are used. This has two
advantages: (1) it checks the alignment for all slots, rather than
only for slots of vregs which actually get spilled, hence better
sanity check coverage, and (2) it slows the allocator down less,
possibly because branch predictors can correlate the tests within
sanity_check_spill_offset with tests in the loop containing the call.
Modified:
branches/OTRACK_BY_INSTRUMENTATION/priv/host-generic/reg_alloc2.c
Modified: branches/OTRACK_BY_INSTRUMENTATION/priv/host-generic/reg_alloc2.c
===================================================================
--- branches/OTRACK_BY_INSTRUMENTATION/priv/host-generic/reg_alloc2.c 2008-05-01 11:28:21 UTC (rev 1830)
+++ branches/OTRACK_BY_INSTRUMENTATION/priv/host-generic/reg_alloc2.c 2008-05-01 11:48:46 UTC (rev 1831)
@@ -878,6 +878,8 @@
it for two sets of shadow state, and then the spill area. */
vreg_lrs[j].spill_offset = toShort(guest_sizeB * 3 + k * 8);
+ /* Independent check that we've made a sane choice of slot */
+ sanity_check_spill_offset( &vreg_lrs[j] );
/* if (j > max_ss_no) */
/* max_ss_no = j; */
}
@@ -1155,7 +1157,6 @@
if (vreg_lrs[m].dead_before > ii) {
vassert(vreg_lrs[m].reg_class != HRcINVALID);
if ((!eq_spill_opt) || !rreg_state[k].eq_spill_slot) {
- sanity_check_spill_offset( &vreg_lrs[m] );
EMIT_INSTR( (*genSpill)( rreg_state[k].rreg,
vreg_lrs[m].spill_offset,
mode64 ) );
@@ -1331,7 +1332,6 @@
indeed needed. */
if (reg_usage.mode[j] != HRmWrite) {
vassert(vreg_lrs[m].reg_class != HRcINVALID);
- sanity_check_spill_offset( &vreg_lrs[m] );
EMIT_INSTR( (*genReload)( rreg_state[k].rreg,
vreg_lrs[m].spill_offset,
mode64 ) );
@@ -1401,7 +1401,6 @@
vassert(vreg_lrs[m].dead_before > ii);
vassert(vreg_lrs[m].reg_class != HRcINVALID);
if ((!eq_spill_opt) || !rreg_state[spillee].eq_spill_slot) {
- sanity_check_spill_offset( &vreg_lrs[m] );
EMIT_INSTR( (*genSpill)( rreg_state[spillee].rreg,
vreg_lrs[m].spill_offset,
mode64 ) );
@@ -1422,7 +1421,6 @@
written), we have to generate a reload for it. */
if (reg_usage.mode[j] != HRmWrite) {
vassert(vreg_lrs[m].reg_class != HRcINVALID);
- sanity_check_spill_offset( &vreg_lrs[m] );
EMIT_INSTR( (*genReload)( rreg_state[spillee].rreg,
vreg_lrs[m].spill_offset,
mode64 ) );
|