Enable dumping of alias graphs.
[official-gcc/Ramakrishna.git] / gcc / gimple.def
blob716f6e2acbbe5124a22aa106755ca52307ba5391
1 /* This file contains the definitions of the GIMPLE IR tuples used in GCC.
3 Copyright (C) 2007, 2008 Free Software Foundation, Inc.
4 Contributed by Aldy Hernandez <aldyh@redhat.com>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 /* The format of this file is
23 DEFGSCODE(GIMPLE_symbol, printable name, structure).
25 Where symbol is the enumeration name without the ``GIMPLE_''.
26 The argument STRUCTURE is used to compute offsets into each of the
27 tuple structures that contain operands. Since vector operands
28 are at different offsets depending on the particular structure
29 used, these offsets are computed at compile time for efficient
30 lookup at runtime. See gimple_ops().
32 If a code does not use operand vectors, STRUCTURE should be NULL. */
34 /* Error marker. This is used in similar ways as ERROR_MARK in tree.def. */
35 DEFGSCODE(GIMPLE_ERROR_MARK, "gimple_error_mark", NULL)
37 /* IMPORTANT. Do not rearrange the codes between GIMPLE_COND and
38 GIMPLE_RETURN. The ordering is exposed by gimple_has_ops calls.
39 These are all the GIMPLE statements with register operands. */
41 /* GIMPLE_COND <COND_CODE, OP1, OP2, TRUE_LABEL, FALSE_LABEL>
42 represents the conditional jump:
44 if (OP1 COND_CODE OP2) goto TRUE_LABEL else goto FALSE_LABEL
46 COND_CODE is the tree code used as the comparison predicate. It
47 must be of class tcc_comparison.
49 OP1 and OP2 are the operands used in the comparison. They must be
50 accepted by is_gimple_operand.
52 TRUE_LABEL and FALSE_LABEL are the LABEL_DECL nodes used as the
53 jump target for the comparison. */
54 DEFGSCODE(GIMPLE_COND, "gimple_cond", struct gimple_statement_with_ops)
56 /* GIMPLE_DEBUG represents a debug statement. */
57 DEFGSCODE(GIMPLE_DEBUG, "gimple_debug", struct gimple_statement_with_ops)
59 /* GIMPLE_GOTO <TARGET> represents unconditional jumps.
60 TARGET is a LABEL_DECL or an expression node for computed GOTOs. */
61 DEFGSCODE(GIMPLE_GOTO, "gimple_goto", struct gimple_statement_with_ops)
63 /* GIMPLE_LABEL <LABEL> represents label statements. LABEL is a
64 LABEL_DECL representing a jump target. */
65 DEFGSCODE(GIMPLE_LABEL, "gimple_label", struct gimple_statement_with_ops)
67 /* GIMPLE_SWITCH <INDEX, DEFAULT_LAB, LAB1, ..., LABN> represents the
68 multiway branch:
70 switch (INDEX)
72 case LAB1: ...; break;
73 ...
74 case LABN: ...; break;
75 default: ...
78 INDEX is the variable evaluated to decide which label to jump to.
80 DEFAULT_LAB, LAB1 ... LABN are the tree nodes representing case labels.
81 They must be CASE_LABEL_EXPR nodes. */
82 DEFGSCODE(GIMPLE_SWITCH, "gimple_switch", struct gimple_statement_with_ops)
84 /* IMPORTANT.
86 Do not rearrange the codes between GIMPLE_ASSIGN and GIMPLE_RETURN.
87 It's exposed by GIMPLE_RANGE_CHECK calls. These are all the GIMPLE
88 statements with memory and register operands. */
90 /* GIMPLE_ASSIGN <SUBCODE, LHS, RHS1[, RHS2]> represents the assignment
91 statement
93 LHS = RHS1 SUBCODE RHS2.
95 SUBCODE is the tree code for the expression computed by the RHS of the
96 assignment. It must be one of the tree codes accepted by
97 get_gimple_rhs_class. If LHS is not a gimple register according to
98 is_gimple_reg, SUBCODE must be of class GIMPLE_SINGLE_RHS.
100 LHS is the operand on the LHS of the assignment. It must be a tree node
101 accepted by is_gimple_lvalue.
103 RHS1 is the first operand on the RHS of the assignment. It must always be
104 present. It must be a tree node accepted by is_gimple_val.
106 RHS2 is the second operand on the RHS of the assignment. It must be a tree
107 node accepted by is_gimple_val. This argument exists only if SUBCODE is
108 of class GIMPLE_BINARY_RHS. */
109 DEFGSCODE(GIMPLE_ASSIGN, "gimple_assign",
110 struct gimple_statement_with_memory_ops)
112 /* GIMPLE_ASM <STRING, I1, ..., IN, O1, ... OM, C1, ..., CP>
113 represents inline assembly statements.
115 STRING is the string containing the assembly statements.
116 I1 ... IN are the N input operands.
117 O1 ... OM are the M output operands.
118 C1 ... CP are the P clobber operands. */
119 DEFGSCODE(GIMPLE_ASM, "gimple_asm", struct gimple_statement_asm)
121 /* GIMPLE_CALL <FN, LHS, ARG1, ..., ARGN[, CHAIN]> represents function
122 calls.
124 FN is the callee. It must be accepted by is_gimple_call_addr.
126 LHS is the operand where the return value from FN is stored. It may
127 be NULL.
129 ARG1 ... ARGN are the arguments. They must all be accepted by
130 is_gimple_operand.
132 CHAIN is the optional static chain link for nested functions. */
133 DEFGSCODE(GIMPLE_CALL, "gimple_call",
134 struct gimple_statement_with_memory_ops)
136 /* GIMPLE_RETURN <RETVAL> represents return statements.
138 RETVAL is the value to return or NULL. If a value is returned it
139 must be accepted by is_gimple_operand. */
140 DEFGSCODE(GIMPLE_RETURN, "gimple_return",
141 struct gimple_statement_with_memory_ops)
143 /* GIMPLE_BIND <VARS, BLOCK, BODY> represents a lexical scope.
144 VARS is the set of variables declared in that scope.
145 BLOCK is the symbol binding block used for debug information.
146 BODY is the sequence of statements in the scope. */
147 DEFGSCODE(GIMPLE_BIND, "gimple_bind", NULL)
149 /* GIMPLE_CATCH <TYPES, HANDLER> represents a typed exception handler.
150 TYPES is the type (or list of types) handled. HANDLER is the
151 sequence of statements that handle these types. */
152 DEFGSCODE(GIMPLE_CATCH, "gimple_catch", NULL)
154 /* GIMPLE_EH_FILTER <TYPES, FAILURE> represents an exception
155 specification. TYPES is a list of allowed types and FAILURE is the
156 sequence of statements to execute on failure. */
157 DEFGSCODE(GIMPLE_EH_FILTER, "gimple_eh_filter", NULL)
159 /* GIMPLE_PHI <RESULT, ARG1, ..., ARGN> represents the PHI node
161 RESULT = PHI <ARG1, ..., ARGN>
163 RESULT is the SSA name created by this PHI node.
165 ARG1 ... ARGN are the arguments to the PHI node. N must be
166 exactly the same as the number of incoming edges to the basic block
167 holding the PHI node. Every argument is either an SSA name or a
168 tree node of class tcc_constant. */
169 DEFGSCODE(GIMPLE_PHI, "gimple_phi", NULL)
171 /* GIMPLE_RESX <REGION> resumes execution after an exception.
172 REGION is the region number being left. */
173 DEFGSCODE(GIMPLE_RESX, "gimple_resx", NULL)
175 /* GIMPLE_TRY <TRY_KIND, EVAL, CLEANUP>
176 represents a try/catch or a try/finally statement.
178 TRY_KIND is either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY.
180 EVAL is the sequence of statements to execute on entry to GIMPLE_TRY.
182 CLEANUP is the sequence of statements to execute according to
183 TRY_KIND. If TRY_KIND is GIMPLE_TRY_CATCH, CLEANUP is only exected
184 if an exception is thrown during execution of EVAL. If TRY_KIND is
185 GIMPLE_TRY_FINALLY, CLEANUP is always executed after executing EVAL
186 (regardless of whether EVAL finished normally, or jumped out or an
187 exception was thrown). */
188 DEFGSCODE(GIMPLE_TRY, "gimple_try", NULL)
190 /* GIMPLE_NOP represents the "do nothing" statement. */
191 DEFGSCODE(GIMPLE_NOP, "gimple_nop", NULL)
194 /* IMPORTANT.
196 Do not rearrange any of the GIMPLE_OMP_* codes. This ordering is
197 exposed by the range check in gimple_omp_subcode(). */
200 /* Tuples used for lowering of OMP_ATOMIC. Although the form of the OMP_ATOMIC
201 expression is very simple (just in form mem op= expr), various implicit
202 conversions may cause the expression to become more complex, so that it does
203 not fit the gimple grammar very well. To overcome this problem, OMP_ATOMIC
204 is rewritten as a sequence of two codes in gimplification:
206 GIMPLE_OMP_LOAD (tmp, mem)
207 val = some computations involving tmp;
208 GIMPLE_OMP_STORE (val). */
209 DEFGSCODE(GIMPLE_OMP_ATOMIC_LOAD, "gimple_omp_atomic_load", NULL)
210 DEFGSCODE(GIMPLE_OMP_ATOMIC_STORE, "gimple_omp_atomic_store", NULL)
212 /* GIMPLE_OMP_CONTINUE marks the location of the loop or sections
213 iteration in partially lowered OpenMP code. */
214 DEFGSCODE(GIMPLE_OMP_CONTINUE, "gimple_omp_continue", NULL)
216 /* GIMPLE_OMP_CRITICAL <NAME, BODY> represents
218 #pragma omp critical [name]
220 NAME is the name given to the critical section.
221 BODY is the sequence of statements that are inside the critical section. */
222 DEFGSCODE(GIMPLE_OMP_CRITICAL, "gimple_omp_critical", NULL)
224 /* GIMPLE_OMP_FOR <BODY, CLAUSES, INDEX, INITIAL, FINAL, COND, INCR, PRE_BODY>
225 represents
227 PRE_BODY
228 #pragma omp for [clause1 ... clauseN]
229 for (INDEX = INITIAL; INDEX COND FINAL; INDEX {+=,-=} INCR)
230 BODY
232 BODY is the loop body.
234 CLAUSES is the list of clauses.
236 INDEX must be an integer or pointer variable, which is implicitly thread
237 private. It must be accepted by is_gimple_operand.
239 INITIAL is the initial value given to INDEX. It must be
240 accepted by is_gimple_operand.
242 FINAL is the final value that INDEX should take. It must
243 be accepted by is_gimple_operand.
245 COND is the condition code for the controlling predicate. It must
246 be one of { <, >, <=, >= }
248 INCR is the loop index increment. It must be tree node of type
249 tcc_constant.
251 PRE_BODY is a landing pad filled by the gimplifier with things from
252 INIT, COND, and INCR that are technically part of the OMP_FOR
253 structured block, but are evaluated before the loop body begins.
255 INITIAL, FINAL and INCR are required to be loop invariant integer
256 expressions that are evaluated without any synchronization.
257 The evaluation order, frequency of evaluation and side-effects are
258 unspecified by the standard. */
259 DEFGSCODE(GIMPLE_OMP_FOR, "gimple_omp_for", NULL)
261 /* GIMPLE_OMP_MASTER <BODY> represents #pragma omp master.
262 BODY is the sequence of statements to execute in the master section. */
263 DEFGSCODE(GIMPLE_OMP_MASTER, "gimple_omp_master", NULL)
265 /* GIMPLE_OMP_ORDERED <BODY> represents #pragma omp ordered.
266 BODY is the sequence of statements to execute in the ordered section. */
267 DEFGSCODE(GIMPLE_OMP_ORDERED, "gimple_omp_ordered", NULL)
269 /* GIMPLE_OMP_PARALLEL <BODY, CLAUSES, CHILD_FN, DATA_ARG> represents
271 #pragma omp parallel [CLAUSES]
272 BODY
274 BODY is a the sequence of statements to be executed by all threads.
276 CLAUSES is a TREE_LIST node with all the clauses.
278 CHILD_FN is set when outlining the body of the parallel region.
279 All the statements in BODY are moved into this newly created
280 function when converting OMP constructs into low-GIMPLE.
282 DATA_ARG is a local variable in the parent function containing data
283 to be shared with CHILD_FN. This is used to implement all the data
284 sharing clauses. */
285 DEFGSCODE(GIMPLE_OMP_PARALLEL, "gimple_omp_parallel", NULL)
287 /* GIMPLE_OMP_TASK <BODY, CLAUSES, CHILD_FN, DATA_ARG, COPY_FN,
288 ARG_SIZE, ARG_ALIGN> represents
290 #pragma omp task [CLAUSES]
291 BODY
293 BODY is a the sequence of statements to be executed by all threads.
295 CLAUSES is a TREE_LIST node with all the clauses.
297 CHILD_FN is set when outlining the body of the explicit task region.
298 All the statements in BODY are moved into this newly created
299 function when converting OMP constructs into low-GIMPLE.
301 DATA_ARG is a local variable in the parent function containing data
302 to be shared with CHILD_FN. This is used to implement all the data
303 sharing clauses.
305 COPY_FN is set when outlining the firstprivate var initialization.
306 All the needed statements are emitted into the newly created
307 function, or when only memcpy is needed, it is NULL.
309 ARG_SIZE and ARG_ALIGN are the size and alignment of the incoming
310 data area allocated by GOMP_task and passed to CHILD_FN. */
311 DEFGSCODE(GIMPLE_OMP_TASK, "gimple_omp_task", NULL)
313 /* OMP_RETURN marks the end of an OpenMP directive. */
314 DEFGSCODE(GIMPLE_OMP_RETURN, "gimple_omp_return", NULL)
316 /* OMP_SECTION <BODY> represents #pragma omp section.
317 BODY is the sequence of statements in the section body. */
318 DEFGSCODE(GIMPLE_OMP_SECTION, "gimple_omp_section", NULL)
320 /* OMP_SECTIONS <BODY, CLAUSES, CONTROL> represents #pragma omp sections.
322 BODY is the sequence of statements in the sections body.
323 CLAUSES is a TREE_LIST node holding the list of associated clauses.
324 CONTROL is a VAR_DECL used for deciding which of the sections
325 to execute. */
326 DEFGSCODE(GIMPLE_OMP_SECTIONS, "gimple_omp_sections", NULL)
328 /* GIMPLE_OMP_SECTIONS_SWITCH is a marker placed immediately after
329 OMP_SECTIONS. It represents the GIMPLE_SWITCH used to decide which
330 branch is taken. */
331 DEFGSCODE(GIMPLE_OMP_SECTIONS_SWITCH, "gimple_omp_sections_switch", NULL)
333 /* GIMPLE_OMP_SINGLE <BODY, CLAUSES> represents #pragma omp single
334 BODY is the sequence of statements inside the single section.
335 CLAUSES is a TREE_LIST node holding the associated clauses. */
336 DEFGSCODE(GIMPLE_OMP_SINGLE, "gimple_omp_single", NULL)
338 /* GIMPLE_PREDICT <PREDICT, OUTCOME> specifies a hint for branch prediction.
340 PREDICT is one of the predictors from predict.def.
342 OUTCOME is NOT_TAKEN or TAKEN. */
343 DEFGSCODE(GIMPLE_PREDICT, "gimple_predict", NULL)
345 /* This node represents a cleanup expression. It is ONLY USED INTERNALLY
346 by the gimplifier as a placeholder for cleanups, and its uses will be
347 cleaned up by the time gimplification is done.
349 This tuple should not exist outside of the gimplifier proper. */
350 DEFGSCODE(GIMPLE_WITH_CLEANUP_EXPR, "gimple_with_cleanup_expr", NULL)