GCC Middle and Back End API Reference
Main Page
Namespaces
Data Structures
Files
File List
Globals
GCC Middle and Back End API Reference
Namespaces
Data Structures
Files
File List
addresses.h
alias.c
alias.h
alloc-pool.c
alloc-pool.h
asan.c
asan.h
attribs.c
auto-inc-dec.c
basic-block.h
bb-reorder.c
bb-reorder.h
bitmap.c
bitmap.h
bt-load.c
builtins.c
builtins.h
caller-save.c
calls.c
cfg.c
cfganal.c
cfgbuild.c
cfgcleanup.c
cfgexpand.c
cfghooks.c
cfghooks.h
cfgloop.c
cfgloop.h
cfgloopanal.c
cfgloopmanip.c
cfgrtl.c
cgraph.c
cgraph.h
cgraphbuild.c
cgraphclones.c
cgraphunit.c
cilk-common.c
cilk.h
collect2-aix.c
collect2-aix.h
collect2.c
collect2.h
combine-stack-adj.c
combine.c
compare-elim.c
conditions.h
context.c
context.h
convert.c
convert.h
coretypes.h
coverage.c
coverage.h
cppbuiltin.c
cppbuiltin.h
cppdefault.c
cppdefault.h
cprop.c
cse.c
cselib.c
cselib.h
data-streamer-in.c
data-streamer-out.c
data-streamer.c
data-streamer.h
dbgcnt.c
dbgcnt.h
dbxout.c
dbxout.h
dce.c
dce.h
ddg.c
ddg.h
debug.c
debug.h
defaults.h
df-core.c
df-problems.c
df-scan.c
df.h
dfp.c
dfp.h
diagnostic-color.c
diagnostic-color.h
diagnostic-core.h
diagnostic.c
diagnostic.h
dojump.c
dominance.c
domwalk.c
domwalk.h
double-int.c
double-int.h
dse.c
dumpfile.c
dumpfile.h
dwarf2asm.c
dwarf2asm.h
dwarf2cfi.c
dwarf2out.c
dwarf2out.h
emit-rtl.c
emit-rtl.h
errors.c
errors.h
et-forest.c
et-forest.h
except.c
except.h
explow.c
expmed.c
expmed.h
expr.c
expr.h
file-find.c
file-find.h
final.c
fixed-value.c
fixed-value.h
flag-types.h
flags.h
fold-const.c
foo.c
fp-test.c
function.c
function.h
fwprop.c
gcc-ar.c
gcc-plugin.h
gcc.c
gcc.h
gcov-dump.c
gcov-io.c
gcov-io.h
gcov-iov.c
gcov.c
gcse.c
gcse.h
gdbhooks.py
genattr-common.c
genattr.c
genattrtab.c
genautomata.c
gencheck.c
genchecksum.c
gencodes.c
genconditions.c
genconfig.c
genconstants.c
genemit.c
genenums.c
genextract.c
genflags.c
gengenrtl.c
gengtype-parse.c
gengtype-state.c
gengtype.c
gengtype.h
genhooks.c
genmddeps.c
genmddump.c
genmodes.c
genopinit.c
genoutput.c
genpeep.c
genpreds.c
genrecog.c
gensupport.c
gensupport.h
ggc-common.c
ggc-internal.h
ggc-none.c
ggc-page.c
ggc.h
gimple-builder.c
gimple-builder.h
gimple-fold.c
gimple-fold.h
gimple-iterator.c
gimple-low.c
gimple-low.h
gimple-pretty-print.c
gimple-pretty-print.h
gimple-ssa-strength-reduction.c
gimple-ssa.h
gimple-streamer-in.c
gimple-streamer-out.c
gimple-streamer.h
gimple.c
gimple.h
gimplify.c
glimits.h
godump.c
graph.c
graph.h
graphds.c
graphds.h
graphite-blocking.c
graphite-clast-to-gimple.c
graphite-clast-to-gimple.h
graphite-dependences.c
graphite-htab.h
graphite-interchange.c
graphite-optimize-isl.c
graphite-poly.c
graphite-poly.h
graphite-scop-detection.c
graphite-scop-detection.h
graphite-sese-to-poly.c
graphite-sese-to-poly.h
graphite.c
gstab.h
gsyms.h
gsyslimits.h
haifa-sched.c
hard-reg-set.h
hash-table.c
hash-table.h
highlev-plugin-common.h
hooks.c
hooks.h
host-default.c
hosthooks-def.h
hosthooks.h
hw-doloop.c
hw-doloop.h
hwint.c
hwint.h
ifcvt.c
incpath.c
incpath.h
init-regs.c
input.c
input.h
insn-addr.h
internal-fn.c
internal-fn.h
intl.c
intl.h
ipa-cp.c
ipa-devirt.c
ipa-inline-analysis.c
ipa-inline-transform.c
ipa-inline.c
ipa-inline.h
ipa-profile.c
ipa-prop.c
ipa-prop.h
ipa-pure-const.c
ipa-ref-inline.h
ipa-ref.c
ipa-ref.h
ipa-reference.c
ipa-reference.h
ipa-split.c
ipa-utils.c
ipa-utils.h
ipa.c
ira-build.c
ira-color.c
ira-conflicts.c
ira-costs.c
ira-emit.c
ira-int.h
ira-lives.c
ira.c
ira.h
is-a.h
jump.c
langhooks-def.h
langhooks.c
langhooks.h
lcm.c
libfuncs.h
limitx.h
limity.h
lists.c
loop-doloop.c
loop-init.c
loop-invariant.c
loop-iv.c
loop-unroll.c
loop-unswitch.c
lower-subreg.c
lower-subreg.h
lra-assigns.c
lra-coalesce.c
lra-constraints.c
lra-eliminations.c
lra-int.h
lra-lives.c
lra-spills.c
lra.c
lra.h
lto-cgraph.c
lto-compress.c
lto-compress.h
lto-opts.c
lto-section-in.c
lto-section-out.c
lto-streamer-in.c
lto-streamer-out.c
lto-streamer.c
lto-streamer.h
lto-wrapper.c
machmode.h
main.c
mcf.c
mode-switching.c
modulo-sched.c
omega.c
omega.h
omp-low.c
omp-low.h
optabs.c
optabs.h
opts-common.c
opts-diagnostic.h
opts-global.c
opts.c
opts.h
output.h
params.c
params.h
pass_manager.h
passes.c
plugin.c
plugin.h
pointer-set.c
pointer-set.h
postreload-gcse.c
postreload.c
predict.c
predict.h
prefix.c
prefix.h
pretty-print.c
pretty-print.h
print-rtl.c
print-tree.c
profile.c
profile.h
read-md.c
read-md.h
read-rtl.c
real.c
real.h
realmpfr.c
realmpfr.h
recog.c
recog.h
ree.c
reg-stack.c
regcprop.c
reginfo.c
regrename.c
regrename.h
regs.h
regset.h
regstat.c
reload.c
reload.h
reload1.c
reorg.c
resource.c
resource.h
rtl-error.c
rtl-error.h
rtl.c
rtl.h
rtlanal.c
rtlhooks-def.h
rtlhooks.c
sbitmap.c
sbitmap.h
sched-deps.c
sched-ebb.c
sched-int.h
sched-rgn.c
sched-vis.c
sdbout.c
sdbout.h
sel-sched-dump.c
sel-sched-dump.h
sel-sched-ir.c
sel-sched-ir.h
sel-sched.c
sel-sched.h
sese.c
sese.h
simplify-rtx.c
sparseset.c
sparseset.h
sreal.c
sreal.h
ssa-iterators.h
stack-ptr-mod.c
statistics.c
statistics.h
stmt.c
stor-layout.c
store-motion.c
streamer-hooks.c
streamer-hooks.h
stringpool.c
symtab.c
system.h
target-def.h
target-globals.c
target-globals.h
target-hooks-macros.h
target.h
targhooks.c
targhooks.h
timevar.c
timevar.h
tlink.c
toplev.c
toplev.h
tracer.c
trans-mem.c
trans-mem.h
tree-affine.c
tree-affine.h
tree-browser.c
tree-call-cdce.c
tree-cfg.c
tree-cfg.h
tree-cfgcleanup.c
tree-cfgcleanup.h
tree-chrec.c
tree-chrec.h
tree-complex.c
tree-core.h
tree-data-ref.c
tree-data-ref.h
tree-dfa.c
tree-dfa.h
tree-diagnostic.c
tree-diagnostic.h
tree-dump.c
tree-dump.h
tree-eh.c
tree-eh.h
tree-emutls.c
tree-hasher.h
tree-if-conv.c
tree-inline.c
tree-inline.h
tree-into-ssa.c
tree-into-ssa.h
tree-iterator.c
tree-iterator.h
tree-loop-distribution.c
tree-nested.c
tree-nrv.c
tree-object-size.c
tree-outof-ssa.c
tree-outof-ssa.h
tree-parloops.c
tree-parloops.h
tree-pass.h
tree-phinodes.c
tree-phinodes.h
tree-predcom.c
tree-pretty-print.c
tree-pretty-print.h
tree-profile.c
tree-scalar-evolution.c
tree-scalar-evolution.h
tree-sra.c
tree-ssa-address.c
tree-ssa-address.h
tree-ssa-alias.c
tree-ssa-alias.h
tree-ssa-ccp.c
tree-ssa-coalesce.c
tree-ssa-coalesce.h
tree-ssa-copy.c
tree-ssa-copyrename.c
tree-ssa-dce.c
tree-ssa-dom.c
tree-ssa-dom.h
tree-ssa-dse.c
tree-ssa-forwprop.c
tree-ssa-ifcombine.c
tree-ssa-live.c
tree-ssa-live.h
tree-ssa-loop-ch.c
tree-ssa-loop-im.c
tree-ssa-loop-ivcanon.c
tree-ssa-loop-ivopts.c
tree-ssa-loop-ivopts.h
tree-ssa-loop-manip.c
tree-ssa-loop-manip.h
tree-ssa-loop-niter.c
tree-ssa-loop-niter.h
tree-ssa-loop-prefetch.c
tree-ssa-loop-unswitch.c
tree-ssa-loop.c
tree-ssa-loop.h
tree-ssa-math-opts.c
tree-ssa-operands.c
tree-ssa-operands.h
tree-ssa-phiopt.c
tree-ssa-phiprop.c
tree-ssa-pre.c
tree-ssa-propagate.c
tree-ssa-propagate.h
tree-ssa-reassoc.c
tree-ssa-sccvn.c
tree-ssa-sccvn.h
tree-ssa-sink.c
tree-ssa-strlen.c
tree-ssa-structalias.c
tree-ssa-tail-merge.c
tree-ssa-ter.c
tree-ssa-ter.h
tree-ssa-threadedge.c
tree-ssa-threadedge.h
tree-ssa-threadupdate.c
tree-ssa-threadupdate.h
tree-ssa-uncprop.c
tree-ssa-uninit.c
tree-ssa.c
tree-ssa.h
tree-ssanames.c
tree-ssanames.h
tree-stdarg.c
tree-stdarg.h
tree-streamer-in.c
tree-streamer-out.c
tree-streamer.c
tree-streamer.h
tree-switch-conversion.c
tree-tailcall.c
tree-vect-data-refs.c
tree-vect-generic.c
tree-vect-loop-manip.c
tree-vect-loop.c
tree-vect-patterns.c
tree-vect-slp.c
tree-vect-stmts.c
tree-vectorizer.c
tree-vectorizer.h
tree-vrp.c
tree.c
tree.h
tsan.c
tsan.h
tsystem.h
typeclass.h
ubsan.c
ubsan.h
valtrack.c
valtrack.h
value-prof.c
value-prof.h
var-tracking.c
varasm.c
varpool.c
vec.c
vec.h
version.c
version.h
vmsdbg.h
vmsdbgout.c
vtable-verify.c
vtable-verify.h
web.c
xcoff.h
xcoffout.c
xcoffout.h
Globals
ddg.h
Go to the documentation of this file.
1
/* DDG - Data Dependence Graph - interface.
2
Copyright (C) 2004-2013 Free Software Foundation, Inc.
3
Contributed by Ayal Zaks and Mustafa Hagog <zaks,mustafa@il.ibm.com>
4
5
This file is part of GCC.
6
7
GCC is free software; you can redistribute it and/or modify it under
8
the terms of the GNU General Public License as published by the Free
9
Software Foundation; either version 3, or (at your option) any later
10
version.
11
12
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13
WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15
for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with GCC; see the file COPYING3. If not see
19
<http://www.gnu.org/licenses/>. */
20
21
#ifndef GCC_DDG_H
22
#define GCC_DDG_H
23
24
/* For sbitmap. */
25
#include "
sbitmap.h
"
26
/* For basic_block. */
27
#include "
basic-block.h
"
28
#include "
df.h
"
29
30
typedef
struct
ddg_node
*
ddg_node_ptr
;
31
typedef
struct
ddg_edge
*
ddg_edge_ptr
;
32
typedef
struct
ddg
*
ddg_ptr
;
33
typedef
struct
ddg_scc
*
ddg_scc_ptr
;
34
typedef
struct
ddg_all_sccs
*
ddg_all_sccs_ptr
;
35
36
typedef
enum
{
TRUE_DEP
,
OUTPUT_DEP
,
ANTI_DEP
}
dep_type
;
37
typedef
enum
{
REG_OR_MEM_DEP
,
REG_DEP
,
MEM_DEP
,
REG_AND_MEM_DEP
}
38
dep_data_type
;
39
40
/* The following two macros enables direct access to the successors and
41
predecessors bitmaps held in each ddg_node. Do not make changes to
42
these bitmaps, unless you want to change the DDG. */
43
#define NODE_SUCCESSORS(x) ((x)->successors)
44
#define NODE_PREDECESSORS(x) ((x)->predecessors)
45
46
/* A structure that represents a node in the DDG. */
47
struct
ddg_node
48
{
49
/* Each node has a unique CUID index. These indices increase monotonically
50
(according to the order of the corresponding INSN in the BB), starting
51
from 0 with no gaps. */
52
int
cuid
;
53
54
/* The insn represented by the node. */
55
rtx
insn
;
56
57
/* A note preceding INSN (or INSN itself), such that all insns linked
58
from FIRST_NOTE until INSN (inclusive of both) are moved together
59
when reordering the insns. This takes care of notes that should
60
continue to precede INSN. */
61
rtx
first_note
;
62
63
/* Incoming and outgoing dependency edges. */
64
ddg_edge_ptr
in
;
65
ddg_edge_ptr
out
;
66
67
/* Each bit corresponds to a ddg_node according to its cuid, and is
68
set iff the node is a successor/predecessor of "this" node. */
69
sbitmap
successors
;
70
sbitmap
predecessors
;
71
72
/* For general use by algorithms manipulating the ddg. */
73
union
{
74
int
count
;
75
void
*
info
;
76
}
aux
;
77
};
78
79
/* A structure that represents an edge in the DDG. */
80
struct
ddg_edge
81
{
82
/* The source and destination nodes of the dependency edge. */
83
ddg_node_ptr
src
;
84
ddg_node_ptr
dest
;
85
86
/* TRUE, OUTPUT or ANTI dependency. */
87
dep_type
type
;
88
89
/* REG or MEM dependency. */
90
dep_data_type
data_type
;
91
92
/* Latency of the dependency. */
93
int
latency
;
94
95
/* The distance: number of loop iterations the dependency crosses. */
96
int
distance
;
97
98
/* The following two fields are used to form a linked list of the in/out
99
going edges to/from each node. */
100
ddg_edge_ptr
next_in
;
101
ddg_edge_ptr
next_out
;
102
103
/* For general use by algorithms manipulating the ddg. */
104
union
{
105
int
count
;
106
void
*
info
;
107
}
aux
;
108
};
109
110
/* This structure holds the Data Dependence Graph for a basic block. */
111
struct
ddg
112
{
113
/* The basic block for which this DDG is built. */
114
basic_block
bb
;
115
116
/* Number of instructions in the basic block. */
117
int
num_nodes
;
118
119
/* Number of load/store instructions in the BB - statistics. */
120
int
num_loads
;
121
int
num_stores
;
122
123
/* Number of debug instructions in the BB. */
124
int
num_debug
;
125
126
/* This array holds the nodes in the graph; it is indexed by the node
127
cuid, which follows the order of the instructions in the BB. */
128
ddg_node_ptr
nodes
;
129
130
/* The branch closing the loop. */
131
ddg_node_ptr
closing_branch
;
132
133
/* Build dependence edges for closing_branch, when set. In certain cases,
134
the closing branch can be dealt with separately from the insns of the
135
loop, and then no such deps are needed. */
136
int
closing_branch_deps
;
137
138
/* Array and number of backarcs (edges with distance > 0) in the DDG. */
139
int
num_backarcs
;
140
ddg_edge_ptr *
backarcs
;
141
};
142
143
144
/* Holds information on an SCC (Strongly Connected Component) of the DDG. */
145
struct
ddg_scc
146
{
147
/* A bitmap that represents the nodes of the DDG that are in the SCC. */
148
sbitmap
nodes
;
149
150
/* Array and number of backarcs (edges with distance > 0) in the SCC. */
151
ddg_edge_ptr *
backarcs
;
152
int
num_backarcs
;
153
154
/* The maximum of (total_latency/total_distance) over all cycles in SCC. */
155
int
recurrence_length
;
156
};
157
158
/* This structure holds the SCCs of the DDG. */
159
struct
ddg_all_sccs
160
{
161
/* Array that holds the SCCs in the DDG, and their number. */
162
ddg_scc_ptr *
sccs
;
163
int
num_sccs
;
164
165
ddg_ptr
ddg
;
166
};
167
168
169
ddg_ptr
create_ddg
(
basic_block
,
int
closing_branch_deps);
170
void
free_ddg
(ddg_ptr);
171
172
void
print_ddg
(FILE *, ddg_ptr);
173
void
vcg_print_ddg
(FILE *, ddg_ptr);
174
void
print_ddg_edge
(FILE *, ddg_edge_ptr);
175
void
print_sccs
(FILE *, ddg_all_sccs_ptr, ddg_ptr);
176
177
ddg_node_ptr
get_node_of_insn
(ddg_ptr,
rtx
);
178
179
void
find_successors
(
sbitmap
result, ddg_ptr,
sbitmap
);
180
void
find_predecessors
(
sbitmap
result, ddg_ptr,
sbitmap
);
181
182
ddg_all_sccs_ptr
create_ddg_all_sccs
(ddg_ptr);
183
void
free_ddg_all_sccs
(ddg_all_sccs_ptr);
184
185
int
find_nodes_on_paths
(
sbitmap
result, ddg_ptr,
sbitmap
from,
sbitmap
to);
186
int
longest_simple_path
(ddg_ptr,
int
from,
int
to,
sbitmap
via);
187
188
bool
autoinc_var_is_used_p
(
rtx
,
rtx
);
189
190
#endif
/* GCC_DDG_H */
gcc
ddg.h
Generated by
1.8.1.1