]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/tree-ssa-threadedge.h
1 /* Header file for SSA jump threading.
2 Copyright (C) 2013-2021 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_TREE_SSA_THREADEDGE_H
21 #define GCC_TREE_SSA_THREADEDGE_H
23 // Class used to maintain path state in the jump threader and pass it
24 // to the jump threader simplifier.
29 jt_state (class const_and_copies
*,
30 class avail_exprs_stack
*,
31 class evrp_range_analyzer
*);
34 void register_equiv (tree dest
, tree src
, bool update_range
= false);
35 void register_equivs_on_edge (edge e
);
36 void record_ranges_from_stmt (gimple
*stmt
, bool temporary
);
39 const_and_copies
*m_copies
;
40 avail_exprs_stack
*m_exprs
;
41 evrp_range_analyzer
*m_evrp
;
44 // This is the high level threader. The entry point is
45 // thread_outgoing_edges(), which calculates and registers paths to be
46 // threaded. When all candidates have been registered,
47 // thread_through_all_blocks() is called to actually change the CFG.
52 jump_threader (class jump_threader_simplifier
*, class jt_state
*);
54 void thread_outgoing_edges (basic_block
);
55 void remove_jump_threads_including (edge_def
*);
56 bool thread_through_all_blocks (bool may_peel_loop_headers
);
59 tree
simplify_control_stmt_condition (edge
, gimple
*);
60 tree
simplify_control_stmt_condition_1 (edge
,
67 bool thread_around_empty_blocks (vec
<class jump_thread_edge
*> *path
,
68 edge
, bitmap visited
);
69 int thread_through_normal_block (vec
<jump_thread_edge
*> *path
,
70 edge
, bitmap visited
);
71 void thread_across_edge (edge
);
72 bool record_temporary_equivalences_from_phis (edge
);
73 gimple
*record_temporary_equivalences_from_stmts_at_dest (edge
);
75 // Dummy condition to avoid creating lots of throw away statements.
78 class fwd_jt_path_registry
*m_registry
;
79 jump_threader_simplifier
*m_simplifier
;
83 // Statement simplifier callback for the jump threader.
85 class jump_threader_simplifier
88 jump_threader_simplifier (class vr_values
*v
);
89 virtual ~jump_threader_simplifier () { }
90 virtual tree
simplify (gimple
*, gimple
*, basic_block
, jt_state
*);
93 vr_values
*m_vr_values
;
96 extern void propagate_threaded_block_debug_into (basic_block
, basic_block
);
97 extern bool single_succ_to_potentially_threadable_block (basic_block
);
99 // ?? All this ssa_name_values stuff is the store of values for
100 // avail_exprs_stack and const_and_copies, so it really belongs in the
101 // jump_threader class. However, it's probably not worth touching
102 // this, since all this windable state is slated to go with the
104 extern vec
<tree
> ssa_name_values
;
105 #define SSA_NAME_VALUE(x) \
106 (SSA_NAME_VERSION (x) < ssa_name_values.length () \
107 ? ssa_name_values[SSA_NAME_VERSION (x)] \
109 extern void set_ssa_name_value (tree
, tree
);
111 #endif /* GCC_TREE_SSA_THREADEDGE_H */