This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[dataflow]: PATCH to remove DF_HARD_REGS df scanning flag.


The plan of the previous patch I submitted, this patch and the next few
patches is to remove all of the flags that control df scanning. This is
the first step in a process to make the df scanning persistent rather
than having it thrown away and recreated on every pass, which is just
too expensive. 

In this patch, I have removed the DF_HARD_REGS flag and replaced it with
a DF_NO_HARD_REGS which is currently used only by web.c. The new flag
does not effect the scanning as did DF_HARD_REGS.  DF_NO_HARD_REGS
effects the way that the reaching defs and chain building look at the
scanning info.  Web.c was also taught to ignore hard regs in some of its
loops. 

This patch has been bootstrapped and regression tested on
powerpc64-unknown-linux-gnu and
x86_64-unknown-linux-gnu,


2006-10-01  Kenneth Zadeck <zadeck@naturalbridge.com>
    * df-scan.c (df_ref_record, df_insn_refs_record,
    df_bb_refs_record, df_refs_record, df_record_entry_block_defs):
    Removed DF_HARD_REGS flag.
    * df-core.c (comments): Ditto.
    * df.h (permanent_flags.DF_HARD_REFS): Removed.
    (changeable_flags.DF_NO_HARD_REGS): Added.
    * df-problems.c (df_rd_bb_local_compute_process_def,
    df_rd_bb_local_compute, df_chain_create_bb_process_use,
    df_chain_create_bb): Added support for DF_NO_HARD_REGS flag.
    * dce.c (init_dce): Removed DF_HARD_REFS flag.
    * reg_stack.c (reg_to_stack): Ditto.
    * sched_rgn.c (sched_insns): Ditto.
    * regrename.c (regrename_optimize): Ditto.
    * sched_ebb.c (schedule_ebbs): Ditto.
    * fwprop.c (fwprop_init): Ditto.
    * see.c (see_initialize_data_structures): Ditto.
    * auto_inc_dec.c (rest_of_handle_auto_inc_dec): Ditto.
    * mode-switching.c (optimize_mode_switching): Ditto.
    * modulo-sched.c (sms_schedule): Ditto.
    * ifcvt.c (if_convert): Ditto.
    * recog.c (peephole2_optimize): Ditto.
    * regmove.c (regmove_optimize, rest_of_handle_stack_adjustments):
    Ditto.
    * local_alloc.c (rest_of_handle_local_alloc): Ditto.
    * function.c (thread_prologue_and_epilogue_insns): Ditto.
    * rtl_factoring.c (rtl_sequabstr): Ditto.
    * bt_load.c (branch_target_load_optimize): Ditto.
    * loop_invariant.c (move_loop_invariants): Ditto.
    * subregs-init.c (initialize_uninitialized_subregs): Ditto.
    * loop-iv.c (iv_analysis_loop_init): Ditto.
    * combine.c (rest_of_handle_combine): Ditto.
    * web.c (web_main): Added DF_NO_HARD_REGS flag and changed loops
    to skip over hard regs.
    * reorg.c (dbr_schedule): Removed extra flags from
    df_*_add_problems calls.
Index: df-scan.c
===================================================================
--- df-scan.c	(revision 117330)
+++ df-scan.c	(working copy)
@@ -1088,9 +1088,6 @@ df_ref_record (struct dataflow *dflow, r
       struct df_scan_problem_data *problem_data
 	= (struct df_scan_problem_data *) dflow->problem_data;
 
-      if (!(df->permanent_flags & DF_HARD_REGS))
-	return;
-
       /* GET_MODE (reg) is correct here.  We do not want to go into a SUBREG
          for the mode, because we only want to add references to regs, which
 	 are really referenced.  E.g., a (subreg:SI (reg:DI 0) 0) does _not_
@@ -1555,6 +1552,8 @@ df_insn_refs_record (struct dataflow *df
       if (CALL_P (insn))
 	{
 	  rtx note;
+	  bitmap_iterator bi;
+	  unsigned int ui;
 
 	  /* Record the registers used to pass arguments, and explicitly
 	     noted as clobbered.  */
@@ -1590,21 +1589,16 @@ df_insn_refs_record (struct dataflow *df
 			  DF_REF_REG_USE, bb, insn, 
 			  DF_REF_CALL_STACK_USAGE);
 
-	  if (df->permanent_flags & DF_HARD_REGS)
-	    {
-	      bitmap_iterator bi;
-	      unsigned int ui;
-	      /* Calls may also reference any of the global registers,
-		 so they are recorded as used.  */
-	      for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-		if (global_regs[i])
-		  df_uses_record (dflow, &regno_reg_rtx[i],
-				  DF_REF_REG_USE, bb, insn, 
-				  0);
-	      EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi)
-	        df_ref_record (dflow, regno_reg_rtx[ui], &regno_reg_rtx[ui], bb, 
-			       insn, DF_REF_REG_DEF, DF_REF_MAY_CLOBBER, false);
-	    }
+	  /* Calls may also reference any of the global registers,
+	     so they are recorded as used.  */
+	  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+	    if (global_regs[i])
+	      df_uses_record (dflow, &regno_reg_rtx[i],
+			      DF_REF_REG_USE, bb, insn, 
+			      0);
+	  EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi)
+	    df_ref_record (dflow, regno_reg_rtx[ui], &regno_reg_rtx[ui], bb, 
+			   insn, DF_REF_REG_DEF, DF_REF_MAY_CLOBBER, false);
 	}
 
       /* Record the register uses.  */
