This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Antwort: patch to shrink the size of df_refs.


gcc-patches-owner@gcc.gnu.org schrieb am 25.09.2008 02:10:12:

> This patch makes a modest reduction in the size of df_refs.   It does

Is this worth the complication ?

To my untrained eye, the only savings is putting the bb pointer
(in df_artificial_ref) at the same place as the rtx pointer
(in df_regular_ref and df_extract_ref).

> There is one followup to this patch that needs to be done by someone
> qualified (hint honza).
> It may be possible to reduce the size of the df_ref further by
> reordering the fields and changing the regno and id fields to be
> integers that are never larger than 32 bits, even on a 64 bit machine.

This sounds possible independent of your change. Also, any of the two
numbers could be placed adjacent to the 32 bits of bitfields, if I counted
correctly.

Sorry to intrude,
      Markus Milleder


> +struct df_base_ref
> +{
> +  /* These three bitfields are intentionally oversized, in the hope that
> +     accesses to 8 and 16-bit fields will usually be quicker.  */
> +  ENUM_BITFIELD(df_ref_class) cl : 8;
>
> +  ENUM_BITFIELD(df_ref_type) type : 8;
> +            /* Type of ref.  */
> +  ENUM_BITFIELD(df_ref_flags) flags : 16;
> +            /* Various flags.  */
> +  rtx reg;         /* The register referenced.  */
>    struct df_link *chain;   /* Head of def-use, use-def.  */
> +  /* Pointer to the insn info of the containing instruction.  FIXME!
> +     Currently this is NULL for artificial refs but this will be used
> +     when FUDs are added.  */
> +  struct df_insn_info *insn_info;
> +  /* For each regno, there are three chains of refs, one for the uses,
> +     the eq_uses and the defs.  These chains go thru the refs
> +     themselves rather than using an external structure.  */
> +  union df_ref_d *next_reg;     /* Next ref with same regno and type.  */
> +  union df_ref_d *prev_reg;     /* Prev ref with same regno and type.  */
> +  unsigned int regno;      /* The register number referenced.  */
>    /* Location in the ref table.  This is only valid after a call to
>       df_maybe_reorganize_[use,def]_refs which is an expensive operation.  */
>    int id;
>    /* The index at which the operand was scanned in the insn.  This is
>       used to totally order the refs in an insn.  */
>    unsigned int ref_order;
> +};
>
> +struct df_artificial_ref
> +{
> +  struct df_base_ref base;
> +
> +  /* Artificial refs do not have an insn, so to get the basic block,
> +     it must be explicitly here.  */
> +  basic_block bb;
>  };
>
> +
> +struct df_regular_ref
> +{
> +  struct df_base_ref base;
> +  /* The loc is the address in the insn of the reg.  This is not
> +     defined for special registers, such as clobbers and stack
> +     pointers that are also associated with call insns and so those
> +     just use the base.  */
> +  rtx *loc;
> +};
> +
> +
>  /* A df_ref_extract is just a df_ref with a width and offset field at
>     the end of it.  It is used to hold this information if the ref was
>     wrapped by a SIGN_EXTRACT or a ZERO_EXTRACT and to pass this info
>     to passes that wish to process partial regs precisely.  */
> +struct df_extract_ref
>  {
> +  struct df_regular_ref base;
>    int width;
>    int offset;
>    enum machine_mode mode;
>  };
>
> +/* Union of the different kinds of defs/uses placeholders.  */
> +union df_ref_d
> +{
> +  struct df_base_ref base;
> +  struct df_regular_ref regular_ref;
> +  struct df_artificial_ref artificial_ref;
> +  struct df_extract_ref extract_ref;
> +};




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]