Minor SSA cleanups

law@redhat.com law@redhat.com
Wed Jun 20 06:15:00 GMT 2001


  In message < 871yof95z9.fsf@cgsoftware.com >you write:
  > Jeffrey A Law <law@localhost.localdomain> writes:
  > 
  > > We want remove_phi_alternative to have external scope so that SSA optimiz
  > ers
  > > which remove unexecutable edges can also remove phi alternatives.  
  > Weird.
  > You seem to be doing exactly the same patches I did.
  > 
  > I also global scoped phi_alternative.
  > 
  > The other change to ssa.c I have is:
  > 
  > *************** mark_phi_and_copy_regs (phi_set)
  > *** 1959,1964 ****
  > --- 1995,2002 ----
  >         if (insn == NULL)
  >           continue;
  >         pattern = PATTERN (insn);
  > +       if (!pattern)
  > +         continue;
  >         /* Sometimes we get PARALLEL insns.  These aren't phi nodes or
  >            copies.  */
  >         if (GET_CODE (pattern) != SET)
I don't think you want/need this.  This should be caught further upstream.

  > Since the SSA definition array isn't kept in sync after each pass, if
  > you've removed a register, the insn in the ssa_defs isn't necessarily
  > an INSN anymore.  But it won't be NULL. It could be a deleted NOTE or
  > something weird.
It should be a NOTE_INSN_DELETED.  Anything else indicates a bug elsewhere.


  > > We're
  > > also going to be changing the PHI nodes to record block pointers rather
  > > than block indices (but that'll be a separate patch).
  > 
  > Why *do* we have block indices or pointers at all there?
  > They seem unecessary, especially given that a register can only have
  > one def. So to figure out what block it came from, ....
It's significantly simpler to just record where it came from when you
generate the PHI node.

jeff



More information about the Gcc-patches mailing list