@@ -1661,10 +1655,6 @@ df_bb_refs_record (struct dataflow *dflo
   rtx insn;
   int luid = 0;
   struct df_scan_bb_info *bb_info = df_scan_get_bb_info (dflow, bb->index);
-  bitmap artificial_uses_at_bottom = NULL;
-
-  if (df->permanent_flags & DF_HARD_REGS)
-    artificial_uses_at_bottom = BITMAP_ALLOC (NULL);
 
   /* Need to make sure that there is a record in the basic block info. */  
   if (!bb_info)
@@ -1689,8 +1679,7 @@ df_bb_refs_record (struct dataflow *dflo
     }
 
 #ifdef EH_RETURN_DATA_REGNO
-  if ((df->permanent_flags & DF_HARD_REGS)
-      && df_has_eh_preds (bb))
+  if (df_has_eh_preds (bb))
     {
       unsigned int i;
       /* Mark the registers that will contain data for the handler.  */
@@ -1709,8 +1698,7 @@ df_bb_refs_record (struct dataflow *dflo
 
 
 #ifdef EH_USES
-  if ((dflow->flags & DF_HARD_REGS)
-      && df_has_eh_preds (bb))
+  if (df_has_eh_preds (bb))
     {
       unsigned int i;
       /* This code is putting in a artificial ref for the use at the
@@ -1732,8 +1720,7 @@ df_bb_refs_record (struct dataflow *dflo
     }
 #endif
 
-  if ((df->permanent_flags & DF_HARD_REGS) 
-      && bb->index >= NUM_FIXED_BLOCKS)
+  if (bb->index >= NUM_FIXED_BLOCKS)
     {
       bitmap_iterator bi;
       unsigned int regno;
@@ -1762,56 +1749,52 @@ df_refs_record (struct dataflow *dflow, 
   bitmap_clear (df->regular_block_artificial_uses);
   bitmap_clear (df->eh_block_artificial_uses);
 
-  if (df->permanent_flags & DF_HARD_REGS)
+  /* The following code (down thru the arg_pointer seting APPEARS
+     to be necessary because there is nothing that actually
+     describes what the exception handling code may actually need
+     to keep alive.  */
+  if (reload_completed)
     {
-      /* The following code (down thru the arg_pointer seting APPEARS
-	 to be necessary because there is nothing that actually
-	 describes what the exception handling code may actually need
-	 to keep alive.  */
-      if (reload_completed)
+      if (frame_pointer_needed)
 	{
-	  if (frame_pointer_needed)
-	    {
-	      bitmap_set_bit (df->eh_block_artificial_uses, FRAME_POINTER_REGNUM);
+	  bitmap_set_bit (df->eh_block_artificial_uses, FRAME_POINTER_REGNUM);
 #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
-	      bitmap_set_bit (df->eh_block_artificial_uses, HARD_FRAME_POINTER_REGNUM);
+	  bitmap_set_bit (df->eh_block_artificial_uses, HARD_FRAME_POINTER_REGNUM);
 #endif
-	    }
+	}
 #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
-	  if (fixed_regs[ARG_POINTER_REGNUM])
-	    bitmap_set_bit (df->eh_block_artificial_uses, ARG_POINTER_REGNUM);
+      if (fixed_regs[ARG_POINTER_REGNUM])
+	bitmap_set_bit (df->eh_block_artificial_uses, ARG_POINTER_REGNUM);
 #endif
-	}
-
-      /* Before reload, there are a few registers that must be forced
-	 live everywhere -- which might not already be the case for
-	 blocks within infinite loops.  */
-      if (!reload_completed)
-	{
-	  /* Any reference to any pseudo before reload is a potential
-	     reference of the frame pointer.  */
-	  bitmap_set_bit (df->regular_block_artificial_uses, FRAME_POINTER_REGNUM);
-	  
+    }
+  
+  /* Before reload, there are a few registers that must be forced
+     live everywhere -- which might not already be the case for
+     blocks within infinite loops.  */
+  if (!reload_completed)
+    {
+      /* Any reference to any pseudo before reload is a potential
+	 reference of the frame pointer.  */
+      bitmap_set_bit (df->regular_block_artificial_uses, FRAME_POINTER_REGNUM);
+      
 #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
-	  /* Pseudos with argument area equivalences may require
-	     reloading via the argument pointer.  */
-	  if (fixed_regs[ARG_POINTER_REGNUM])
-	    bitmap_set_bit (df->regular_block_artificial_uses, ARG_POINTER_REGNUM);
+      /* Pseudos with argument area equivalences may require
+	 reloading via the argument pointer.  */
+      if (fixed_regs[ARG_POINTER_REGNUM])
+	bitmap_set_bit (df->regular_block_artificial_uses, ARG_POINTER_REGNUM);
 #endif
-	  
-	  /* Any constant, or pseudo with constant equivalences, may
-	     require reloading from memory using the pic register.  */
-	  if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
-	      && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
-	    bitmap_set_bit (df->regular_block_artificial_uses, PIC_OFFSET_TABLE_REGNUM);
-	}
-      /* The all-important stack pointer must always be live.  */
-      bitmap_set_bit (df->regular_block_artificial_uses, STACK_POINTER_REGNUM);
-
-      bitmap_ior_into (df->eh_block_artificial_uses, 
-		      df->regular_block_artificial_uses);
+      
+      /* Any constant, or pseudo with constant equivalences, may
+	 require reloading from memory using the pic register.  */
+      if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
+	  && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
+	bitmap_set_bit (df->regular_block_artificial_uses, PIC_OFFSET_TABLE_REGNUM);
     }
+  /* The all-important stack pointer must always be live.  */
+  bitmap_set_bit (df->regular_block_artificial_uses, STACK_POINTER_REGNUM);
 
+  bitmap_ior_into (df->eh_block_artificial_uses, 
+		   df->regular_block_artificial_uses);
 
   EXECUTE_IF_SET_IN_BITMAP (blocks, 0, bb_index, bi)
     {
@@ -1865,9 +1848,6 @@ df_record_entry_block_defs (struct dataf
 
   bitmap_clear (df->entry_block_defs);
 
-  if (!(df->permanent_flags & DF_HARD_REGS))
-    return;
-
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
     {
       if (FUNCTION_ARG_REGNO_P (i))
@@ -1977,9 +1957,6 @@ df_record_exit_block_uses (struct datafl
 
   bitmap_clear (df->exit_block_uses);
   
-  if (!(df->permanent_flags & DF_HARD_REGS))
-    return;
-
   /* If exiting needs the right stack value, consider the stack
      pointer live at the end of the function.  */
   if ((HAVE_epilogue && epilogue_completed)
@@ -2078,11 +2055,10 @@ df_record_exit_block_uses (struct datafl
   /* Mark function return value.  */
   diddle_return_value (df_mark_reg, (void*) df->exit_block_uses);
 
-  if (df->permanent_flags & DF_HARD_REGS)
-    EXECUTE_IF_SET_IN_BITMAP (df->exit_block_uses, 0, i, bi)
-      df_uses_record (dflow, &regno_reg_rtx[i], 
-  		      DF_REF_REG_USE, EXIT_BLOCK_PTR, NULL,
-		      DF_REF_ARTIFICIAL);
+  EXECUTE_IF_SET_IN_BITMAP (df->exit_block_uses, 0, i, bi)
+    df_uses_record (dflow, &regno_reg_rtx[i], 
+		    DF_REF_REG_USE, EXIT_BLOCK_PTR, NULL,
+		    DF_REF_ARTIFICIAL);
 }
 
 static bool initialized = false;
Index: df-core.c
===================================================================
--- df-core.c	(revision 117330)
+++ df-core.c	(working copy)
@@ -66,9 +66,6 @@ and frees up any allocated memory.
 There are three flags that can be passed to df_init, each of these
 flags controls the scanning of the rtl:
 
-DF_HARD_REGS means that the scanning is to build information about
-both pseudo registers and hardware registers.  Without this
-information, the problems will be solved only on pseudo registers.
 DF_EQUIV_NOTES marks the uses present in EQUIV/EQUAL notes.
 DF_SUBREGS return subregs rather than the inner reg.
 
@@ -208,9 +205,7 @@ There are 4 ways to obtain access to ref
 
    ARTIFICIAL refs are associated with basic blocks.  The heads of
    these lists can be accessed by calling get_artificial_defs or
-   get_artificial_uses for the particular basic block.  Artificial
-   defs and uses are only there if DF_HARD_REGS was specified when the
-   df instance was created.
+   get_artificial_uses for the particular basic block.  
  
    Artificial defs and uses occur both at the beginning and ends of blocks.
 
Index: df.h
===================================================================
--- df.h	(revision 117330)
+++ df.h	(working copy)
@@ -337,22 +337,22 @@ struct df_ref_info
 enum df_permanent_flags 
 {
   /* Scanning flags.  */
-  DF_HARD_REGS     =  1, /* Mark hard registers.  */
-  DF_EQUIV_NOTES   =  2, /* Mark uses present in EQUIV/EQUAL notes.  */
-  DF_SUBREGS       =  4, /* Return subregs rather than the inner reg.  */
+  DF_EQUIV_NOTES   =  1, /* Mark uses present in EQUIV/EQUAL notes.  */
+  DF_SUBREGS       =  2, /* Return subregs rather than the inner reg.  */
   /* Flags that control the building of chains.  */
-  DF_DU_CHAIN      =  8, /* Build DU chains.  */  
-  DF_UD_CHAIN      = 16, /* Build UD chains.  */
+  DF_DU_CHAIN      =  4, /* Build DU chains.  */  
+  DF_UD_CHAIN      =  8, /* Build UD chains.  */
   /* Flag to control the building of register info.  */
-  DF_RI_LIFE       = 32, /* Build register info.  */
-  DF_RI_SETJMP     = 64  /* Build pseudos that cross setjmp info.  */
+  DF_RI_LIFE       = 16, /* Build register info.  */
+  DF_RI_SETJMP     = 32  /* Build pseudos that cross setjmp info.  */
 };
 
 enum df_changeable_flags 
 {
   /* Scanning flags.  */
   /* Flag to control the running of dce as a side effect of building LR.  */
-  DF_LR_RUN_DCE    = 1   /* Run DCE.  */
+  DF_LR_RUN_DCE    = 1,  /* Run DCE.  */
+  DF_NO_HARD_REGS  = 2   /* Skip hard registers in RD and CHAIN Building.  */
 };
 
 
Index: df-problems.c
===================================================================
--- df-problems.c	(revision 117330)
+++ df-problems.c	(working copy)
@@ -1030,40 +1030,44 @@ df_rd_bb_local_compute_process_def (stru
 	  unsigned int begin = DF_REG_DEF_GET (df, regno)->begin;
 	  unsigned int n_defs = DF_REG_DEF_GET (df, regno)->n_refs;
 	  
-	  /* Only the last def(s) for a regno in the block has any
-	     effect.  */ 
-	  if (!bitmap_bit_p (seen_in_block, regno))
+	  if ((!(df->changeable_flags & DF_NO_HARD_REGS))
+	      || (regno >= FIRST_PSEUDO_REGISTER))
 	    {
-	      /* The first def for regno in insn gets to knock out the
-		 defs from other instructions.  */
-	      if ((!bitmap_bit_p (seen_in_insn, regno))
-		  /* If the def is to only part of the reg, it does
-		     not kill the other defs that reach here.  */
-		  && (!(DF_REF_FLAGS (def) & 
-			(DF_REF_PARTIAL | DF_REF_CONDITIONAL | DF_REF_MAY_CLOBBER))))
+	      /* Only the last def(s) for a regno in the block has any
+		 effect.  */ 
+	      if (!bitmap_bit_p (seen_in_block, regno))
 		{
-		  if (n_defs > DF_SPARSE_THRESHOLD)
-		    {
-		      bitmap_set_bit (bb_info->sparse_kill, regno);
-		      bitmap_clear_range(bb_info->gen, begin, n_defs);
-		    }
-		  else
+		  /* The first def for regno in insn gets to knock out the
+		     defs from other instructions.  */
+		  if ((!bitmap_bit_p (seen_in_insn, regno))
+		      /* If the def is to only part of the reg, it does
+			 not kill the other defs that reach here.  */
+		      && (!(DF_REF_FLAGS (def) & 
+			    (DF_REF_PARTIAL | DF_REF_CONDITIONAL | DF_REF_MAY_CLOBBER))))
 		    {
-		      struct df_rd_problem_data * problem_data
-			= (struct df_rd_problem_data *)dflow->problem_data;
-		      bitmap defs = df_ref_bitmap (problem_data->def_sites, 
-						   regno, begin, n_defs);
-		      bitmap_ior_into (bb_info->kill, defs);
-		      bitmap_and_compl_into (bb_info->gen, defs);
+		      if (n_defs > DF_SPARSE_THRESHOLD)
+			{
+			  bitmap_set_bit (bb_info->sparse_kill, regno);
+			  bitmap_clear_range(bb_info->gen, begin, n_defs);
+			}
+		      else
+			{
+			  struct df_rd_problem_data * problem_data
+			    = (struct df_rd_problem_data *)dflow->problem_data;
+			  bitmap defs = df_ref_bitmap (problem_data->def_sites, 
+						       regno, begin, n_defs);
+			  bitmap_ior_into (bb_info->kill, defs);
+			  bitmap_and_compl_into (bb_info->gen, defs);
+			}
 		    }
+		  
+		  bitmap_set_bit (seen_in_insn, regno);
+		  /* All defs for regno in the instruction may be put into
+		     the gen set.  */
+		  if (!(DF_REF_FLAGS (def) 
+			& (DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER)))
+		    bitmap_set_bit (bb_info->gen, DF_REF_ID (def));
 		}
-	      
-	      bitmap_set_bit (seen_in_insn, regno);
-	      /* All defs for regno in the instruction may be put into
-		 the gen set.  */
-	      if (!(DF_REF_FLAGS (def) 
-		     & (DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER)))
-		bitmap_set_bit (bb_info->gen, DF_REF_ID (def));
 	    }
 	}
       def = def->next_ref;
@@ -1083,8 +1087,12 @@ df_rd_bb_local_compute (struct dataflow 
   bitmap_clear (seen_in_block);
   bitmap_clear (seen_in_insn);
 
-  df_rd_bb_local_compute_process_def (dflow, bb_info, 
-				      df_get_artificial_defs (df, bb_index), 0);
+  /* Artificials are only hard regs.  */
+  if (!(df->changeable_flags & DF_NO_HARD_REGS))
+    df_rd_bb_local_compute_process_def (dflow, bb_info, 
+					df_get_artificial_defs (df, 
+								bb_index),
+					0);
 
   FOR_BB_INSNS_REVERSE (bb, insn)
     {
@@ -1109,9 +1117,11 @@ df_rd_bb_local_compute (struct dataflow 
   /* Process the artificial defs at the top of the block last since we
      are going backwards through the block and these are logically at
      the start.  */
-  df_rd_bb_local_compute_process_def (dflow, bb_info, 
-				      df_get_artificial_defs (df, bb_index),
-				      DF_REF_AT_TOP);
+  if (!(df->changeable_flags & DF_NO_HARD_REGS))
+    df_rd_bb_local_compute_process_def (dflow, bb_info, 
+					df_get_artificial_defs (df, 
+								bb_index),
+					DF_REF_AT_TOP);
 }
 
 
@@ -3233,28 +3243,33 @@ df_chain_create_bb_process_use (struct d
     {
       /* Do not want to go through this for an uninitialized var.  */
       unsigned int uregno = DF_REF_REGNO (use);
-      int count = DF_REG_DEF_GET (df, uregno)->n_refs;
-      if (count)
+      if ((!(df->changeable_flags & DF_NO_HARD_REGS))
+	  || (uregno >= FIRST_PSEUDO_REGISTER))
 	{
-	  if (top_flag == (DF_REF_FLAGS (use) & DF_REF_AT_TOP))
+	  int count = DF_REG_DEF_GET (df, uregno)->n_refs;
+	  if (count)
 	    {
-	      unsigned int first_index = DF_REG_DEF_GET (df, uregno)->begin;
-	      unsigned int last_index = first_index + count - 1;
-	      
-	      EXECUTE_IF_SET_IN_BITMAP (local_rd, first_index, def_index, bi)
+	      if (top_flag == (DF_REF_FLAGS (use) & DF_REF_AT_TOP))
 		{
-		  struct df_ref *def;
-		  if (def_index > last_index) 
-		    break;
+		  unsigned int first_index = DF_REG_DEF_GET (df, uregno)->begin;
+		  unsigned int last_index = first_index + count - 1;
 		  
-		  def = DF_DEFS_GET (df, def_index);
-		  if (df->permanent_flags & DF_DU_CHAIN)
-		    df_chain_create (dflow, def, use);
-		  if (df->permanent_flags & DF_UD_CHAIN)
-		    df_chain_create (dflow, use, def);
+		  EXECUTE_IF_SET_IN_BITMAP (local_rd, first_index, def_index, bi)
+		    {
+		      struct df_ref *def;
+		      if (def_index > last_index) 
+			break;
+		      
+		      def = DF_DEFS_GET (df, def_index);
+		      if (df->permanent_flags & DF_DU_CHAIN)
+			df_chain_create (dflow, def, use);
+		      if (df->permanent_flags & DF_UD_CHAIN)
+			df_chain_create (dflow, use, def);
+		    }
 		}
 	    }
 	}
+
       use = use->next_ref;
     }
 }
@@ -3284,9 +3299,13 @@ df_chain_create_bb (struct dataflow *dfl
 #ifdef EH_USES
   /* Create the chains for the artificial uses from the EH_USES at the
      beginning of the block.  */
-  df_chain_create_bb_process_use (dflow, cpy,
-				  df_get_artificial_uses (df, bb->index), 
-				  DF_REF_AT_TOP);
+  
+  /* Artificials are only hard regs.  */
+  if (!(df->changeable_flags & DF_NO_HARD_REGS))
+    df_chain_create_bb_process_use (dflow, cpy,
+				    df_get_artificial_uses (df, 
+							    bb->index), 
+				    DF_REF_AT_TOP);
 #endif
 
   for (def = df_get_artificial_defs (df, bb_index); def; def = def->next_ref)
@@ -3320,20 +3339,27 @@ df_chain_create_bb (struct dataflow *dfl
       for (def = DF_INSN_UID_DEFS (df, uid); def; def = def->next_ref)
 	{
 	  unsigned int dregno = DF_REF_REGNO (def);
-	  if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL)))
-	    bitmap_clear_range (cpy, 
-				DF_REG_DEF_GET (df, dregno)->begin, 
-				DF_REG_DEF_GET (df, dregno)->n_refs);
-	  if (!(DF_REF_FLAGS (def) 
-		 & (DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER)))
-	    bitmap_set_bit (cpy, DF_REF_ID (def));
+	  if ((!(df->changeable_flags & DF_NO_HARD_REGS))
+	      || (dregno >= FIRST_PSEUDO_REGISTER))
+	    {
+	      if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL)))
+		bitmap_clear_range (cpy, 
+				    DF_REG_DEF_GET (df, dregno)->begin, 
+				    DF_REG_DEF_GET (df, dregno)->n_refs);
+	      if (!(DF_REF_FLAGS (def) 
+		    & (DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER)))
+		bitmap_set_bit (cpy, DF_REF_ID (def));
+	    }
 	}
     }
 
   /* Create the chains for the artificial uses of the hard registers
      at the end of the block.  */
-  df_chain_create_bb_process_use (dflow, cpy,
-				  df_get_artificial_uses (df, bb->index), 0);
+  if (!(df->changeable_flags & DF_NO_HARD_REGS))
+    df_chain_create_bb_process_use (dflow, cpy,
+				    df_get_artificial_uses (df, 
+							    bb->index), 
+				    0);
 }
 
 /* Create def-use chains from reaching use bitmaps for basic blocks
Index: dce.c
===================================================================
--- dce.c	(revision 117330)
+++ dce.c	(working copy)
@@ -191,13 +191,13 @@ init_dce (bool fast)
     {
       if (fast)
 	{
-	  dce_df = df_init (DF_HARD_REGS, 0);
+	  dce_df = df_init (0, 0);
 	  df_lr_add_problem (dce_df);
 	  df_analyze (dce_df);
 	}
       else
 	{
-	  dce_df = df_init (DF_HARD_REGS + DF_UD_CHAIN, 0);
+	  dce_df = df_init (DF_UD_CHAIN, 0);
 	  df_chain_add_problem (dce_df);
 	  df_analyze (dce_df);
 	}
Index: reg-stack.c
===================================================================
--- reg-stack.c	(revision 117330)
+++ reg-stack.c	(working copy)
@@ -3103,7 +3103,7 @@ reg_to_stack (void)
   if (i > LAST_STACK_REG)
     return false;
 
-  df = df_init (DF_HARD_REGS, 0);
+  df = df_init (0, 0);
   df_live_add_problem (df);
   df_ri_add_problem (df);
   df_analyze (df);
Index: sched-rgn.c
===================================================================
--- sched-rgn.c	(revision 117330)
+++ sched-rgn.c	(working copy)
@@ -2911,7 +2911,7 @@ schedule_insns (void)
      invoked via sched_init.  */
   current_sched_info = &region_sched_info;
 
-  df = df_init (DF_HARD_REGS + DF_EQUIV_NOTES + DF_SUBREGS + DF_RI_LIFE, 
+  df = df_init (DF_EQUIV_NOTES + DF_SUBREGS + DF_RI_LIFE, 
 		DF_LR_RUN_DCE);
   df_lr_add_problem (df);
   df_live_add_problem (df);
Index: regrename.c
===================================================================
--- regrename.c	(revision 117330)
+++ regrename.c	(working copy)
@@ -193,7 +193,7 @@ regrename_optimize (void)
   int this_tick = 0;
   basic_block bb;
   char *first_obj;
-  struct df * df = df_init (DF_HARD_REGS, DF_LR_RUN_DCE);
+  struct df * df = df_init (0, DF_LR_RUN_DCE);
   df_lr_add_problem (df);
   df_live_add_problem (df);
   df_ri_add_problem (df);
Index: sched-ebb.c
===================================================================
--- sched-ebb.c	(revision 117330)
+++ sched-ebb.c	(working copy)
@@ -560,7 +560,7 @@ schedule_ebbs (void)
      invoked via sched_init.  */
   current_sched_info = &ebb_sched_info;
 
-  df = df_init (DF_HARD_REGS + DF_EQUIV_NOTES + DF_SUBREGS + DF_RI_LIFE, 
+  df = df_init (DF_EQUIV_NOTES + DF_SUBREGS + DF_RI_LIFE, 
 		DF_LR_RUN_DCE);
   df_lr_add_problem (df);
   df_live_add_problem (df);
Index: see.c
===================================================================
--- see.c	(revision 117330)
+++ see.c	(working copy)
@@ -1331,7 +1331,7 @@ static void
 see_initialize_data_structures (void)
 {
   /* Build the df object. */
-  df = df_init (DF_HARD_REGS + DF_EQUIV_NOTES + DF_SUBREGS + DF_DU_CHAIN + DF_UD_CHAIN, 0);
+  df = df_init (DF_EQUIV_NOTES + DF_SUBREGS + DF_DU_CHAIN + DF_UD_CHAIN, 0);
   df_rd_add_problem (df);
   df_chain_add_problem (df);
   df_analyze (df);
Index: auto-inc-dec.c
===================================================================
--- auto-inc-dec.c	(revision 117330)
+++ auto-inc-dec.c	(working copy)
@@ -1457,7 +1457,7 @@ rest_of_handle_auto_inc_dec (void)
 
   mem_tmp = gen_rtx_MEM (Pmode, NULL_RTX);
 
-  df = df_init (DF_HARD_REGS, 0);
+  df = df_init (0, 0);
   df_live_add_problem (df);
   df_ri_add_problem (df);
   scan_dflow = df->problems_by_index[DF_SCAN];
Index: mode-switching.c
===================================================================
--- mode-switching.c	(revision 117330)
+++ mode-switching.c	(working copy)
@@ -421,7 +421,7 @@ optimize_mode_switching (void)
   if (! n_entities)
     return 0;
 
-  df = df_init (DF_HARD_REGS, 0);
+  df = df_init (0, 0);
   df_live_add_problem (df);
   df_ri_add_problem (df);
   df_analyze (df);
Index: modulo-sched.c
===================================================================
--- modulo-sched.c	(revision 117330)
+++ modulo-sched.c	(working copy)
@@ -932,7 +932,7 @@ sms_schedule (void)
   current_sched_info = &sms_sched_info;
 
   /* Init Data Flow analysis, to be used in interloop dep calculation.  */
-  df = df_init (DF_HARD_REGS + DF_EQUIV_NOTES + DF_SUBREGS + 
+  df = df_init (DF_EQUIV_NOTES + DF_SUBREGS + 
 		DF_RI_LIFE + DF_DU_CHAIN + DF_UD_CHAIN, 
 		DF_LR_RUN_DCE);
   df_lr_add_problem (df);
Index: ifcvt.c
===================================================================
--- ifcvt.c	(revision 117330)
+++ ifcvt.c	(working copy)
@@ -3852,7 +3852,7 @@ if_convert (void)
   basic_block bb;
   int pass;
   bitmap modified = BITMAP_ALLOC (NULL);
-  struct df * df = df_init (DF_HARD_REGS, DF_LR_RUN_DCE);
+  struct df * df = df_init (0, DF_LR_RUN_DCE);
   df_lr_add_problem (df);
   df_live_add_problem (df);
 
Index: recog.c
===================================================================
--- recog.c	(revision 117330)
+++ recog.c	(working copy)
@@ -2881,7 +2881,7 @@ peephole2_optimize (void)
   basic_block bb;
   bool do_cleanup_cfg = false;
   bool do_rebuild_jump_labels = false;
-  struct df * df = df_init (DF_HARD_REGS, DF_LR_RUN_DCE);
+  struct df * df = df_init (0, DF_LR_RUN_DCE);
   struct dataflow *dflow = df->problems_by_index [DF_SCAN];
 
   df_lr_add_problem (df);
Index: regmove.c
===================================================================
--- regmove.c	(revision 117330)
+++ regmove.c	(working copy)
@@ -1125,7 +1125,7 @@ regmove_optimize (rtx f, int nregs)
   int i;
   rtx copy_src, copy_dst;
   basic_block bb;
-  struct df * df = df_init (DF_HARD_REGS + DF_RI_LIFE, 0);
+  struct df * df = df_init (DF_RI_LIFE, 0);
   df_live_add_problem (df);
   df_ri_add_problem (df);
   df_analyze (df);
@@ -2603,7 +2603,7 @@ rest_of_handle_stack_adjustments (void)
   if (!ACCUMULATE_OUTGOING_ARGS)
 #endif
     {
-      struct df * df = df_init (DF_HARD_REGS, 0);
+      struct df * df = df_init (0, 0);
       df_live_add_problem (df);
       df_ri_add_problem (df);
       df_analyze (df);
Index: local-alloc.c
===================================================================
--- local-alloc.c	(revision 117330)
+++ local-alloc.c	(working copy)
@@ -2489,7 +2489,7 @@ rest_of_handle_local_alloc (void)
   int rebuild_notes;
 
   /* Create a new version of df that has the special version of UR.  */
-  ra_df = df_init (DF_HARD_REGS + DF_RI_LIFE + DF_RI_SETJMP, 0);
+  ra_df = df_init (DF_RI_LIFE + DF_RI_SETJMP, 0);
   df_lr_add_problem (ra_df);
   df_urec_add_problem (ra_df);
   df_ri_add_problem (ra_df);
Index: function.c
===================================================================
--- function.c	(revision 117330)
+++ function.c	(working copy)
@@ -5093,7 +5093,7 @@ thread_prologue_and_epilogue_insns (void
 #endif
   edge_iterator ei;
 
-  prologue_epilogue_df = df_init (DF_HARD_REGS, 0);
+  prologue_epilogue_df = df_init (0, 0);
   /* Do not even think about running dce here!!!!  All life, as we
      know it will cease!!!  There is dead code created by the previous
      call to split_all_insns that is resurrected by the prologue and
Index: rtl-factoring.c
===================================================================
--- rtl-factoring.c	(revision 117330)
+++ rtl-factoring.c	(working copy)
@@ -1360,7 +1360,7 @@ static void
 rtl_seqabstr (void)
 {
   int iter;
-  struct df * df = df_init (DF_HARD_REGS, DF_LR_RUN_DCE);
+  struct df * df = df_init (0, DF_LR_RUN_DCE);
   df_lr_add_problem (df);
   df_live_add_problem (df);
   df_analyze (df);
Index: bt-load.c
===================================================================
--- bt-load.c	(revision 117330)
+++ bt-load.c	(working copy)
@@ -1467,7 +1467,7 @@ branch_target_load_optimize (bool after_
   enum reg_class class = targetm.branch_target_register_class ();
   if (class != NO_REGS)
     {
-      struct df * df = df_init (DF_HARD_REGS, 0);
+      struct df * df = df_init (0, 0);
       df_live_add_problem (df);
 
       /* Initialize issue_rate.  */
Index: loop-invariant.c
===================================================================
--- loop-invariant.c	(revision 117330)
+++ loop-invariant.c	(working copy)
@@ -1319,7 +1319,7 @@ move_loop_invariants (struct loops *loop
 {
   struct loop *loop;
   unsigned i;
-  df = df_init (DF_HARD_REGS + DF_EQUIV_NOTES + DF_UD_CHAIN, 0);
+  df = df_init (DF_EQUIV_NOTES + DF_UD_CHAIN, 0);
   df_chain_add_problem (df);
  
   /* Process the loops, innermost first.  */
Index: subregs-init.c
===================================================================
--- subregs-init.c	(revision 117330)
+++ subregs-init.c	(working copy)
@@ -106,7 +106,7 @@ initialize_uninitialized_subregs (void)
   bool did_something = false;
   find_regno_partial_param param;
   edge_iterator ei;
-  struct df *df = df_init (DF_HARD_REGS, 0);
+  struct df *df = df_init (0, 0);
 
   df_live_add_problem (df);
   df_analyze (df);
Index: loop-iv.c
===================================================================
--- loop-iv.c	(revision 117330)
+++ loop-iv.c	(working copy)
@@ -252,7 +252,7 @@ iv_analysis_loop_init (struct loop *loop
   /* Clear the information from the analysis of the previous loop.  */
   if (first_time)
     {
-      df = df_init (DF_HARD_REGS + DF_EQUIV_NOTES + DF_UD_CHAIN, 0);
+      df = df_init (DF_EQUIV_NOTES + DF_UD_CHAIN, 0);
       df_chain_add_problem (df);
       bivs = htab_create (10, biv_hash, biv_eq, free);
     }
Index: combine.c
===================================================================
--- combine.c	(revision 117330)
+++ combine.c	(working copy)
@@ -12915,7 +12915,7 @@ rest_of_handle_combine (void)
 {
   int rebuild_jump_labels_after_combine;
 
-  df = df_init (DF_HARD_REGS + DF_RI_LIFE, DF_LR_RUN_DCE);
+  df = df_init (DF_RI_LIFE, DF_LR_RUN_DCE);
   df_lr_add_problem (df);
   df_live_add_problem (df);
   df_ri_add_problem (df);
Index: reorg.c
===================================================================
--- reorg.c	(revision 117329)
+++ reorg.c	(working copy)
@@ -3538,9 +3538,9 @@ dbr_schedule (rtx first)
 {
   rtx insn, next, epilogue_insn = 0;
   int i;
-  struct df *df = df_init (DF_HARD_REGS);
-  df_live_add_problem (df, 0);
-  df_ri_add_problem (df, 0);
+  struct df *df = df_init (0, 0);
+  df_live_add_problem (df);
+  df_ri_add_problem (df);
   df_analyze (df);
 
   /* If the current function has no insns other than the prologue and
Index: web.c
===================================================================
--- web.c	(revision 117330)
+++ web.c	(working copy)
@@ -253,7 +253,7 @@ web_main (void)
   int max = max_reg_num ();
   char *used;
 
-  df = df_init (DF_EQUIV_NOTES + DF_UD_CHAIN, 0);
+  df = df_init (DF_EQUIV_NOTES + DF_UD_CHAIN, DF_NO_HARD_REGS);
   df_chain_add_problem (df);
   df_analyze (df);
   df_reorganize_refs (&df->def_info);
@@ -265,16 +265,26 @@ web_main (void)
 
   /* Produce the web.  */
   for (i = 0; i < DF_USES_SIZE (df); i++)
-    union_defs (df, DF_USES_GET (df, i), def_entry, use_entry, unionfind_union);
+    {
+      struct df_ref *use = DF_USES_GET (df, i);
+      if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER)
+	union_defs (df, use, def_entry, use_entry, unionfind_union);
+    }
 
   /* Update the instruction stream, allocating new registers for split pseudos
      in progress.  */
   for (i = 0; i < DF_USES_SIZE (df); i++)
-    replace_ref (DF_USES_GET (df, i), 
-		 entry_register (use_entry + i, DF_USES_GET (df, i), used));
+    {
+      struct df_ref *use = DF_USES_GET (df, i);
+      if (DF_REF_REGNO (use) >= FIRST_PSEUDO_REGISTER)
+	replace_ref (use, entry_register (use_entry + i, use, used));
+    }
   for (i = 0; i < DF_DEFS_SIZE (df); i++)
-    replace_ref (DF_DEFS_GET (df, i), 
-		 entry_register (def_entry + i, DF_DEFS_GET (df, i), used));
+    {
+      struct df_ref *def = DF_DEFS_GET (df, i);
+      if (DF_REF_REGNO (def) >= FIRST_PSEUDO_REGISTER)
+	replace_ref (def, entry_register (def_entry + i, def, used));
+    }
 
   /* Dataflow information is corrupt here, but it can be easily updated
      by creating new entries for new registers and updates or calling

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]