Michael Starzinger
Edwin Steiner
- $Id: simplereg.c 5633 2006-10-02 13:59:13Z edwin $
+ $Id: simplereg.c 5647 2006-10-03 18:09:26Z edwin $
*/
basicblock *bptr;
int size_interface; /* == maximum size of in/out stack at basic block boundaries */
bool in_register;
+ varinfo *var;
/* get required compiler data */
size_interface = 0;
/* count how many local variables are held in memory or register */
- for(i=0; i < cd->maxlocals; i++)
- for (type=0; type <=4; type++)
- if (rd->locals[i][type].type != -1) { /* valid local */
- if (rd->locals[i][type].flags & INMEMORY) {
- count_locals_spilled++;
- in_register=false;
- }
- else
- count_locals_register++;
- }
+ for(i=0; i < jd->localcount; i++) {
+ if (VAR(i)->flags & INMEMORY) {
+ count_locals_spilled++;
+ in_register=false;
+ }
+ else {
+ count_locals_register++;
+ }
+ }
/* count how many stack slots are held in memory or register */
if (!opt_lsra) {
#endif
/* check for memory moves from interface to BB instack */
- dst = bptr->instack;
len = bptr->indepth;
if (len > size_interface) size_interface = len;
- while (dst != NULL) {
+ while (len) {
len--;
- if (dst->varkind != STACKVAR) {
- if ( (dst->flags & INMEMORY) ||
- (rd->interfaces[len][dst->type].flags & INMEMORY) ||
- ( (dst->flags & INMEMORY) &&
- (rd->interfaces[len][dst->type].flags & INMEMORY) &&
- (dst->vv.regoff != rd->interfaces[len][dst->type].regoff) ))
- {
- /* one in memory or both inmemory at different offsets */
- count_mem_move_bb++;
- in_register=false;
- }
- }
+ var = VAR(bptr->invars[len]);
- dst = dst->prev;
+ /* invars statistics (currently none) */
}
/* check for memory moves from BB outstack to interface */
- dst = bptr->outstack;
len = bptr->outdepth;
if (len > size_interface) size_interface = len;
- while (dst) {
+ while (len) {
len--;
- if (dst->varkind != STACKVAR) {
- if ( (dst->flags & INMEMORY) || \
- (rd->interfaces[len][dst->type].flags & INMEMORY) || \
- ( (dst->flags & INMEMORY) && \
- (rd->interfaces[len][dst->type].flags & INMEMORY) && \
- (dst->vv.regoff != rd->interfaces[len][dst->type].regoff) ))
- {
- /* one in memory or both inmemory at different offsets */
- count_mem_move_bb++;
- in_register=false;
- }
- }
+ var = VAR(bptr->invars[len]);
- dst = dst->prev;
+ /* outvars statistics (currently none) */
}
#if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
}
#endif
+#if 0
dst = bptr->instack;
iptr = bptr->iinstr;
len = bptr->icount;
iptr++;
} /* while instructions */
+#endif
} /* if */
bptr = bptr->next;
} /* while blocks */
+
count_interface_size += size_interface; /* accummulate the size of the interface (between bb boundaries) */
if (in_register) count_method_in_register++;
if (in_register) {