aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-flow.h
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2005-06-07 14:01:47 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2005-06-07 12:01:47 +0000
commitac1826887e12c3e8ea95414455f882838a518d11 (patch)
tree378327f436c131f3eecc7128a199fdc378d9aa28 /gcc/tree-flow.h
parent01ea1ea8269ff36065e625b0b5e348568519bfa3 (diff)
downloadgcc-ac1826887e12c3e8ea95414455f882838a518d11.zip
gcc-ac1826887e12c3e8ea95414455f882838a518d11.tar.gz
gcc-ac1826887e12c3e8ea95414455f882838a518d11.tar.bz2
tree-ssa-address.c: New file.
* tree-ssa-address.c: New file. * Makefile.in (tree-ssa-address.o): Add. * expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on INDIRECT_REFs. Handle TARGET_MEM_REFs. * tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs. * tree-flow.h (struct mem_address): New. (struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c. (create_mem_ref, addr_for_mem_ref, get_address_description, maybe_fold_tmr, multiplier_allowed_in_address_p, multiply_by_cost): Declare. * tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs. * tree-pretty-print.c (dump_generic_node): Ditto. * tree-ssa-loop-im.c (for_each_index): Ditto. * tree-ssa-loop-ivopts.c (may_be_unaligned_p, find_interesting_uses_address): Ditto. (rewrite_address_base, build_addr_strip_iref): Removed. (struct affine_tree_combination): Moved to tree-flow.h. (get_ref_tag, copy_ref_info): New functions. (rewrite_use_address): Produce TARGET_MEM_REFs. (tree_ssa_iv_optimize): Do not call update_ssa and rewrite_into_loop_closed_ssa. (tree_to_aff_combination): Use build_fold_addr_expr instead of build_addr_strip_iref. (unshare_aff_combination): New function. (fold_affine_sum): Removed. (get_computation_at): Use get_computation_aff. Unshare the result. (get_computation_aff, multiplier_allowed_in_address_p): New function. (multiply_by_cost): Exported. (get_address_cost): Use multiplier_allowed_in_address_p. * tree-ssa-operands.c (get_tmr_operands): New function. (get_expr_operands): Handle TARGET_MEM_REFs. * tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs. (build): Handle 7 arguments. (build7_stat): New function. * tree.def (TARGET_MEM_DEF): New. * tree.h (REF_ORIGINAL): Removed. (TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL, TMR_TAG, build7): New macros. (build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare. * tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr. * doc/c-tree.texi: Document TARGET_MEM_REF. * doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar. * gcc.dg/tree-ssa/loop-2.c: Update outcome. * gcc.dg/tree-ssa/loop-3.c: Update outcome. * gcc.dg/tree-ssa/loop-4.c: Update outcome. * gcc.dg/tree-ssa/loop-9.c: New test. From-SVN: r100708
Diffstat (limited to 'gcc/tree-flow.h')
-rw-r--r--gcc/tree-flow.h46
1 files changed, 45 insertions, 1 deletions
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 51a2051..7d7dc00 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -736,7 +736,9 @@ void insert_edge_copies (tree, basic_block);
extern void linear_transform_loops (struct loops *);
/* In tree-ssa-loop-ivopts.c */
-extern bool expr_invariant_in_loop_p (struct loop *, tree);
+bool expr_invariant_in_loop_p (struct loop *, tree);
+bool multiplier_allowed_in_address_p (HOST_WIDE_INT);
+unsigned multiply_by_cost (HOST_WIDE_INT, enum machine_mode);
/* In tree-ssa-threadupdate.c. */
extern bool thread_through_all_blocks (bitmap);
@@ -745,6 +747,48 @@ extern bool thread_through_all_blocks (bitmap);
tree force_gimple_operand (tree, tree *, bool, tree);
tree force_gimple_operand_bsi (block_stmt_iterator *, tree, bool, tree);
+/* In tree-ssa-address.c */
+
+/* Affine combination of trees. We keep track of at most MAX_AFF_ELTS elements
+ to make things simpler; this is sufficient in most cases. */
+
+#define MAX_AFF_ELTS 8
+
+struct affine_tree_combination
+{
+ /* Type of the result of the combination. */
+ tree type;
+
+ /* Mask modulo that the operations are performed. */
+ unsigned HOST_WIDE_INT mask;
+
+ /* Constant offset. */
+ unsigned HOST_WIDE_INT offset;
+
+ /* Number of elements of the combination. */
+ unsigned n;
+
+ /* Elements and their coefficients. */
+ tree elts[MAX_AFF_ELTS];
+ unsigned HOST_WIDE_INT coefs[MAX_AFF_ELTS];
+
+ /* Remainder of the expression. */
+ tree rest;
+};
+
+/* Description of a memory address. */
+
+struct mem_address
+{
+ tree symbol, base, index, step, offset;
+};
+
+tree create_mem_ref (block_stmt_iterator *, tree,
+ struct affine_tree_combination *);
+rtx addr_for_mem_ref (struct mem_address *, bool);
+void get_address_description (tree, struct mem_address *);
+tree maybe_fold_tmr (tree);
+
#include "tree-flow-inline.h"
#endif /* _TREE_FLOW_H */