SH: cmpeqdi splitter messes up the CFG

Jeffrey A Law law@cygnus.com
Tue Aug 29 15:52:00 GMT 2000


  In message < or1yz8zbgj.fsf@guarana.lsd.ic.unicamp.br >you write:
  > --=-=-=
  > 
  > A define_split shouldn't be emitting jumps and labels.  It messes up
  > the CFG and the BB structure too late in the compilation process.
  > Moreover, since this particular splitter is only applied after jump
  > optimization (why?  couldn't we use subregs to avoid the condition?),
  > the JUMP_LABEL of its jump_insn is NULL, which breaks
  > insn_current_reference_address().
  > 
  > Here's an alternate implementation of the same idea.  Ok to install?
  > 
  > 
  > --=-=-=
  > Content-Type: text/x-patch
  > Content-Disposition: inline; filename=sh-cmpeqdi.patch
  > 
  > Index: gcc/ChangeLog
  > from  Alexandre Oliva  <aoliva@redhat.com>
  > 
  > 	* config/sh/sh.md (cmpeqsi_ior_t, cmpeqsi_and_t): New insns.
  > 	(cmpeqdi_t splitter): Use cmpeqsi_and_t instead of emitting jumps
  > 	and labels.
  > 
  > Index: gcc/config/sh/sh.md
  > ===================================================================
  > RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.md,v
  > retrieving revision 1.40
  > diff -u -p -r1.40 sh.md
  > --- gcc/config/sh/sh.md	2000/08/22 19:39:56	1.40
  > +++ gcc/config/sh/sh.md	2000/08/29 08:54:12
  > @@ -558,6 +558,30 @@
  >  	cmp/eq	%1,%0
  >  	cmp/eq	%1,%0")
  >  
  > +(define_insn "cmpeqsi_ior_t"
  > +  [(set (reg:SI 18)
  > +	(ior:SI (reg:SI 18)
  > +		(eq:SI (match_operand:SI 0 "arith_reg_operand" "r,z,r")
  > +		       (match_operand:SI 1 "arith_operand" "N,rI,r"))))]
  > +  ""
  > +  "@
  > +	bt 0f\;tst	%0,%0\;0:
  > +	bt 0f\;cmp/eq	%1,%0\;0:
  > +	bt 0f\;cmp/eq	%1,%0\;0:"
  > +  [(set_attr "length" "4")])
I'd recommend against using gas specific extensions like the forward/backward
labels.  Just cons up a label in the output pattern.  I believe there's
predefined output modifiers to do this.

I don't see where/how the cmpeqsi_ior_t pattern is used.  When/where/how is
this pattern used.

jeff



More information about the Gcc-patches mailing list