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]

try_combine tweek


Previously combine would allow you to add a define_split that
split 3 insns into 2 in some target-dependant way.  The following
allows 3 to be split into 1, assuming that the new form will
make it easier to make additional combinations than the old form.

I use this on ia64 like so:

(define_split
  [(set (match_operand:BI 0 "register_operand" "")
        (ne:BI (ior:DI (ne:DI (match_operand:BI 2 "register_operand" "")
                              (const_int 0))
                       (match_operand:DI 3 "register_operand" ""))
               (const_int 0)))]
  ""
  [(set (match_dup 0) 
        (ior:BI (ne:BI (match_dup 3) (const_int 0))
                (match_dup 2)))]
  "")

to turn DImode arithmetic into BImode arithmetic in a fashion
that I couldn't convince myself was genericly applicable and
would thus warrent canonicalization by combine itself.


r~


        * combine.c (try_combine): Allow split to create a single insn.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/combine.c,v
retrieving revision 1.151
diff -c -p -d -r1.151 combine.c
*** combine.c	2000/09/18 17:55:37	1.151
--- combine.c	2000/09/18 18:06:13
*************** try_combine (i3, i2, i1, new_direct_jump
*** 2107,2118 ****
  				 i3);
  	}
  
!       if (m_split && GET_CODE (m_split) == SEQUENCE
! 	  && XVECLEN (m_split, 0) == 2
! 	  && (next_real_insn (i2) == i3
! 	      || ! use_crosses_set_p (PATTERN (XVECEXP (m_split, 0, 0)),
! 				      INSN_CUID (i2))))
  	{
  	  rtx i2set, i3set;
  	  rtx newi3pat = PATTERN (XVECEXP (m_split, 0, 1));
  	  newi2pat = PATTERN (XVECEXP (m_split, 0, 0));
--- 2107,2124 ----
  				 i3);
  	}
  
!       if (m_split && GET_CODE (m_split) != SEQUENCE)
  	{
+ 	  insn_code_number = recog_for_combine (&m_split, i3, &new_i3_notes);
+ 	  if (insn_code_number >= 0)
+ 	    newpat = m_split;
+ 	} 
+       else if (m_split && GET_CODE (m_split) == SEQUENCE
+ 	       && XVECLEN (m_split, 0) == 2
+ 	       && (next_real_insn (i2) == i3
+ 		   || ! use_crosses_set_p (PATTERN (XVECEXP (m_split, 0, 0)),
+ 					   INSN_CUID (i2))))
+ 	{
  	  rtx i2set, i3set;
  	  rtx newi3pat = PATTERN (XVECEXP (m_split, 0, 1));
  	  newi2pat = PATTERN (XVECEXP (m_split, 0, 0));

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