*** empty log message ***
authorchristian <none@none>
Thu, 17 Feb 2005 19:47:23 +0000 (19:47 +0000)
committerchristian <none@none>
Thu, 17 Feb 2005 19:47:23 +0000 (19:47 +0000)
configure.in
src/vm/jit/reg.h
src/vm/jit/reg.inc
src/vm/statistics.c
src/vm/statistics.h

index 25a1153a3d4fd055c5ccdf41c54547c01f8a102d..682679e8479ba7f5dee9cf59fdc29c01b655eabf 100644 (file)
@@ -333,6 +333,7 @@ AC_CONFIG_FILES([Makefile]
                [src/toolbox/Makefile]
                [src/vm/Makefile]
                [src/vm/jit/Makefile]
+               [src/vm/jit/schedule/Makefile]
                [src/vm/jit/alpha/Makefile]
                [src/vm/jit/i386/Makefile]
                [src/vm/jit/inline/Makefile]
index 25c4f922e6c08800bef2dfab23a85c5f7a8f5cb3..15d62e8e0b2b8d108b12434bd2ccf7701a015cba 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: reg.h 1735 2004-12-07 14:33:27Z twisti $
+   $Id: reg.h 1954 2005-02-17 19:47:23Z christian $
 
 */
 
@@ -135,6 +135,9 @@ void reg_setup(methodinfo *m, registerdata *rd, t_inlining_globals *id);
 void reg_free(methodinfo *m, registerdata *rd);
 void reg_close();
 void regalloc(methodinfo *m, codegendata *cd, registerdata *rd);
+#ifdef STATISTICS
+void reg_make_statistics( methodinfo *, codegendata *, registerdata *);
+#endif
 
 #endif /* _REG_H */
 
index bfaa8d5e4bc0322d3eead9050c202c2fcd009c0b..1e9f371b9d89f2e1482a71fe594253357722cb19 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Stefan Ring
             Christian Thalinger
 
-   $Id: reg.inc 1753 2004-12-13 08:40:16Z twisti $
+   $Id: reg.inc 1954 2005-02-17 19:47:23Z christian $
 
 */
 
@@ -1248,6 +1248,156 @@ static void allocate_scratch_registers(methodinfo *m, registerdata *rd)
 }
 
 
