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]

[rtlopt] Fix vpt


Hello,

a small fixes for value profiling.

Zdenek

Changelog:
	* vpt.c (find_values_to_profile): Move liveness analysis ...
	* toplev.c (rest_of_compilation): ... here.  Also do
	cleanup afterwards.

Index: toplev.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.668.2.11
diff -c -3 -p -r1.668.2.11 toplev.c
*** toplev.c	21 Nov 2002 20:07:15 -0000	1.668.2.11
--- toplev.c	23 Nov 2002 16:33:09 -0000
*************** rest_of_compilation (decl)
*** 3031,3037 ****
        timevar_push (TV_BRANCH_PROB);
        open_dump_file (DFI_bp, decl);
        if (cfun->arc_profile || flag_branch_probabilities)
! 	branch_prob ();
  
        /* Discover and record the loop depth at the head of each basic
  	 block.  The loop infrastructure does the real job for us.  */
--- 3031,3045 ----
        timevar_push (TV_BRANCH_PROB);
        open_dump_file (DFI_bp, decl);
        if (cfun->arc_profile || flag_branch_probabilities)
! 	{
! 	  if (flag_value_histograms)
! 	    {
! 	      /* Mark unused registers.  This is needed to turn divmods back into
! 		 corresponding divs/mods.  */
! 	      life_analysis (get_insns (), NULL, PROP_DEATH_NOTES);
! 	    }
! 	  branch_prob ();
! 	}
  
        /* Discover and record the loop depth at the head of each basic
  	 block.  The loop infrastructure does the real job for us.  */
*************** rest_of_compilation (decl)
*** 3060,3065 ****
--- 3068,3079 ----
  	cleanup_cfg (CLEANUP_EXPENSIVE);
  
        close_dump_file (DFI_vpt, print_rtl_with_bb, get_insns ());
+     }
+   if ((cfun->arc_profile || flag_branch_probabilities)
+       && flag_value_histograms)
+     {
+       reg_scan (get_insns (), max_reg_num (), 1);
+       count_or_remove_death_notes (NULL, 1);
      }
  
    if (optimize >= 0)
Index: vpt.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/Attic/vpt.c,v
retrieving revision 1.1.2.1
diff -c -3 -p -r1.1.2.1 vpt.c
*** vpt.c	21 Nov 2002 20:07:14 -0000	1.1.2.1
--- vpt.c	23 Nov 2002 16:33:09 -0000
*************** find_values_to_profile (n_values, values
*** 169,178 ****
    rtx insn;
    unsigned i;
  
-   /* Mark unused registers.  This is needed to turn divmods back into
-      corresponding divs/mods.  */
-   life_analysis (get_insns (), NULL, PROP_DEATH_NOTES);
- 
    *n_values = 0;
    for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
      insn_values_to_profile (insn, n_values, NULL);
--- 169,174 ----


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