better info for SLI
This commit is contained in:
parent
7f5c3ac4f6
commit
e8f4e47da5
|
@ -21,9 +21,9 @@
|
|||
STATIC cset addr_modes;
|
||||
STATIC cset cheaps;
|
||||
STATIC cset forbidden;
|
||||
STATIC cset sli_counts;
|
||||
STATIC short LX_threshold;
|
||||
STATIC short AR_limit;
|
||||
STATIC bool DO_sli;
|
||||
|
||||
STATIC get_instrs(f, s_p)
|
||||
FILE *f;
|
||||
|
@ -100,11 +100,10 @@ cs_machinit(f)
|
|||
fscanf(f, "%d", &space);
|
||||
AR_limit = space;
|
||||
|
||||
/* Read whether we must eliminate an SLI instruction
|
||||
/* Read for what counts we must not eliminate an SLI instruction
|
||||
* when it is part of an array-index computation.
|
||||
*/
|
||||
fscanf(f, "%d %d", &time, &space);
|
||||
DO_sli = time_space_ratio >= 50 ? time : space;
|
||||
choose_cset(f, &sli_counts, 8 * ws);
|
||||
|
||||
/* Read a set of instructions which we do not want to eliminate.
|
||||
* Note: only instructions need be given that may in principle
|
||||
|
@ -115,14 +114,19 @@ cs_machinit(f)
|
|||
choose_cset(f, &forbidden, sp_lmnem);
|
||||
}
|
||||
|
||||
STATIC bool is_index(lnp)
|
||||
STATIC bool sli_no_eliminate(lnp)
|
||||
line_p lnp;
|
||||
{
|
||||
/* Return whether the SLI-instruction in lnp is part of
|
||||
* an array-index computation.
|
||||
* an array-index computation, and should not be eliminated.
|
||||
*/
|
||||
offset cst;
|
||||
|
||||
return lnp->l_prev != (line_p) 0 && INSTR(lnp->l_prev) == op_loc &&
|
||||
lnp->l_next != (line_p) 0 && INSTR(lnp->l_next) == op_ads;
|
||||
lnp->l_next != (line_p) 0 && INSTR(lnp->l_next) == op_ads &&
|
||||
(cst = off_set(lnp->l_prev)) == (Celem_t) cst &&
|
||||
Cis_elem((Celem_t) cst, sli_counts)
|
||||
;
|
||||
}
|
||||
|
||||
STATIC bool gains(avp)
|
||||
|
@ -139,7 +143,7 @@ STATIC bool gains(avp)
|
|||
return off_set(avp->av_found) >= LX_threshold;
|
||||
|
||||
if (avp->av_instr == (byte) op_sli)
|
||||
return !is_index(avp->av_found) || DO_sli;
|
||||
return ! sli_no_eliminate(avp->av_found);
|
||||
|
||||
if (Cis_elem(avp->av_instr & BMASK, addr_modes))
|
||||
return instrgroup(avp->av_found->l_prev) != SIMPLE_LOAD;
|
||||
|
|
|
@ -98,7 +98,8 @@ cheap operations: op_cii op_ciu op_cui op_cuu op_cmi op_cmu op_cmp -1
|
|||
op_cii op_ciu op_cui op_cuu op_cmi op_cmu op_cmp -1
|
||||
lexical tresholds: 1 1
|
||||
indirection limit: 8
|
||||
do sli if index?: no no
|
||||
do not eliminate sli if index on shiftcounts: 0 1 2 3 -1
|
||||
0 1 2 3 -1
|
||||
forbidden operators: -1 -1
|
||||
%%SP
|
||||
global stack pollution allowed?: no
|
||||
|
|
|
@ -97,7 +97,8 @@ addressing modes: op_adp op_lof op_ldf op_loi op_dch op_lpb -1
|
|||
cheap operations: -1 -1
|
||||
lexical tresholds: 1 1
|
||||
indirection limit: 8
|
||||
do sli if index?: yes yes
|
||||
do not eliminate sli if index on shiftcounts: -1
|
||||
-1
|
||||
forbidden operators: -1 -1
|
||||
%%SP
|
||||
global stack pollution allowed?: no
|
||||
|
|
|
@ -97,7 +97,8 @@ addressing modes: op_adp op_lof op_ldf op_loi op_dch op_lpb -1
|
|||
cheap operations: -1 -1
|
||||
lexical tresholds: 1 1
|
||||
indirection limit: 8
|
||||
do sli if index?: yes yes
|
||||
do not eliminate sli if index on shiftcounts: -1
|
||||
-1
|
||||
forbidden operators: -1 -1
|
||||
%%SP
|
||||
global stack pollution allowed?: no
|
||||
|
|
|
@ -90,7 +90,8 @@ cheap operations: op_cii op_cui op_cfi op_ciu op_cff op_cuu op_cif -1
|
|||
op_cii op_cui op_cfi op_ciu op_cff op_cuu op_cif -1
|
||||
lexical tresholds: 1 1
|
||||
indirection limit: 8
|
||||
do sli if index?: yes yes
|
||||
do not eliminate sli if index on shiftcounts: -1
|
||||
-1
|
||||
forbidden operators: -1 -1
|
||||
%%SP
|
||||
global stack pollution allowed?: no
|
||||
|
|
|
@ -112,7 +112,8 @@ cheap operations: op_cii op_cui op_cfi op_ciu op_cff op_cuu op_cif
|
|||
op_cmi op_cmu op_cmf op_cms op_cmp -1
|
||||
lexical thresholds: 1 1
|
||||
indirection limit: 8
|
||||
do sli if index?: no no
|
||||
do not eliminate sli if index on shiftcounts: 0 1 2 3 -1
|
||||
0 1 2 3 -1
|
||||
forbidden operators: -1 -1
|
||||
%%SP
|
||||
global stack pollution allowed?: yes
|
||||
|
|
Loading…
Reference in a new issue