[PATCH] df memory saving

Richard Henderson rth@redhat.com
Wed Jan 29 01:08:00 GMT 2003


On Wed, Jan 29, 2003 at 12:45:20PM +1300, Michael Hayes wrote:
> *************** Software Foundation, 59 Temple Place - S
> *** 32,41 ****
>   #define DF_HARD_REGS  1024	/* Mark hard registers.  */
>   #define DF_EQUIV_NOTES 2048	/* Mark uses present in EQUIV/EQUAL notes.  */
>   
> - enum df_ref_type {DF_REF_REG_DEF, DF_REF_REG_USE, DF_REF_REG_MEM_LOAD,
> - 		  DF_REF_REG_MEM_STORE};
> - 
> - #define DF_REF_TYPE_NAMES {"def", "use", "mem load", "mem store"}
>   
>   /* Link on a def-use or use-def chain.  */
>   struct df_link
> --- 38,43 ----
> *************** struct df_link
> *** 44,55 ****
>     struct ref *ref;
>   };
>   
> ! enum df_ref_flags
>     {
>       /* Read-modify-write refs generate both a use and a def and
>          these are marked with this flag to show that they are not
>          independent.  */
> !     DF_REF_READ_WRITE = 1,
>       
>       /* This flag is set on register references inside a subreg on
>          machines which have CLASS_CANNOT_CHANGE_MODE and where the mode
> --- 46,73 ----
>     struct ref *ref;
>   };
>   
> ! 
> ! #define DF_REF_TYPE_NAMES {"def", "use", "mem-load", "mem-store", \
> !     "read/write", "mode-change"}
> ! 
> ! enum df_ref_type
>     {
> +       /* Register def.  */
> +       DF_REF_REG_DEF = 1,
> + 
> +       /* Register use.  Either this or DF_REG_REF_DEF must be set.  */
> +       DF_REF_REG_USE = 2,
> + 
> +       /* Indicates that register used in address of a memory load.  */
> +       DF_REF_REG_MEM_LOAD = 4,
> + 
> +       /* Indicates that register used in address of a memory store.  */
> +       DF_REF_REG_MEM_STORE = 8,
> + 
>       /* Read-modify-write refs generate both a use and a def and
>          these are marked with this flag to show that they are not
>          independent.  */
> !       DF_REF_READ_WRITE = 16,
>       
>       /* This flag is set on register references inside a subreg on
>          machines which have CLASS_CANNOT_CHANGE_MODE and where the mode
> *************** enum df_ref_flags
> *** 58,66 ****
>          the REG itself (i.e., one might not see the subreg anyore).
>          Also note, that this flag is set also for hardreg refs, i.e.,
>          you must check yourself if it's a pseudo.  */
> !     DF_REF_MODE_CHANGE = 2
>     };
>   
>   
>   /* Define a register reference structure.  One of these is allocated
>      for every register reference (use or def).  Note some register
> --- 76,87 ----
>          the REG itself (i.e., one might not see the subreg anyore).
>          Also note, that this flag is set also for hardreg refs, i.e.,
>          you must check yourself if it's a pseudo.  */
> !       DF_REF_MODE_CHANGE = 32
>     };
>   
> + /* This should go shortly...  */
> + #define df_ref_flags df_ref_type
> + 
>   
>   /* Define a register reference structure.  One of these is allocated
>      for every register reference (use or def).  Note some register
> *************** struct ref
> *** 73,79 ****
>     struct df_link *chain;	/* Head of def-use or use-def chain.  */
>     unsigned int id;		/* Ref index.  */
>     enum df_ref_type type;	/* Type of ref.  */
> -   enum df_ref_flags flags;	/* Various flags.  */

Why not use bit fields instead?

Especially for the df_ref_flags things.  Seems like a 
one bit field would be cleaner than having an int field
to be manipulated with masks...


r~



More information about the Gcc-patches mailing list