]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/tree-ssa-propagate.h
Update copyright years.
[thirdparty/gcc.git] / gcc / tree-ssa-propagate.h
CommitLineData
41511585 1/* Data structures and function declarations for the SSA value propagation
2 engine.
f1717362 3 Copyright (C) 2004-2016 Free Software Foundation, Inc.
41511585 4 Contributed by Diego Novillo <dnovillo@redhat.com>
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
8c4c00c1 10the Free Software Foundation; either version 3, or (at your option)
41511585 11any later version.
12
13GCC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
8c4c00c1 19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
41511585 21
22#ifndef _TREE_SSA_PROPAGATE_H
23#define _TREE_SSA_PROPAGATE_H 1
24
75a70cf9 25/* If SIM_P is true, statement S will be simulated again. */
26
27static inline void
42acab1c 28prop_set_simulate_again (gimple *s, bool visit_p)
75a70cf9 29{
30 gimple_set_visited (s, visit_p);
31}
32
33/* Return true if statement T should be simulated again. */
34
35static inline bool
42acab1c 36prop_simulate_again_p (gimple *s)
75a70cf9 37{
38 return gimple_visited_p (s);
39}
41511585 40
41/* Lattice values used for propagation purposes. Specific instances
42 of a propagation engine must return these values from the statement
43 and PHI visit functions to direct the engine. */
41511585 44enum ssa_prop_result {
45 /* The statement produces nothing of interest. No edges will be
46 added to the work lists. */
47 SSA_PROP_NOT_INTERESTING,
48
49 /* The statement produces an interesting value. The set SSA_NAMEs
50 returned by SSA_PROP_VISIT_STMT should be added to
51 INTERESTING_SSA_EDGES. If the statement being visited is a
52 conditional jump, SSA_PROP_VISIT_STMT should indicate which edge
91275768 53 out of the basic block should be marked executable. */
41511585 54 SSA_PROP_INTERESTING,
55
56 /* The statement produces a varying (i.e., useless) value and
57 should not be simulated again. If the statement being visited
58 is a conditional jump, all the edges coming out of the block
59 will be considered executable. */
60 SSA_PROP_VARYING
61};
62
63
64/* Call-back functions used by the value propagation engine. */
42acab1c 65typedef enum ssa_prop_result (*ssa_prop_visit_stmt_fn) (gimple *, edge *,
66 tree *);
1a91d914 67typedef enum ssa_prop_result (*ssa_prop_visit_phi_fn) (gphi *);
07aee51b 68typedef bool (*ssa_prop_fold_stmt_fn) (gimple_stmt_iterator *gsi);
14f101cf 69typedef tree (*ssa_prop_get_value_fn) (tree);
41511585 70
88dbf20f 71
0f4161b1 72extern bool valid_gimple_rhs_p (tree);
42acab1c 73extern void move_ssa_defining_stmt_for_defs (gimple *, gimple *);
0f4161b1 74extern bool update_gimple_call (gimple_stmt_iterator *, tree, int, ...);
75extern bool update_call_from_tree (gimple_stmt_iterator *, tree);
76extern void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
42acab1c 77extern bool stmt_makes_single_store (gimple *);
0f4161b1 78extern bool substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn,
79 bool);
80extern bool may_propagate_copy (tree, tree);
42acab1c 81extern bool may_propagate_copy_into_stmt (gimple *, tree);
0f4161b1 82extern bool may_propagate_copy_into_asm (tree);
83extern void propagate_value (use_operand_p, tree);
84extern void replace_exp (use_operand_p, tree);
85extern void propagate_tree_value (tree *, tree);
86extern void propagate_tree_value_into_stmt (gimple_stmt_iterator *, tree);
41511585 87
88#endif /* _TREE_SSA_PROPAGATE_H */