@@ -178,13 +178,6 @@ gen_addr_rtx (machine_mode address_mode,
*addr = const0_rtx;
}
-/* Description of a memory address. */
-
-struct mem_address
-{
- tree symbol, base, index, step, offset;
-};
-
/* Returns address for TARGET_MEM_REF with parameters given by ADDR
in address space AS.
If REALLY_EXPAND is false, just make fake registers instead
@@ -330,7 +323,7 @@ tree_mem_ref_addr (tree type, tree mem_ref)
/* Returns true if a memory reference in MODE and with parameters given by
ADDR is valid on the current target. */
-static bool
+bool
valid_mem_ref_p (machine_mode mode, addr_space_t as,
struct mem_address *addr)
{
@@ -408,7 +401,7 @@ fixed_address_object_p (tree obj)
/* If ADDR contains an address of object that is a link time constant,
move it to PARTS->symbol. */
-static void
+void
move_fixed_address_to_symbol (struct mem_address *parts, aff_tree *addr)
{
unsigned i;
@@ -20,10 +20,20 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_TREE_SSA_ADDRESS_H
#define GCC_TREE_SSA_ADDRESS_H
+/* Description of a memory address. */
+
+struct mem_address
+{
+ tree symbol, base, index, step, offset;
+};
+
extern rtx addr_for_mem_ref (struct mem_address *, addr_space_t, bool);
extern rtx addr_for_mem_ref (tree exp, addr_space_t as, bool really_expand);
extern void get_address_description (tree, struct mem_address *);
extern tree tree_mem_ref_addr (tree, tree);
+extern bool valid_mem_ref_p (machine_mode, addr_space_t, struct mem_address *);
+extern void move_fixed_address_to_symbol (struct mem_address *,
+ struct aff_tree *);
tree create_mem_ref (gimple_stmt_iterator *, tree,
struct aff_tree *, tree, tree, tree, bool);
extern void copy_ref_info (tree, tree);
Hi, This patch exposes several interfaces in tree-ssa-address.c so that they can be used in cost computation for address iv_use. Is it OK? Thanks, bin 2017-04-11 Bin Cheng <bin.cheng@arm.com> * tree-ssa-address.c (struct mem_address): Move to header file. (valid_mem_ref_p, move_fixed_address_to_symbol): Make it global. * tree-ssa-address.h (struct mem_address): Move from C file. (valid_mem_ref_p, move_fixed_address_to_symbol): Declare. From 859b2cfc74bb7a022047008e2b80d6600b50db5f Mon Sep 17 00:00:00 2001 From: Bin Cheng <binche01@e108451-lin.cambridge.arm.com> Date: Wed, 1 Mar 2017 17:43:10 +0000 Subject: [PATCH 12/33] expose-ssa-address-interface-20170220.txt --- gcc/tree-ssa-address.c | 11 ++--------- gcc/tree-ssa-address.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 9 deletions(-)