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]

tiny df_note speedup


Hi,
Another thing I noticed is that df_note_* code shows quite top in the
profiles.  This patch micro optimize two quite obvious things I noticed
while glancing over the code.
One thing I do not understand is all the logic about removing REG notes
and adding them back.
We already manage freelist for notes so just removing them to freelist
and constructing again should be fine and actually faster since the
code is trying to match old ones for no apparent reason?

Bootstrapped/regtested x86_64-linux, OK?
Honza

	* df-problems.c (df_create_unused_note, df_note_bb_compute):
	micro-optimize the checks when to add new note.
Index: df-problems.c
===================================================================
--- df-problems.c	(revision 160154)
+++ df-problems.c	(working copy)
@@ -3387,8 +3387,8 @@ df_create_unused_note (rtx insn, rtx old
     }
 #endif
 
-  if (!(bitmap_bit_p (live, dregno)
-	|| (DF_REF_FLAGS (def) & DF_REF_MW_HARDREG)
+  if (!((DF_REF_FLAGS (def) & DF_REF_MW_HARDREG)
+	|| bitmap_bit_p (live, dregno)
 	|| bitmap_bit_p (artificial_uses, dregno)
 	|| df_ignore_stack_reg (dregno)))
     {
@@ -3757,10 +3757,10 @@ df_note_bb_compute (unsigned int bb_inde
 	      else
 		dead_debug_insert_before (&debug, uregno, insn);
 
-	      if ( (!(DF_REF_FLAGS (use) & DF_REF_MW_HARDREG))
+	      if ( (!(DF_REF_FLAGS (use)
+		      & (DF_REF_MW_HARDREG | DF_REF_READ_WRITE)))
 		   && (!bitmap_bit_p (do_not_gen, uregno))
 		   && (!bitmap_bit_p (artificial_uses, uregno))
-		   && (!(DF_REF_FLAGS (use) & DF_REF_READ_WRITE))
 		   && (!df_ignore_stack_reg (uregno)))
 		{
 		  rtx reg = (DF_REF_LOC (use))


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