+#ifdef STATISTICS
+void reg_make_statistics( methodinfo *m, codegendata *cd, registerdata *rd) {
+       int i,type;
+       s4 len;
+       stackptr    src, src_old;
+       stackptr    dst;
+       instruction *iptr;
+       basicblock  *bptr;
+       int size_interface; /* == maximum size of in/out stack at basic block boundaries */
+       bool in_register;
+
+       in_register = true;
+
+       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++;
+                               }
+               /* count how many stack slots are held in memory or register */
+
+               bptr = m->basicblocks;
+               while (bptr != NULL) {
+                       if (bptr->flags >= BBREACHED) {
+
+#ifdef LSRA
+                       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) {
+                                       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->regoff != rd->interfaces[len][dst->type].regoff) ))
+                                               {
+                                                       /* one in memory or both inmemory at different offsets */
+                                                       count_mem_move_bb++;
+                                                       in_register=false;
+                                               }
+                                       }
+
+                                       dst = dst->prev;
+                               }
+
+                               /* check for memory moves from BB outstack to interface */
+                               dst = bptr->outstack;
+                               len = bptr->outdepth;
+                               if (len > size_interface) size_interface = len;
+
+                               while (dst) {
+                                       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->regoff != rd->interfaces[len][dst->type].regoff) ))
+                                               {
+                                                       /* one in memory or both inmemory at different offsets */
+                                                       count_mem_move_bb++;
+                                                       in_register=false;
+                                               }
+                                       }
+
+                                       dst = dst->prev;
+                               }
+#ifdef LSRA
+                       }
+#endif 
+
+
+                               dst = bptr->instack;
+                               iptr = bptr->iinstr;
+                               len = bptr->icount;
+                               src_old = NULL;
+
+                               while (--len >= 0)  {
+                                       src = dst;
+                                       dst = iptr->dst;
+
+                                       if ((src!= NULL) && (src != src_old)) { /* new stackslot */
+                                               switch (src->varkind) {
+                                               case TEMPVAR:
+                                               case STACKVAR:
+                                                       if (!(src->flags & INMEMORY)) 
+                                                               count_ss_register++;
+                                                       else {
+                                                               count_ss_spilled++;
+                                                               in_register=false;
+                                                       }                               
+                                                       break;
+                                                       /*                                      case LOCALVAR: */
+                                                       /*                                              if (!(rd->locals[src->varnum][src->type].flags & INMEMORY)) */
+                                                       /*                                                      count_ss_register++; */
+                                                       /*                                              else */
+                                                       /*                                                      count_ss_spilled++; */
+                                                       /*                                              break; */
+                                               case ARGVAR:
+                                                       if (!(src->flags & INMEMORY)) 
+                                                               count_argument_mem_ss++;
+                                                       else
+                                                               count_argument_reg_ss++;
+                                                       break;
+
+
+                                                       /*                                              if (IS_FLT_DBL_TYPE(src->type)) { */
+                                                       /*                                                      if (src->varnum < FLT_ARG_CNT) { */
+                                                       /*                                                              count_ss_register++; */
+                                                       /*                                                              break; */
+                                                       /*                                                      } */
+                                                       /*                                              } else { */
+                                                       /* #if defined(__POWERPC__) */
+                                                       /*                                                      if (src->varnum < INT_ARG_CNT - (IS_2_WORD_TYPE(src->type) != 0)) { */
+                                                       /* #else */
+                                                       /*                                                      if (src->varnum < INT_ARG_CNT) { */
+                                                       /* #endif */
+                                                       /*                                                              count_ss_register++; */
+                                                       /*                                                              break; */
+                                                       /*                                                      } */
+                                                       /*                                              } */
+                                                       /*                                              count_ss_spilled++; */
+                                                       /*                                              break; */
+                                               }
+                                       }
+                                       src_old = src;
+                                       
+                                       iptr++;
+                               } /* while instructions */
+                       } /* 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++;
+}
+#endif
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where
index 5e84bfa03fef769752149983814204971096194c..2838ef9392a8a66656866dbe2854313abf525547 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: statistics.c 1953 2005-02-17 13:42:23Z christian $
+   $Id: statistics.c 1954 2005-02-17 19:47:23Z christian $
 
 */
 
@@ -81,6 +81,10 @@ int count_ss_spilled = 0;
 int count_ss_register = 0;
 int count_methods_allocated_by_lsra = 0;
 int count_mem_move_bb = 0;
+int count_interface_size = 0;
+int count_argument_mem_ss = 0;
+int count_argument_reg_ss = 0;
+int count_method_in_register = 0;
 
 int count_jit_calls = 0;
 int count_methods = 0;
@@ -475,7 +479,15 @@ void print_stats()
        log_text(logtext);
        sprintf(logtext, "Stackslots held in Registers:      %6d",count_ss_register );
        log_text(logtext);
-       sprintf(logtext, "Memory moves at BB Boundaries:     %6d\n\n",count_mem_move_bb );
+       sprintf(logtext, "Memory moves at BB Boundaries:     %6d",count_mem_move_bb );
+       log_text(logtext);
+       sprintf(logtext, "Number of interface slots:         %6d\n\n",count_interface_size );
+       log_text(logtext);
+       sprintf(logtext, "Number of Argument stack slots in register:  %6d",count_argument_reg_ss );
+       log_text(logtext);
+       sprintf(logtext, "Number of Argument stack slots in memory:    %6d\n\n",count_argument_mem_ss );
+       log_text(logtext);
+       sprintf(logtext, "Number of Methods kept in registers:         %6d\n\n",count_method_in_register );
        log_text(logtext);
 }
 
index a7882e684f6232667d48d6718f3495fdc26860e7..03b975edbc6b0d7df7a841aaf4e161c58611d534 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: statistics.h 1953 2005-02-17 13:42:23Z christian $
+   $Id: statistics.h 1954 2005-02-17 19:47:23Z christian $
 
 */
 
@@ -68,6 +68,10 @@ extern int count_ss_spilled;
 extern int count_ss_register;
 extern int count_methods_allocated_by_lsra;
 extern int count_mem_move_bb;
+extern int count_interface_size;
+extern int count_argument_mem_ss;
+extern int count_argument_reg_ss;
+extern int count_method_in_register;
 
 extern int count_jit_calls;
 extern int count_methods;