PR tree-optimization/19876
[official-gcc.git] / gcc / tree-ssa-propagate.h
blob6375f5bd6c6fc33613086002dd5efec7c632e1fb
1 /* Data structures and function declarations for the SSA value propagation
2 engine.
3 Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
4 Contributed by Diego Novillo <dnovillo@redhat.com>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. */
23 #ifndef _TREE_SSA_PROPAGATE_H
24 #define _TREE_SSA_PROPAGATE_H 1
26 /* Use the TREE_VISITED bitflag to mark statements and PHI nodes that
27 have been deemed varying and should not be simulated again. */
28 #define DONT_SIMULATE_AGAIN(T) TREE_VISITED (T)
30 /* Lattice values used for propagation purposes. Specific instances
31 of a propagation engine must return these values from the statement
32 and PHI visit functions to direct the engine. */
34 enum ssa_prop_result {
35 /* The statement produces nothing of interest. No edges will be
36 added to the work lists. */
37 SSA_PROP_NOT_INTERESTING,
39 /* The statement produces an interesting value. The set SSA_NAMEs
40 returned by SSA_PROP_VISIT_STMT should be added to
41 INTERESTING_SSA_EDGES. If the statement being visited is a
42 conditional jump, SSA_PROP_VISIT_STMT should indicate which edge
43 out of the basic block should be marked executable. */
44 SSA_PROP_INTERESTING,
46 /* The statement produces a varying (i.e., useless) value and
47 should not be simulated again. If the statement being visited
48 is a conditional jump, all the edges coming out of the block
49 will be considered executable. */
50 SSA_PROP_VARYING
54 /* Call-back functions used by the value propagation engine. */
55 typedef enum ssa_prop_result (*ssa_prop_visit_stmt_fn) (tree, edge *, tree *);
56 typedef enum ssa_prop_result (*ssa_prop_visit_phi_fn) (tree);
58 void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
59 tree get_rhs (tree);
60 bool set_rhs (tree *, tree);
62 #endif /* _TREE_SSA_PROPAGATE_H */