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]

gcse.c: Use predicates


With Steven's patch for rtl.h I applied, I ported his patch to gcse.c
to current CVS and bootstrapped/regtested it on Linux/AMD64.

Ok to commit?

Andreas

2004-06-11  Steven Bosscher <stevenb@suse.de>,
	    Andreas Jaeger  <aj@suse.de>

	* gcse.c (record_set_info): Use predicates like REG_P.
	(mems_conflict_for_gcse_p): Likewise.
	(load_killed_in_block_p): Likewise.
	(hash_expr_1): Likewise.
	(insert_set_in_table): Likewise.
	(gcse_constant_p): Likewise.
	(hash_scan_set): Likewise.
	(hash_scan_insn): Likewise.
	(canon_list_insert): Likewise.
	(record_last_mem_set_info): Likewise.
	(record_last_set_info): Likewise.
	(compute_hash_table_work): Likewise.
	(mark_set): Likewise.
	(mark_clobber): Likewise.
	(mark_oprs_set): Likewise.
	(compute_transp): Likewise.
	(find_avail_set): Likewise.
	(cprop_insn): Likewise.
	(do_local_cprop): Likewise.
	(cprop): Likewise.
	(find_implicit_sets): Likewise.
	(find_bypass_set): Likewise.
	(bypass_conditional_jumps): Likewise.
	(insert_insn_end_bb): Likewise.
	(pre_insert_copy_insn): Likewise.
	(compute_transpout): Likewise.
	(next_ls_expr): Likewise.
	(invalidate_any_buried_refs): Likewise.
	(compute_ld_motion_mems): Likewise.
	(reg_set_info): Likewise.
	(reg_clear_last_set): Likewise.
	(find_moveable_store): Likewise.
	(compute_store_table): Likewise.
	(find_loads): Likewise.
	(store_killed_in_insn): Likewise.
	(insert_insn_start_bb): Likewise.
	(reg_set_between_after_reload_p): Likewise.
	(reg_used_between_after_reload_p): Likewise.
	(is_jump_table_basic_block): Likewise.
	(gcse_after_reload): Likewise.
	(hash_scan_set_after_reload): Likewise.
	(compute_hash_table_after_reload): Likewise.

============================================================
Index: gcc/gcse.c
--- gcc/gcse.c	14 May 2004 15:35:11 -0000	1.303
+++ gcc/gcse.c	11 Jun 2004 13:25:39 -0000
@@ -232,8 +232,8 @@ Software Foundation, 59 Temple Place - S
    substitutions.
 
    PRE is quite expensive in complicated functions because the DFA can take
-   awhile to converge.  Hence we only perform one pass.  The parameter max-gcse-passes can
-   be modified if one wants to experiment.
+   a while to converge.  Hence we only perform one pass.  The parameter
+   max-gcse-passes can be modified if one wants to experiment.
 
    **********************
 
@@ -288,7 +288,6 @@ static FILE *gcse_file;
     * If we changed any jumps via cprop.
 
     * If we added any labels via edge splitting.  */
-
 static int run_jump_opt_after_gcse;
 
 /* Bitmaps are normally not included in debugging dumps.
@@ -822,6 +821,7 @@ gcse_main (rtx f, FILE *file)
 
   obstack_free (&gcse_obstack, NULL);
   free_reg_set_mem ();
+
   /* We are finished with alias.  */
   end_alias_analysis ();
   allocate_reg_info (max_reg_num (), FALSE, FALSE);
@@ -1013,7 +1013,8 @@ free_gcse_mem (void)
    ABSALTERED.  */
 
 static void
-compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc, struct hash_table *table)
+compute_local_properties (sbitmap *transp, sbitmap *comp, sbitmap *antloc,
+			  struct hash_table *table)
 {
   unsigned int i;
 
@@ -1154,7 +1155,7 @@ record_set_info (rtx dest, rtx setter AT
 {
   rtx record_set_insn = (rtx) data;
 
-  if (GET_CODE (dest) == REG && REGNO (dest) >= FIRST_PSEUDO_REGISTER)
+  if (REG_P (dest) && REGNO (dest) >= FIRST_PSEUDO_REGISTER)
     record_one_set (REGNO (dest), record_set_insn);
 }
 
@@ -1355,7 +1356,7 @@ mems_conflict_for_gcse_p (rtx dest, rtx 
   /* If DEST is not a MEM, then it will not conflict with the load.  Note
      that function calls are assumed to clobber memory, but are handled
      elsewhere.  */
-  if (GET_CODE (dest) != MEM)
+  if (! MEM_P (dest))
     return;
 
   /* If we are setting a MEM in our list of specially recognized MEMs,
@@ -1403,7 +1404,7 @@ load_killed_in_block_p (basic_block bb, 
       /* If SETTER is a call everything is clobbered.  Note that calls
 	 to pure functions are never put on the list, so we need not
 	 worry about them.  */
-      if (GET_CODE (setter) == CALL_INSN)
+      if (CALL_P (setter))
 	return 1;
 
       /* SETTER must be an INSN of some kind that sets memory.  Call
@@ -1485,14 +1486,14 @@ hash_expr_1 (rtx x, enum machine_mode mo
   enum rtx_code code;
   const char *fmt;
 
-  /* Used to turn recursion into iteration.  We can't rely on GCC's
-     tail-recursion elimination since we need to keep accumulating values
-     in HASH.  */
-
   if (x == 0)
     return hash;
 
+  /* Used to turn recursion into iteration.  We can't rely on GCC's
+     tail-recursion elimination since we need to keep accumulating values
+     in HASH.  */
  repeat:
+
   code = GET_CODE (x);
   switch (code)
     {
@@ -1964,7 +1965,7 @@ insert_set_in_table (rtx x, rtx insn, st
   struct occr *cur_occr, *last_occr = NULL;
 
   if (GET_CODE (x) != SET
-      || GET_CODE (SET_DEST (x)) != REG)
+      || ! REG_P (SET_DEST (x)))
     abort ();
 
   hash = hash_set (REGNO (SET_DEST (x)), table->size);
@@ -2048,12 +2049,10 @@ gcse_constant_p (rtx x)
       && GET_CODE (XEXP (x, 1)) == CONST_INT)
     return true;
 
-
   /* Consider a COMPARE of the same registers is a constant
-    if they are not floating point registers.  */
+     if they are not floating point registers.  */
   if (GET_CODE(x) == COMPARE
-      && GET_CODE (XEXP (x, 0)) == REG
-      && GET_CODE (XEXP (x, 1)) == REG
+      && REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 1))
       && REGNO (XEXP (x, 0)) == REGNO (XEXP (x, 1))
       && ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0)))
       && ! FLOAT_MODE_P (GET_MODE (XEXP (x, 1))))
