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]

[PATCH] Remove scan_one_insn splitter


This removes the obsolete (or impossible to trigger) optimization talked
about here:
http://gcc.gnu.org/ml/gcc/2004-03/msg01618.html

with backup from Joern here:
http://gcc.gnu.org/ml/gcc/2004-03/msg01711.html

I'm positive this never happens. I've tried constructing testcases with
various ports and can't trigger it.

If anyone else can I'd be more than happy to rethink it.

OK?

-eric

-- 
Eric Christopher <echristo@redhat.com>

2004-05-04  Eric Christopher  <echristo@redhat.com>

	* regclass.c (scan_one_insn): Remove splitting of
	two address insns.

Index: regclass.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regclass.c,v
retrieving revision 1.186
diff -u -p -w -r1.186 regclass.c
--- regclass.c	3 Mar 2004 08:34:33 -0000	1.186
+++ regclass.c	5 May 2004 03:46:49 -0000
@@ -1006,7 +1006,7 @@ record_operand_costs (rtx insn, struct c
    there.  */
 
 static rtx
-scan_one_insn (rtx insn, int pass)
+scan_one_insn (rtx insn, int pass ATTRIBUTE_UNUSED)
 {
   enum rtx_code pat_code;
   rtx set, note;
@@ -1044,68 +1044,6 @@ scan_one_insn (rtx insn, int pass)
       record_address_regs (XEXP (SET_SRC (set), 0),
 			   MODE_BASE_REG_CLASS (VOIDmode), frequency * 2);
       return insn;
-    }
-
-  /* Improve handling of two-address insns such as
-     (set X (ashift CONST Y)) where CONST must be made to
-     match X. Change it into two insns: (set X CONST)
-     (set X (ashift X Y)).  If we left this for reloading, it
-     would probably get three insns because X and Y might go
-     in the same place. This prevents X and Y from receiving
-     the same hard reg.
-
-     We can only do this if the modes of operands 0 and 1
-     (which might not be the same) are tieable and we only need
-     do this during our first pass.  */
-
-  if (pass == 0 && optimize
-      && recog_data.n_operands >= 3
-      && recog_data.constraints[1][0] == '0'
-      && recog_data.constraints[1][1] == 0
-      && CONSTANT_P (recog_data.operand[1])
-      && ! rtx_equal_p (recog_data.operand[0], recog_data.operand[1])
-      && ! rtx_equal_p (recog_data.operand[0], recog_data.operand[2])
-      && GET_CODE (recog_data.operand[0]) == REG
-      && MODES_TIEABLE_P (GET_MODE (recog_data.operand[0]),
-			  recog_data.operand_mode[1]))
-    {
-      rtx previnsn = prev_real_insn (insn);
-      rtx dest
-	= gen_lowpart (recog_data.operand_mode[1],
-		       recog_data.operand[0]);
-      rtx newinsn
-	= emit_insn_before (gen_move_insn (dest, recog_data.operand[1]),
insn);
-
-      /* If this insn was the start of a basic block,
-	 include the new insn in that block.
-	 We need not check for code_label here;
-	 while a basic block can start with a code_label,
-	 INSN could not be at the beginning of that block.  */
-      if (previnsn == 0 || GET_CODE (previnsn) == JUMP_INSN)
-	{
-	  basic_block b;
-	  FOR_EACH_BB (b)
-	    if (insn == BB_HEAD (b))
-	      BB_HEAD (b) = newinsn;
-	}
-
-      /* This makes one more setting of new insns's dest.  */
-      REG_N_SETS (REGNO (recog_data.operand[0]))++;
-      REG_N_REFS (REGNO (recog_data.operand[0]))++;
-      REG_FREQ (REGNO (recog_data.operand[0])) += frequency;
-
-      *recog_data.operand_loc[1] = recog_data.operand[0];
-      REG_N_REFS (REGNO (recog_data.operand[0]))++;
-      REG_FREQ (REGNO (recog_data.operand[0])) += frequency;
-      for (i = recog_data.n_dups - 1; i >= 0; i--)
-	if (recog_data.dup_num[i] == 1)
-	  {
-	    *recog_data.dup_loc[i] = recog_data.operand[0];
-	    REG_N_REFS (REGNO (recog_data.operand[0]))++;
-	    REG_FREQ (REGNO (recog_data.operand[0])) += frequency;
-	  }
-
-      return PREV_INSN (newinsn);
     }
 
   record_operand_costs (insn, op_costs, reg_pref);



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