[4.5] Doloop improvement patches, 1/7
Zdenek Dvorak
rakdver@kam.mff.cuni.cz
Mon Mar 9 22:31:00 GMT 2009
Hi,
> [ xf. http://gcc.gnu.org/ml/gcc-patches/2009-03/msg00320.html
> Suggestions to do this better in gmail welcome... ]
>
> Bernd Schmidt wrote:
> > + CLEAR_REG_SET (this_altered);
> > + note_stores (PATTERN (insn), mark_altered, this_altered);
> > + if (CALL_P (insn))
> > + {
> > + int i;
> > +
> > + /* Kill all call clobbered registers. */
> > + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> > + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
> > + SET_REGNO_REG_SET (this_altered, i);
> > + }
>
> Why not use DF_INSN_DEFs here?
>
> HmmmOK, so this code was there before. IIUC this could be written as:
>
> df_ref *def_rec;
> for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++)
> SET_REGNO_REG_SET (this_altered, DF_REF_REGNO (*def_rec);
>
> and mark_altered() (and the note_stores() call, and the loop over call
> clobbered regs) could go away.
>
> Maybe mark this with a FIXME?
if the proposed change works (which it should), doing it is a good idea;
marking it with FIXME (and consequently keeping it there forever, as
nobody ever does anything about FIXMEs) does not seem like the right
approach,
Zdenek
More information about the Gcc-patches
mailing list