* tree-flow.h (tm_restart_node, gimple_df): Move to gimple-ssa.h.
(struct int_tree_map): Move to tree-hasher.h
(SCALE, LABEL, PERCENT): Move to gimple.h
* tree-flow-inline.h: Delete. Move functions to other files.
(unmodifiable_var_p, ref_contains_array_ref): Unused, so delete.
* gimple-ssa.h (tm_restart_node, gimple_df): Relocate from tree-flow.h.
(gimple_in_ssa_p, gimple_vop): Relocate from tree-flow-inline.h
* gimple.h (imple_stmt_max_uid, set_gimple_stmt_max_uid,
inc_gimple_stmt_max_uid, get_lineno): Relocate from tree-flow-inline.h.
(SCALE, LABEL, PERCENT): Relocate from tree-flow.h
* tree-hasher.h: Don't include tree-flow.h.
(struct int_tree_map): Relocate from tree-flow.h.
* tree-sra.c (contains_view_convert_expr_p): Relocate from
tree-flow-inline.h and make static.
* tree-ssa-alias.h (ranges_overlap_p): Relocate from tree-flow-inline.h.
* tree-ssa-operands.c (gimple_ssa_operands): Relocate from
tree-flow-inline.h and make static.
* tree.h (is_global_var, may_be_aliased): Relocate from
tree-flow-inline.h.
* Makefile.in (GTFILES): Remove tree-flow.h and add gimple-ssa.h.
* value-prof.c: No longer include tree-flow-inline.h.
* tree-switch-conversion.c: No longer include tree-flow-inline.h.
From-SVN: r203318
+2013-10-09 Andrew MacLeod <amacleod@redhat.com>
+
+ * tree-flow.h (tm_restart_node, gimple_df): Move to gimple-ssa.h.
+ (struct int_tree_map): Move to tree-hasher.h
+ (SCALE, LABEL, PERCENT): Move to gimple.h
+ * tree-flow-inline.h: Delete. Move functions to other files.
+ (unmodifiable_var_p, ref_contains_array_ref): Unused, so delete.
+ * gimple-ssa.h (tm_restart_node, gimple_df): Relocate from tree-flow.h.
+ (gimple_in_ssa_p, gimple_vop): Relocate from tree-flow-inline.h
+ * gimple.h (imple_stmt_max_uid, set_gimple_stmt_max_uid,
+ inc_gimple_stmt_max_uid, get_lineno): Relocate from tree-flow-inline.h.
+ (SCALE, LABEL, PERCENT): Relocate from tree-flow.h
+ * tree-hasher.h: Don't include tree-flow.h.
+ (struct int_tree_map): Relocate from tree-flow.h.
+ * tree-sra.c (contains_view_convert_expr_p): Relocate from
+ tree-flow-inline.h and make static.
+ * tree-ssa-alias.h (ranges_overlap_p): Relocate from tree-flow-inline.h.
+ * tree-ssa-operands.c (gimple_ssa_operands): Relocate from
+ tree-flow-inline.h and make static.
+ * tree.h (is_global_var, may_be_aliased): Relocate from
+ tree-flow-inline.h.
+ * Makefile.in (GTFILES): Remove tree-flow.h and add gimple-ssa.h.
+ * value-prof.c: No longer include tree-flow-inline.h.
+ * tree-switch-conversion.c: No longer include tree-flow-inline.h.
+
2013-10-09 Andrew MacLeod <amacleod@redhat.com>
* tree-flow.h: Move some protoypes. Include new tree-ssa-loop.h.
$(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
$(srcdir)/gimple.h $(srcdir)/gimple.c \
- $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
+ $(srcdir)/tree-mudflap.c $(srcdir)/gimple-ssa.h \
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
$(srcdir)/tree-cfg.c \
$(srcdir)/tree-dfa.c \
#ifndef GCC_GIMPLE_SSA_H
#define GCC_GIMPLE_SSA_H
+/* This structure is used to map a gimple statement to a label,
+ or list of labels to represent transaction restart. */
+
+struct GTY(()) tm_restart_node {
+ gimple stmt;
+ tree label_or_list;
+};
+
+/* Gimple dataflow datastructure. All publicly available fields shall have
+ gimple_ accessor defined, all publicly modifiable fields should have
+ gimple_set accessor. */
+struct GTY(()) gimple_df {
+ /* A vector of all the noreturn calls passed to modify_stmt.
+ cleanup_control_flow uses it to detect cases where a mid-block
+ indirect call has been turned into a noreturn call. When this
+ happens, all the instructions after the call are no longer
+ reachable and must be deleted as dead. */
+ vec<gimple, va_gc> *modified_noreturn_calls;
+
+ /* Array of all SSA_NAMEs used in the function. */
+ vec<tree, va_gc> *ssa_names;
+
+ /* Artificial variable used for the virtual operand FUD chain. */
+ tree vop;
+
+ /* The PTA solution for the ESCAPED artificial variable. */
+ struct pt_solution escaped;
+
+ /* A map of decls to artificial ssa-names that point to the partition
+ of the decl. */
+ struct pointer_map_t * GTY((skip(""))) decls_to_pointers;
+
+ /* Free list of SSA_NAMEs. */
+ vec<tree, va_gc> *free_ssanames;
+
+ /* Hashtable holding definition for symbol. If this field is not NULL, it
+ means that the first reference to this variable in the function is a
+ USE or a VUSE. In those cases, the SSA renamer creates an SSA name
+ for this variable with an empty defining statement. */
+ htab_t GTY((param_is (union tree_node))) default_defs;
+
+ /* True if there are any symbols that need to be renamed. */
+ unsigned int ssa_renaming_needed : 1;
+
+ /* True if all virtual operands need to be renamed. */
+ unsigned int rename_vops : 1;
+
+ /* True if the code is in ssa form. */
+ unsigned int in_ssa_p : 1;
+
+ /* True if IPA points-to information was computed for this function. */
+ unsigned int ipa_pta : 1;
+
+ struct ssa_operands ssa_operands;
+
+ /* Map gimple stmt to tree label (or list of labels) for transaction
+ restart and abort. */
+ htab_t GTY ((param_is (struct tm_restart_node))) tm_restart;
+};
+
+
+/* Return true when gimple SSA form was built.
+ gimple_in_ssa_p is queried by gimplifier in various early stages before SSA
+ infrastructure is initialized. Check for presence of the datastructures
+ at first place. */
+static inline bool
+gimple_in_ssa_p (const struct function *fun)
+{
+ return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
+}
+
+/* Inline functions for manipulating various data structures defined in
+ tree-flow.h. See tree-flow.h for documentation. */
+
+/* Artificial variable used for the virtual operand FUD chain. */
+static inline tree
+gimple_vop (const struct function *fun)
+{
+ gcc_checking_assert (fun && fun->gimple_df);
+ return fun->gimple_df->vop;
+}
+
/* Return the set of VUSE operand for statement G. */
static inline use_operand_p
|| CONTAINS_PLACEHOLDER_P (expr));
}
+/* Get the number of the next statement uid to be allocated. */
+static inline unsigned int
+gimple_stmt_max_uid (struct function *fn)
+{
+ return fn->last_stmt_uid;
+}
+
+/* Set the number of the next statement uid to be allocated. */
+static inline void
+set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
+{
+ fn->last_stmt_uid = maxid;
+}
+
+/* Set the number of the next statement uid to be allocated. */
+static inline unsigned int
+inc_gimple_stmt_max_uid (struct function *fn)
+{
+ return fn->last_stmt_uid++;
+}
+
extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
bool (*) (tree), fallback_t);
extern void gimplify_type_sizes (tree, gimple_seq *);
extern gimple_predicate rhs_predicate_for (tree);
extern tree canonicalize_cond_expr_cond (tree);
extern void dump_decl_set (FILE *, bitmap);
+extern bool gimple_can_coalesce_p (tree, tree);
extern bool nonfreeing_call_p (gimple);
/* In omp-low.c. */
/* In builtins.c */
extern bool validate_gimple_arglist (const_gimple, ...);
-/* In tree-ssa-coalesce.c */
-extern bool gimple_can_coalesce_p (tree, tree);
-
/* Return the first node in GIMPLE sequence S. */
static inline gimple_seq_node
gimple_set_op (dbg, 1, value);
}
+/* Return the line number for EXPR, or return -1 if we have no line
+ number information for it. */
+static inline int
+get_lineno (const_gimple stmt)
+{
+ location_t loc;
+
+ if (!stmt)
+ return -1;
+
+ loc = gimple_location (stmt);
+ if (loc == UNKNOWN_LOCATION)
+ return -1;
+
+ return LOCATION_LINE (loc);
+}
+
/* Return a pointer to the body for the OMP statement GS. */
static inline gimple_seq *
gimple_set_location (gsi_stmt (i), loc);
}
+/* Macros for showing usage statistics. */
+#define SCALE(x) ((unsigned long) ((x) < 1024*10 \
+ ? (x) \
+ : ((x) < 1024*1024*10 \
+ ? (x) / 1024 \
+ : (x) / (1024*1024))))
+
+#define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
+
+#define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
+
+
#endif /* GCC_GIMPLE_H */
+++ /dev/null
-/* Inline functions for tree-flow.h
- Copyright (C) 2001-2013 Free Software Foundation, Inc.
- Contributed by Diego Novillo <dnovillo@redhat.com>
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#ifndef _TREE_FLOW_INLINE_H
-#define _TREE_FLOW_INLINE_H 1
-
-/* Inline functions for manipulating various data structures defined in
- tree-flow.h. See tree-flow.h for documentation. */
-
-/* Return true when gimple SSA form was built.
- gimple_in_ssa_p is queried by gimplifier in various early stages before SSA
- infrastructure is initialized. Check for presence of the datastructures
- at first place. */
-static inline bool
-gimple_in_ssa_p (const struct function *fun)
-{
- return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
-}
-
-/* Artificial variable used for the virtual operand FUD chain. */
-static inline tree
-gimple_vop (const struct function *fun)
-{
- gcc_checking_assert (fun && fun->gimple_df);
- return fun->gimple_df->vop;
-}
-
-/* Get the number of the next statement uid to be allocated. */
-static inline unsigned int
-gimple_stmt_max_uid (struct function *fn)
-{
- return fn->last_stmt_uid;
-}
-
-/* Set the number of the next statement uid to be allocated. */
-static inline void
-set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
-{
- fn->last_stmt_uid = maxid;
-}
-
-/* Set the number of the next statement uid to be allocated. */
-static inline unsigned int
-inc_gimple_stmt_max_uid (struct function *fn)
-{
- return fn->last_stmt_uid++;
-}
-
-/* Return the line number for EXPR, or return -1 if we have no line
- number information for it. */
-static inline int
-get_lineno (const_gimple stmt)
-{
- location_t loc;
-
- if (!stmt)
- return -1;
-
- loc = gimple_location (stmt);
- if (loc == UNKNOWN_LOCATION)
- return -1;
-
- return LOCATION_LINE (loc);
-}
-
-
-/* Return true if T (assumed to be a DECL) is a global variable.
- A variable is considered global if its storage is not automatic. */
-
-static inline bool
-is_global_var (const_tree t)
-{
- return (TREE_STATIC (t) || DECL_EXTERNAL (t));
-}
-
-
-/* Return true if VAR may be aliased. A variable is considered as
- maybe aliased if it has its address taken by the local TU
- or possibly by another TU and might be modified through a pointer. */
-
-static inline bool
-may_be_aliased (const_tree var)
-{
- return (TREE_CODE (var) != CONST_DECL
- && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var))
- && TREE_READONLY (var)
- && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (var)))
- && (TREE_PUBLIC (var)
- || DECL_EXTERNAL (var)
- || TREE_ADDRESSABLE (var)));
-}
-
-/* Return true if VAR cannot be modified by the program. */
-
-static inline bool
-unmodifiable_var_p (const_tree var)
-{
- if (TREE_CODE (var) == SSA_NAME)
- var = SSA_NAME_VAR (var);
-
- return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var));
-}
-
-/* Return true if REF, a handled component reference, has an ARRAY_REF
- somewhere in it. */
-
-static inline bool
-ref_contains_array_ref (const_tree ref)
-{
- gcc_checking_assert (handled_component_p (ref));
-
- do {
- if (TREE_CODE (ref) == ARRAY_REF)
- return true;
- ref = TREE_OPERAND (ref, 0);
- } while (handled_component_p (ref));
-
- return false;
-}
-
-/* Return true if REF has an VIEW_CONVERT_EXPR somewhere in it. */
-
-static inline bool
-contains_view_convert_expr_p (const_tree ref)
-{
- while (handled_component_p (ref))
- {
- if (TREE_CODE (ref) == VIEW_CONVERT_EXPR)
- return true;
- ref = TREE_OPERAND (ref, 0);
- }
-
- return false;
-}
-
-/* Return true, if the two ranges [POS1, SIZE1] and [POS2, SIZE2]
- overlap. SIZE1 and/or SIZE2 can be (unsigned)-1 in which case the
- range is open-ended. Otherwise return false. */
-
-static inline bool
-ranges_overlap_p (unsigned HOST_WIDE_INT pos1,
- unsigned HOST_WIDE_INT size1,
- unsigned HOST_WIDE_INT pos2,
- unsigned HOST_WIDE_INT size2)
-{
- if (pos1 >= pos2
- && (size2 == (unsigned HOST_WIDE_INT)-1
- || pos1 < (pos2 + size2)))
- return true;
- if (pos2 >= pos1
- && (size1 == (unsigned HOST_WIDE_INT)-1
- || pos2 < (pos1 + size1)))
- return true;
-
- return false;
-}
-
-/* Accessor to tree-ssa-operands.c caches. */
-static inline struct ssa_operands *
-gimple_ssa_operands (const struct function *fun)
-{
- return &fun->gimple_df->ssa_operands;
-}
-
-#endif /* _TREE_FLOW_INLINE_H */
#include "tree-into-ssa.h"
#include "tree-ssa-loop.h"
-/* This structure is used to map a gimple statement to a label,
- or list of labels to represent transaction restart. */
-
-struct GTY(()) tm_restart_node {
- gimple stmt;
- tree label_or_list;
-};
-
-/* Gimple dataflow datastructure. All publicly available fields shall have
- gimple_ accessor defined in tree-flow-inline.h, all publicly modifiable
- fields should have gimple_set accessor. */
-struct GTY(()) gimple_df {
- /* A vector of all the noreturn calls passed to modify_stmt.
- cleanup_control_flow uses it to detect cases where a mid-block
- indirect call has been turned into a noreturn call. When this
- happens, all the instructions after the call are no longer
- reachable and must be deleted as dead. */
- vec<gimple, va_gc> *modified_noreturn_calls;
-
- /* Array of all SSA_NAMEs used in the function. */
- vec<tree, va_gc> *ssa_names;
-
- /* Artificial variable used for the virtual operand FUD chain. */
- tree vop;
-
- /* The PTA solution for the ESCAPED artificial variable. */
- struct pt_solution escaped;
-
- /* A map of decls to artificial ssa-names that point to the partition
- of the decl. */
- struct pointer_map_t * GTY((skip(""))) decls_to_pointers;
-
- /* Free list of SSA_NAMEs. */
- vec<tree, va_gc> *free_ssanames;
-
- /* Hashtable holding definition for symbol. If this field is not NULL, it
- means that the first reference to this variable in the function is a
- USE or a VUSE. In those cases, the SSA renamer creates an SSA name
- for this variable with an empty defining statement. */
- htab_t GTY((param_is (union tree_node))) default_defs;
-
- /* True if there are any symbols that need to be renamed. */
- unsigned int ssa_renaming_needed : 1;
-
- /* True if all virtual operands need to be renamed. */
- unsigned int rename_vops : 1;
-
- /* True if the code is in ssa form. */
- unsigned int in_ssa_p : 1;
-
- /* True if IPA points-to information was computed for this function. */
- unsigned int ipa_pta : 1;
-
- struct ssa_operands ssa_operands;
-
- /* Map gimple stmt to tree label (or list of labels) for transaction
- restart and abort. */
- htab_t GTY ((param_is (struct tm_restart_node))) tm_restart;
-};
-
-static inline int get_lineno (const_gimple);
-
-/*---------------------------------------------------------------------------
- Global declarations
----------------------------------------------------------------------------*/
-struct int_tree_map {
- unsigned int uid;
- tree to;
-};
-
-/* Macros for showing usage statistics. */
-#define SCALE(x) ((unsigned long) ((x) < 1024*10 \
- ? (x) \
- : ((x) < 1024*1024*10 \
- ? (x) / 1024 \
- : (x) / (1024*1024))))
-
-#define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
-
-#define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
-
/*---------------------------------------------------------------------------
OpenMP Region Tree
---------------------------------------------------------------------------*/
/* In tree-parloops.c */
bool parallelized_function_p (tree);
-#include "tree-flow-inline.h"
-
#endif /* _TREE_FLOW_H */
#define GCC_TREE_HASHER_H 1
#include "hash-table.h"
-#include "tree-flow.h"
+
+struct int_tree_map {
+ unsigned int uid;
+ tree to;
+};
/* Hashtable helpers. */
completely_scalarize_record (var, var, 0, var);
}
+/* Return true if REF has an VIEW_CONVERT_EXPR somewhere in it. */
+
+static inline bool
+contains_view_convert_expr_p (const_tree ref)
+{
+ while (handled_component_p (ref))
+ {
+ if (TREE_CODE (ref) == VIEW_CONVERT_EXPR)
+ return true;
+ ref = TREE_OPERAND (ref, 0);
+ }
+
+ return false;
+}
+
/* Search the given tree for a declaration by skipping handled components and
exclude it from the candidates. */
extern GTY(()) struct pt_solution ipa_escaped_pt;
+/* Return true, if the two ranges [POS1, SIZE1] and [POS2, SIZE2]
+ overlap. SIZE1 and/or SIZE2 can be (unsigned)-1 in which case the
+ range is open-ended. Otherwise return false. */
+
+static inline bool
+ranges_overlap_p (unsigned HOST_WIDE_INT pos1,
+ unsigned HOST_WIDE_INT size1,
+ unsigned HOST_WIDE_INT pos2,
+ unsigned HOST_WIDE_INT size2)
+{
+ if (pos1 >= pos2
+ && (size2 == (unsigned HOST_WIDE_INT)-1
+ || pos1 < (pos2 + size2)))
+ return true;
+ if (pos2 >= pos1
+ && (size1 == (unsigned HOST_WIDE_INT)-1
+ || pos2 < (pos1 + size1)))
+ return true;
+
+ return false;
+}
+
+
#endif /* TREE_SSA_ALIAS_H */
/* Number of functions with initialized ssa_operands. */
static int n_initialized = 0;
+/* Accessor to tree-ssa-operands.c caches. */
+static inline struct ssa_operands *
+gimple_ssa_operands (const struct function *fun)
+{
+ return &fun->gimple_df->ssa_operands;
+}
+
/* Return true if the SSA operands cache is active. */
#include "tree.h"
#include "basic-block.h"
#include "tree-ssa.h"
-#include "tree-flow-inline.h"
#include "tree-ssa-operands.h"
#include "tree-pass.h"
#include "gimple-pretty-print.h"
&& builtin_info.implicit_p[uns_fncode]);
}
+/* Return true if T (assumed to be a DECL) is a global variable.
+ A variable is considered global if its storage is not automatic. */
+
+static inline bool
+is_global_var (const_tree t)
+{
+ return (TREE_STATIC (t) || DECL_EXTERNAL (t));
+}
+
+/* Return true if VAR may be aliased. A variable is considered as
+ maybe aliased if it has its address taken by the local TU
+ or possibly by another TU and might be modified through a pointer. */
+
+static inline bool
+may_be_aliased (const_tree var)
+{
+ return (TREE_CODE (var) != CONST_DECL
+ && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var))
+ && TREE_READONLY (var)
+ && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (var)))
+ && (TREE_PUBLIC (var)
+ || DECL_EXTERNAL (var)
+ || TREE_ADDRESSABLE (var)));
+}
+
/* For anonymous aggregate types, we need some sort of name to
hold on to. In practice, this should not appear, but it should
not be harmful if it does. */
#include "regs.h"
#include "ggc.h"
#include "tree-ssa.h"
-#include "tree-flow-inline.h"
#include "diagnostic.h"
#include "gimple-pretty-print.h"
#include "coverage.h"