PATCH: register coalescing in SSA

Richard Henderson rth@cygnus.com
Thu Apr 6 23:50:00 GMT 2000


On Thu, Apr 06, 2000 at 10:50:18PM -0700, Alex Samuel wrote:
> I did this because rtl.h is included before basic-block.h.  However,
> it seems sensible to move declarations of ssa.c functions to the
> latter.  Yes?

Yes.

> If I recall correctly, there were cases in which the next call to
> find_basic_blocks numbered the blocks differently.

Yes, this will happen.  If dead code elimination removes all insns
in a basic block that does not begin with a code label, the next
find_basic_blocks will eliminate the block.

What can I say?  Don't call find_basic_blocks if you want the CFG
structure to remain unchanged.  Anyway, you shouldn't have to if
you're preserving the structure in the optimization phases.

Probably the best thing to do is to adjust the definition of PHI
to incorporate the basic_block pointers instead of their indices.
That will keep you isolated from such changes. 

I'm not sure the best way to do this that preserves the ability to
use rtx_format without hackery... perhaps to split the incoming
regs and blocks into two vectors like so:

  DEF_RTL_EXPR (PHI, "phi", "E0", 'x')

  #define PHI_REG_N(RTX,N)	XCVECEXP ((RTX), 0, (N), PHI)
  #define PHI_BLOCK_N(RTX,N)	X0VEC ((RTX), 1)...

... er, I see rtvec_def now contains only an rtx_def instead
of the rtunion that used to be there.  Bother.  But anyway, 
something along those lines.



r~


More information about the Gcc-patches mailing list