aboutsummaryrefslogtreecommitdiff
path: root/gcc/df.h
diff options
context:
space:
mode:
authorKenneth Zadeck <zadeck@gcc.gnu.org>2008-03-06 00:21:34 +0000
committerKenneth Zadeck <zadeck@gcc.gnu.org>2008-03-06 00:21:34 +0000
commitca9052ce17c72129b59e1e17d790a3e08737f82e (patch)
tree81a4fa5e0fbdeae7d436872de34208dd812b0bd9 /gcc/df.h
parent256fe3d795af429bc68d6f9d94c6c3e871a69736 (diff)
downloadgcc-ca9052ce17c72129b59e1e17d790a3e08737f82e.zip
gcc-ca9052ce17c72129b59e1e17d790a3e08737f82e.tar.gz
gcc-ca9052ce17c72129b59e1e17d790a3e08737f82e.tar.bz2
fwprop.c (update_df): Support width and offset parameters of df_ref_create.
2008-03-05 Kenneth Zadeck <zadeck@naturalbridge.com> * fwprop.c (update_df): Support width and offset parameters of df_ref_create. * ra-conflict.c (mark_reg_store, clear_reg_in_live, global_conflicts): Change DF_REF_EXTRACT to either DF_REF_ZERO_EXTRACT or DF_REF_SIGN_EXTRACT. Change DF_REF_STRICT_LOWER_PART to DF_REF_STRICT_LOW_PART. * df-scan.c (df_ref_record, df_defs_record, df_ref_create_structure, df_def_record_1, df_uses_record, df_get_conditional_uses, df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect, df_entry_block_defs_collect, df_exit_block_uses_collect): Support new width and offset fields. (ref_extract_pool): New storage pool. (df_free_ref): New function. (df_reg_chain_unlink, df_free_collection_rec, df_sort_and_compress_refs): Call df_free_ref. (df_ref_equal_p, df_ref_compare): Compare offset and width fields of df_ref_extract. (df_ref_create_structure): Allocate df_ref_extract if offset and width fields are used. (df_def_record_1): Get offset and width from ZERO_EXTRACT. (df_uses_record): Get offset and width from ZERO_EXTRACT and SIGN_EXTRACT. * global.c (build_insn_chain): Change DF_REF_EXTRACT to either DF_REF_ZERO_EXTRACT or DF_REF_SIGN_EXTRACT. Change DF_REF_STRICT_LOWER_PART to DF_REF_STRICT_LOW_PART. * df.h (df_ref_flags): Change DF_REF_EXTRACT to either DF_REF_ZERO_EXTRACT or DF_REF_SIGN_EXTRACT. Change DF_REF_STRICT_LOWER_PART to DF_REF_STRICT_LOW_PART. (df_ref_extract): New structure. (DF_REF_WIDTH, DF_REF_OFFSET): New macros. (df_ref_create): Add width and offset parameters. From-SVN: r132962
Diffstat (limited to 'gcc/df.h')
-rw-r--r--gcc/df.h41
1 files changed, 32 insertions, 9 deletions
diff --git a/gcc/df.h b/gcc/df.h
index 7c14f16..cf113ae 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -117,14 +117,18 @@ enum df_ref_flags
DF_REF_MUST_CLOBBER = 1 << 7,
- /* This flag is set if this ref is inside a pre/post modify. */
- DF_REF_PRE_POST_MODIFY = 1 << 8,
+ /* If the ref has one of the following two flags set, then the
+ struct df_ref can be cast to struct df_ref_extract to access
+ the width and offset fields. */
+
+ /* This flag is set if the ref contains a SIGN_EXTRACT. */
+ DF_REF_SIGN_EXTRACT = 1 << 8,
- /* This flag is set if the ref contains a ZERO_EXTRACT or SIGN_EXTRACT. */
- DF_REF_EXTRACT = 1 << 9,
+ /* This flag is set if the ref contains a ZERO_EXTRACT. */
+ DF_REF_ZERO_EXTRACT = 1 << 9,
- /* This flag is set if the ref contains a STRICT_LOWER_PART. */
- DF_REF_STRICT_LOWER_PART = 1 << 10,
+ /* This flag is set if the ref contains a STRICT_LOW_PART. */
+ DF_REF_STRICT_LOW_PART = 1 << 10,
/* This flag is set if the ref contains a SUBREG. */
DF_REF_SUBREG = 1 << 11,
@@ -138,7 +142,11 @@ enum df_ref_flags
DF_REF_CALL_STACK_USAGE = 1 << 13,
/* This flag is used for verification of existing refs. */
- DF_REF_REG_MARKER = 1 << 14
+ DF_REF_REG_MARKER = 1 << 14,
+
+ /* This flag is set if this ref is inside a pre/post modify. */
+ DF_REF_PRE_POST_MODIFY = 1 << 15
+
};
/* The possible ordering of refs within the df_ref_info. */
@@ -381,6 +389,17 @@ struct df_ref
struct df_ref *prev_reg; /* Prev ref with same regno and type. */
};
+/* 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_ref_extract
+{
+ struct df_ref ref;
+ int width;
+ int offset;
+};
+
/* These links are used for two purposes:
1) def-use or use-def chains.
2) Multiword hard registers that underly a single hardware register. */
@@ -598,7 +617,10 @@ struct df
#define DF_REF_IS_REG_MARKED(REF) (DF_REF_FLAGS_IS_SET ((REF),DF_REF_REG_MARKER))
#define DF_REF_NEXT_REG(REF) ((REF)->next_reg)
#define DF_REF_PREV_REG(REF) ((REF)->prev_reg)
-
+/* The following two macros may only be applied if one of
+ DF_REF_SIGN_EXTRACT | DF_REF_ZERO_EXTRACT is true. */
+#define DF_REF_WIDTH(REF) (((struct df_ref_extract *)(REF))->width)
+#define DF_REF_OFFSET(REF) (((struct df_ref_extract *)(REF))->offset)
/* Macros to determine the reference type. */
#define DF_REF_REG_DEF_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_DEF)
@@ -862,7 +884,8 @@ extern void df_grow_reg_info (void);
extern void df_grow_insn_info (void);
extern void df_scan_blocks (void);
extern struct df_ref *df_ref_create (rtx, rtx *, rtx,basic_block,
- enum df_ref_type, enum df_ref_flags);
+ enum df_ref_type, enum df_ref_flags,
+ int, int);
extern void df_ref_remove (struct df_ref *);
extern struct df_insn_info * df_insn_create_insn_record (rtx);
extern void df_insn_delete (basic_block, unsigned int);