@@ -2072,10 +2071,10 @@ hash_scan_set (rtx pat, rtx insn, struct
   rtx dest = SET_DEST (pat);
   rtx note;
 
-  if (GET_CODE (src) == CALL)
+  if (CALL_P (src))
     hash_scan_call (src, insn, table);
 
-  else if (GET_CODE (dest) == REG)
+  else if (REG_P (dest))
     {
       unsigned int regno = REGNO (dest);
       rtx tmp;
@@ -2105,7 +2104,7 @@ hash_scan_set (rtx pat, rtx insn, struct
 	     explicitly, it means address of parameter has been taken,
 	     so we should not extend the lifetime of the pseudo.  */
 	  && ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) == 0
-	      || GET_CODE (XEXP (note, 0)) != MEM))
+	      || ! MEM_P (XEXP (note, 0))))
 	{
 	  /* An expression is not anticipatable if its operands are
 	     modified before this insn or if this is not the only SET in
@@ -2124,7 +2123,7 @@ hash_scan_set (rtx pat, rtx insn, struct
       /* Record sets for constant/copy propagation.  */
       else if (table->set_p
 	       && regno >= FIRST_PSEUDO_REGISTER
-	       && ((GET_CODE (src) == REG
+	       && ((REG_P (src)
 		    && REGNO (src) >= FIRST_PSEUDO_REGISTER
 		    && can_copy_p (GET_MODE (dest))
 		    && REGNO (src) != regno)
@@ -2140,7 +2139,7 @@ hash_scan_set (rtx pat, rtx insn, struct
   /* In case of store we want to consider the memory value as available in
      the REG stored in that memory. This makes it possible to remove
      redundant loads from due to stores to the same location.  */
-  else if (flag_gcse_las && GET_CODE (src) == REG && GET_CODE (dest) == MEM)
+  else if (flag_gcse_las && REG_P (src) && MEM_P (dest))
       {
         unsigned int regno = REGNO (src);
 
@@ -2164,7 +2163,7 @@ hash_scan_set (rtx pat, rtx insn, struct
 	      explicitly, it means address of parameter has been taken,
 	      so we should not extend the lifetime of the pseudo.  */
 	   && ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) == 0
-	       || GET_CODE (XEXP (note, 0)) != MEM))
+	       || ! MEM_P (XEXP (note, 0))))
              {
                /* Stores are never anticipatable.  */
                int antic_p = 0;
@@ -2232,13 +2231,13 @@ hash_scan_insn (rtx insn, struct hash_ta
 	  hash_scan_set (x, insn, table);
 	else if (GET_CODE (x) == CLOBBER)
 	  hash_scan_clobber (x, insn, table);
-	else if (GET_CODE (x) == CALL)
+	else if (CALL_P (x))
 	  hash_scan_call (x, insn, table);
       }
 
   else if (GET_CODE (pat) == CLOBBER)
     hash_scan_clobber (pat, insn, table);
-  else if (GET_CODE (pat) == CALL)
+  else if (CALL_P (pat))
     hash_scan_call (pat, insn, table);
 }
 
@@ -2331,7 +2330,7 @@ canon_list_insert (rtx dest ATTRIBUTE_UN
      that function calls are assumed to clobber memory, but are handled
      elsewhere.  */
 
-  if (GET_CODE (dest) != MEM)
+  if (! MEM_P (dest))
     return;
 
   dest_addr = get_addr (XEXP (dest, 0));
@@ -2360,7 +2359,7 @@ record_last_mem_set_info (rtx insn)
   modify_mem_list[bb] = alloc_INSN_LIST (insn, modify_mem_list[bb]);
   bitmap_set_bit (modify_mem_list_set, bb);
 
-  if (GET_CODE (insn) == CALL_INSN)
+  if (CALL_P (insn))
     {
       /* Note that traversals of this loop (other than for free-ing)
 	 will break after encountering a CALL_INSN.  So, there's no
@@ -2385,9 +2384,9 @@ record_last_set_info (rtx dest, rtx sett
   if (GET_CODE (dest) == SUBREG)
     dest = SUBREG_REG (dest);
 
-  if (GET_CODE (dest) == REG)
+  if (REG_P (dest))
     record_last_reg_set_info (last_set_insn, REGNO (dest));
-  else if (GET_CODE (dest) == MEM
+  else if (MEM_P (dest)
 	   /* Ignore pushes, they clobber nothing.  */
 	   && ! push_operand (dest, GET_MODE (dest)))
     record_last_mem_set_info (last_set_insn);
@@ -2446,7 +2445,7 @@ compute_hash_table_work (struct hash_tab
 	  if (! INSN_P (insn))
 	    continue;
 
-	  if (GET_CODE (insn) == CALL_INSN)
+	  if (CALL_P (insn))
 	    {
 	      bool clobbers_all = false;
 #ifdef NON_SAVING_SETJMP
@@ -2741,12 +2740,12 @@ mark_set (rtx pat, rtx insn)
 	 || GET_CODE (dest) == STRICT_LOW_PART)
     dest = XEXP (dest, 0);
 
-  if (GET_CODE (dest) == REG)
+  if (REG_P (dest))
     SET_REGNO_REG_SET (reg_set_bitmap, REGNO (dest));
-  else if (GET_CODE (dest) == MEM)
+  else if (MEM_P (dest))
     record_last_mem_set_info (insn);
 
-  if (GET_CODE (SET_SRC (pat)) == CALL)
+  if (CALL_P (SET_SRC (pat)))
     mark_call (insn);
 }
 
@@ -2760,7 +2759,7 @@ mark_clobber (rtx pat, rtx insn)
   while (GET_CODE (clob) == SUBREG || GET_CODE (clob) == STRICT_LOW_PART)
     clob = XEXP (clob, 0);
 
-  if (GET_CODE (clob) == REG)
+  if (REG_P (clob))
     SET_REGNO_REG_SET (reg_set_bitmap, REGNO (clob));
   else
     record_last_mem_set_info (insn);
@@ -2786,13 +2785,13 @@ mark_oprs_set (rtx insn)
 	  mark_set (x, insn);
 	else if (GET_CODE (x) == CLOBBER)
 	  mark_clobber (x, insn);
-	else if (GET_CODE (x) == CALL)
+	else if (CALL_P (x))
 	  mark_call (insn);
       }
 
   else if (GET_CODE (pat) == CLOBBER)
     mark_clobber (pat, insn);
-  else if (GET_CODE (pat) == CALL)
+  else if (CALL_P (pat))
     mark_call (insn);
 }
 
@@ -2897,7 +2896,7 @@ compute_transp (rtx x, int indx, sbitmap
 	    {
 	      rtx dest, dest_addr;
 
-	      if (GET_CODE (XEXP (list_entry, 0)) == CALL_INSN)
+	      if (CALL_P (XEXP (list_entry, 0)))
 		{
 		  if (set_p)
 		    SET_BIT (bmap[bb->index], indx);
@@ -3156,7 +3155,7 @@ find_avail_set (int regno, rtx insn)
 
       /* If the source of the set is anything except a register, then
 	 we have reached the end of the copy chain.  */
-      if (GET_CODE (src) != REG)
+      if (! REG_P (src))
 	break;
 
       /* Follow the copy chain, ie start another iteration of the loop
@@ -3379,7 +3378,7 @@ cprop_insn (rtx insn, int alter_jumps)
 		return 1;
 	    }
 	}
-      else if (GET_CODE (src) == REG
+      else if (REG_P (src)
 	       && REGNO (src) >= FIRST_PSEUDO_REGISTER
 	       && REGNO (src) != regno)
 	{
@@ -3461,7 +3460,7 @@ do_local_cprop (rtx x, rtx insn, int alt
 
   /* Rule out USE instructions and ASM statements as we don't want to
      change the hard registers mentioned.  */
-  if (GET_CODE (x) == REG
+  if (REG_P (x)
       && (REGNO (x) >= FIRST_PSEUDO_REGISTER
           || (GET_CODE (PATTERN (insn)) != USE
 	      && asm_noperands (PATTERN (insn)) < 0)))
@@ -3488,7 +3487,7 @@ do_local_cprop (rtx x, rtx insn, int alt
 		 explicitly, it means address of parameter has been taken,
 		 so we should not extend the lifetime of the pseudo.  */
 	      && (!(note = find_reg_note (l->setting_insn, REG_EQUIV, NULL_RTX))
-		  || GET_CODE (XEXP (note, 0)) != MEM))
+		  || ! MEM_P (XEXP (note, 0))))
 	    newreg = this_rtx;
 	}
       if (newcnst && constprop_register (insn, x, newcnst, alter_jumps))
@@ -3664,7 +3663,7 @@ cprop (int alter_jumps)
 	    /* Keep track of everything modified by this insn.  */
 	    /* ??? Need to be careful w.r.t. mods done to INSN.  Don't
 	       call mark_oprs_set if we turned the insn into a NOTE.  */
-	    if (GET_CODE (insn) != NOTE)
+	    if (! NOTE_P (insn))
 	      mark_oprs_set (insn);
 	  }
     }
@@ -3791,7 +3790,7 @@ find_implicit_sets (void)
 
 	if (cond
 	    && (GET_CODE (cond) == EQ || GET_CODE (cond) == NE)
-	    && GET_CODE (XEXP (cond, 0)) == REG
+	    && REG_P (XEXP (cond, 0))
 	    && REGNO (XEXP (cond, 0)) >= FIRST_PSEUDO_REGISTER
 	    && implicit_set_cond_p (cond))
 	  {
@@ -3913,7 +3912,7 @@ find_bypass_set (int regno, int bb)
       if (gcse_constant_p (src))
 	result = set;
 
-      if (GET_CODE (src) != REG)
+      if (! REG_P (src))
 	break;
 
       regno = REGNO (src);
@@ -4141,7 +4140,7 @@ bypass_conditional_jumps (void)
 		else
 		  break;
 	      }
-	    else if (GET_CODE (insn) == JUMP_INSN)
+	    else if (JUMP_P (insn))
 	      {
 		if ((any_condjump_p (insn) || computed_jump_p (insn))
 		    && onlyjump_p (insn))
@@ -4427,7 +4426,7 @@ insert_insn_end_bb (struct expr *expr, b
      handle cc0, etc. properly].  Similarly we need to care trapping
      instructions in presence of non-call exceptions.  */
 
-  if (GET_CODE (insn) == JUMP_INSN
+  if (JUMP_P (insn)
       || (GET_CODE (insn) == INSN
 	  && (bb->succ->succ_next || (bb->succ->flags & EDGE_ABNORMAL))))
     {
@@ -4470,7 +4469,7 @@ insert_insn_end_bb (struct expr *expr, b
 
   /* Likewise if the last insn is a call, as will happen in the presence
      of exception handling.  */
-  else if (GET_CODE (insn) == CALL_INSN
+  else if (CALL_P (insn)
 	   && (bb->succ->succ_next || (bb->succ->flags & EDGE_ABNORMAL)))
     {
       /* Keeping in mind SMALL_REGISTER_CLASSES and parameters in registers,
@@ -4500,7 +4499,7 @@ insert_insn_end_bb (struct expr *expr, b
 	 If we inserted before the CODE_LABEL, then we would be putting
 	 the insn in the wrong basic block.  In that case, put the insn
 	 after the CODE_LABEL.  Also, respect NOTE_INSN_BASIC_BLOCK.  */
-      while (GET_CODE (insn) == CODE_LABEL
+      while (LABEL_P (insn)
 	     || NOTE_INSN_BASIC_BLOCK_P (insn))
 	insn = NEXT_INSN (insn);
 
@@ -4663,7 +4662,7 @@ pre_insert_copy_insn (struct expr *expr,
   else
     abort ();
 
-  if (GET_CODE (SET_DEST (set)) == REG)
+  if (REG_P (SET_DEST (set)))
     {
       old_reg = SET_DEST (set);
       /* Check if we can modify the set destination in the original insn.  */
@@ -5050,12 +5049,12 @@ compute_transpout (void)
       /* Note that flow inserted a nop a the end of basic blocks that
 	 end in call instructions for reasons other than abnormal
 	 control flow.  */
-      if (GET_CODE (BB_END (bb)) != CALL_INSN)
+      if (! CALL_P (BB_END (bb)))
 	continue;
 
       for (i = 0; i < expr_hash_table.size; i++)
 	for (expr = expr_hash_table.table[i]; expr ; expr = expr->next_same_hash)
-	  if (GET_CODE (expr->expr) == MEM)
+	  if (MEM_P (expr->expr))
 	    {
 	      if (GET_CODE (XEXP (expr->expr, 0)) == SYMBOL_REF
 		  && CONSTANT_POOL_ADDRESS_P (XEXP (expr->expr, 0)))
@@ -5591,7 +5590,7 @@ next_ls_expr (struct ls_expr * ptr)
 static int
 simple_mem (rtx x)
 {
-  if (GET_CODE (x) != MEM)
+  if (! MEM_P (x))
     return 0;
 
   if (MEM_VOLATILE_P (x))
@@ -5635,7 +5634,7 @@ invalidate_any_buried_refs (rtx x)
   struct ls_expr * ptr;
 
   /* Invalidate it in the list.  */
-  if (GET_CODE (x) == MEM && simple_mem (x))
+  if (MEM_P (x) && simple_mem (x))
     {
       ptr = ldst_entry (x);
       ptr->invalid = 1;
@@ -5685,10 +5684,10 @@ compute_ld_motion_mems (void)
 		  rtx dest = SET_DEST (PATTERN (insn));
 
 		  /* Check for a simple LOAD...  */
-		  if (GET_CODE (src) == MEM && simple_mem (src))
+		  if (MEM_P (src) && simple_mem (src))
 		    {
 		      ptr = ldst_entry (src);
-		      if (GET_CODE (dest) == REG)
+		      if (REG_P (dest))
 			ptr->loads = alloc_INSN_LIST (insn, ptr->loads);
 		      else
 			ptr->invalid = 1;
@@ -5703,11 +5702,11 @@ compute_ld_motion_mems (void)
 		     will block any movement we might do later. We only care
 		     about this exact pattern since those are the only
 		     circumstance that we will ignore the aliasing info.  */
-		  if (GET_CODE (dest) == MEM && simple_mem (dest))
+		  if (MEM_P (dest) && simple_mem (dest))
 		    {
 		      ptr = ldst_entry (dest);
 
-		      if (GET_CODE (src) != MEM
+		      if (! MEM_P (src)
 			  && GET_CODE (src) != ASM_OPERANDS
 			  /* Check for REG manually since want_to_gcse_p
 			     returns 0 for all REGs.  */
@@ -5860,7 +5859,7 @@ reg_set_info (rtx dest, rtx setter ATTRI
   if (GET_CODE (dest) == SUBREG)
     dest = SUBREG_REG (dest);
 
-  if (GET_CODE (dest) == REG)
+  if (REG_P (dest))
     {
       regvec[REGNO (dest)] = INSN_UID (compute_store_table_current_insn);
       if (bb_reg)
@@ -5880,7 +5879,7 @@ reg_clear_last_set (rtx dest, rtx setter
   if (GET_CODE (dest) == SUBREG)
     dest = SUBREG_REG (dest);
 
-  if (GET_CODE (dest) == REG &&
+  if (REG_P (dest) &&
       dead_vec[REGNO (dest)] == INSN_UID (compute_store_table_current_insn))
     dead_vec[REGNO (dest)] = 0;
 }
@@ -6025,7 +6024,7 @@ find_moveable_store (rtx insn, int *regs
 
   dest = SET_DEST (set);
 
-  if (GET_CODE (dest) != MEM || MEM_VOLATILE_P (dest)
+  if (! MEM_P (dest) || MEM_VOLATILE_P (dest)
       || GET_MODE (dest) == BLKmode)
     return;
 
@@ -6137,7 +6136,7 @@ compute_store_table (void)
 	  if (! INSN_P (insn))
 	    continue;
 
-	  if (GET_CODE (insn) == CALL_INSN)
+	  if (CALL_P (insn))
 	    {
 	      bool clobbers_all = false;
 #ifdef NON_SAVING_SETJMP
@@ -6170,7 +6169,7 @@ compute_store_table (void)
 	  if (! INSN_P (insn))
 	    continue;
 
-	  if (GET_CODE (insn) == CALL_INSN)
+	  if (CALL_P (insn))
 	    {
 	      bool clobbers_all = false;
 #ifdef NON_SAVING_SETJMP
@@ -6194,7 +6193,7 @@ compute_store_table (void)
 	  /* Unmark regs that are no longer set.  */
 	  compute_store_table_current_insn = insn;
 	  note_stores (pat, reg_clear_last_set, last_set_in);
-	  if (GET_CODE (insn) == CALL_INSN)
+	  if (CALL_P (insn))
 	    {
 	      bool clobbers_all = false;
 #ifdef NON_SAVING_SETJMP
@@ -6288,7 +6287,7 @@ find_loads (rtx x, rtx store_pattern, in
   if (GET_CODE (x) == SET)
     x = SET_SRC (x);
 
-  if (GET_CODE (x) == MEM)
+  if (MEM_P (x))
     {
       if (load_kills_store (x, store_pattern, after))
 	return true;
@@ -6320,7 +6319,7 @@ store_killed_in_insn (rtx x, rtx x_regs,
   if (!INSN_P (insn))
     return false;
 
-  if (GET_CODE (insn) == CALL_INSN)
+  if (CALL_P (insn))
     {
       /* A normal or pure call might read from pattern,
 	 but a const call will not.  */
@@ -6352,7 +6351,7 @@ store_killed_in_insn (rtx x, rtx x_regs,
 	dest = XEXP (dest, 0);
 
       /* Check for memory stores to aliased objects.  */
-      if (GET_CODE (dest) == MEM
+      if (MEM_P (dest)
 	  && !expr_equiv_p (dest, x))
 	{
 	  if (after)
@@ -6537,8 +6536,8 @@ insert_insn_start_bb (rtx insn, basic_bl
   rtx before = BB_HEAD (bb);
   while (before != 0)
     {
-      if (GET_CODE (before) != CODE_LABEL
-	  && (GET_CODE (before) != NOTE
+      if (! LABEL_P (before)
+	  && (! NOTE_P (before)
 	      || NOTE_LINE_NUMBER (before) != NOTE_INSN_BASIC_BLOCK))
 	break;
       prev = before;
@@ -7030,7 +7029,7 @@ reg_set_between_after_reload_p (rtx reg,
   rtx insn;
   int regno;
 
-  if (GET_CODE (reg) != REG)
+  if (! REG_P (reg))
     abort ();
   regno = REGNO (reg);
 
@@ -7048,7 +7047,7 @@ reg_set_between_after_reload_p (rtx reg,
       if (INSN_P (insn))
 	{
 	  if (FIND_REG_INC_NOTE (insn, reg)
-	      || (GET_CODE (insn) == CALL_INSN
+	      || (CALL_P (insn)
 		  && call_used_regs[regno])
 	      || find_reg_fusage (insn, CLOBBER, reg))
 	    return insn;
@@ -7069,7 +7068,7 @@ reg_used_between_after_reload_p (rtx reg
   rtx insn;
   int regno;
 
-  if (GET_CODE (reg) != REG)
+  if (! REG_P (reg))
     return to_insn;
   regno = REGNO (reg);
 
@@ -7084,7 +7083,7 @@ reg_used_between_after_reload_p (rtx reg
        insn = NEXT_INSN (insn))
     if (INSN_P (insn)
 	&& (reg_overlap_mentioned_p (reg, PATTERN (insn))
-	    || (GET_CODE (insn) == CALL_INSN
+	    || (CALL_P (insn)
 		&& call_used_regs[regno])
 	    || find_reg_fusage (insn, USE, reg)
 	    || find_reg_fusage (insn, CLOBBER, reg)))
@@ -7097,9 +7096,9 @@ reg_used_between_after_reload_p (rtx reg
 static rtx
 get_avail_load_store_reg (rtx insn)
 {
-  if (GET_CODE (SET_DEST (PATTERN (insn))) == REG)  /* A load.  */
+  if (REG_P (SET_DEST (PATTERN (insn))))  /* A load.  */
     return SET_DEST(PATTERN(insn));
-  if (GET_CODE (SET_SRC (PATTERN (insn))) == REG)  /* A store.  */
+  if (REG_P (SET_SRC (PATTERN (insn))))  /* A store.  */
     return SET_SRC (PATTERN (insn));
   abort ();
 }
@@ -7111,9 +7110,7 @@ is_jump_table_basic_block (basic_block b
 {
   rtx insn = BB_END (bb);
 
-  if (GET_CODE (insn) == JUMP_INSN &&
-      (GET_CODE (PATTERN (insn)) == ADDR_VEC
-       || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC))
+  if (JUMP_TABLE_DATA_P (insn))
     return true;
   return false;
 }
@@ -7380,8 +7377,8 @@ gcse_after_reload (void)
 	  /* Is it a load - of the form (set (reg) (mem))?  */
 	  if (GET_CODE (insn) == INSN
               && GET_CODE (PATTERN (insn)) == SET
-	      && GET_CODE (SET_DEST (PATTERN (insn))) == REG
-	      && GET_CODE (SET_SRC (PATTERN (insn))) == MEM)
+	      && REG_P (SET_DEST (PATTERN (insn)))
+	      && MEM_P (SET_SRC (PATTERN (insn))))
 	    {
 	      rtx pat = PATTERN (insn);
 	      rtx src = SET_SRC (pat);
@@ -7435,10 +7432,10 @@ hash_scan_set_after_reload (rtx pat, rtx
   rtx src = SET_SRC (pat);
   rtx dest = SET_DEST (pat);
 
-  if (GET_CODE (src) != MEM && GET_CODE (dest) != MEM)
+  if (! MEM_P (src) && ! MEM_P (dest))
     return;
 
-  if (GET_CODE (dest) == REG)
+  if (REG_P (dest))
     {
       if (/* Don't GCSE something if we can't do a reg/reg copy.  */
 	  can_copy_p (GET_MODE (dest))
@@ -7458,7 +7455,7 @@ hash_scan_set_after_reload (rtx pat, rtx
 	    insert_expr_in_table (src, GET_MODE (dest), insn, 0, 1, table);
 	}
     }
-  else if ((GET_CODE (src) == REG))
+  else if (REG_P (src))
     {
       /* Only record sets of pseudo-regs in the hash table.  */
       if (/* Don't GCSE something if we can't do a reg/reg copy.  */
@@ -7528,7 +7525,7 @@ compute_hash_table_after_reload (struct 
 	  if (! INSN_P (insn))
 	    continue;
 
-	  if (GET_CODE (insn) == CALL_INSN)
+	  if (CALL_P (insn))
 	    {
 	      bool clobbers_all = false;
 
@@ -7555,12 +7552,12 @@ compute_hash_table_after_reload (struct 
 
 		src = SET_SRC (PATTERN (insn));
 		dest = SET_DEST (PATTERN (insn));
-		if (GET_CODE (src) == MEM && auto_inc_p (XEXP (src, 0)))
+		if (MEM_P (src) && auto_inc_p (XEXP (src, 0)))
 		  {
 		    regno = REGNO (XEXP (XEXP (src, 0), 0));
 		    record_last_reg_set_info (insn, regno);
 		  }
-		if (GET_CODE (dest) == MEM && auto_inc_p (XEXP (dest, 0)))
+		if (MEM_P (dest) && auto_inc_p (XEXP (dest, 0)))
 		  {
 		    regno = REGNO (XEXP (XEXP (dest, 0), 0));
 		    record_last_reg_set_info (insn, regno);

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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