[4.5] Doloop improvement patches, 1/7

Steven Bosscher stevenb.gcc@gmail.com
Sun Mar 8 23:19:00 GMT 2009


[ 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?

Gr.
Steven



More information about the Gcc-patches mailing list