------- Additional Comments From steven at gcc dot gnu dot org  2004-12-14 
15:28 -------
OK, so we now have three proposed strategies to solve this bug.

1) Decide on doing accurate life analysis based on some function
   of the number of basic blocks and the number of registers.
   This limits both storage and compile time problems, but for
   large functions the accurate liveness information will not be
   available, which is unfortunate because I suspect that is one
   of those places where we need to have it the most.
  
2) Compute PAVIN/PAVOUT in blocks, instead of all registers at
   once.  This has the advantage that memory consumption can be
   controlled, but the disadvantage that you have to perform
   the iterative analysis (N_regs / block_size) times.  But at
   least the results of the analysis will be available without
   regard of the function size.

3) Rethink how we compute accurate liveness information.  Right
   now we compute PAVIN/PAVOUT but I have the feeling we do not
   actually need full partial availability information.  One of
   the things we could do is consider registers not available
   when they are not live.

The attached patch is my idea for approach number 3.  The idea
is to simply prune PAVIN with global liveness information:

  PAVIN_RELEVANT(B) = intersection of PAVIN(B) and  LIVEIN(B)

The patch just finished bootstrapping and I'm going to test it
now, and see if it brings the speedup I'm looking for. 

Since there are no test cases for accurate live analysis, I
guess I'll also have to do full SPEC runs and implement a few
test cases myself to see if this new analysis actually works.


Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.118
diff -u -3 -p -r1.118 global.c
--- global.c    25 Nov 2004 09:30:03 -0000      1.118
+++ global.c    14 Dec 2004 15:19:22 -0000
@@ -2303,7 +2303,10 @@ modify_bb_reg_pav (basic_block bb, basic
   bb_pavin = bb_info->pavin;
   bb_pavout = bb_info->pavout;
   if (pred->index != ENTRY_BLOCK)
-    bitmap_ior_into (bb_pavin, BB_INFO (pred)->pavout);
+    {
+      bitmap_ior_into (bb_pavin, BB_INFO (pred)->pavout);
+      bitmap_and_into (bb_pavin, bb->global_live_at_start);
+    }
   changed_p |= bitmap_ior_and_compl (bb_pavout, bb_info->avloc,
                                     bb_pavin, bb_info->killed);
   return changed_p;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17340

Reply via email to