ircfscc.c 17.1 KB
Newer Older
1
/*
Michael Beck's avatar
Michael Beck committed
2
 * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
Matthias Braun's avatar
Matthias Braun committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 *
 * This file is part of libFirm.
 *
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 *
 * Licensees holding valid libFirm Professional Edition licenses may use
 * this file in accordance with the libFirm Commercial License.
 * Agreement provided with the Software.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.
18
19
 */

Matthias Braun's avatar
Matthias Braun committed
20
21
22
23
24
25
26
27
28
/**
 * @file
 * @brief     Compute the strongly connected regions and build backedge/cfloop
 *            datastructures. A variation on the Tarjan algorithm. See also
 *            [Trapp:99], Chapter 5.2.1.2.
 * @author    Goetz Lindenmaier
 * @date      7.2002
 * @version   $Id$
 */
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "config.h"

#include <string.h>

#include "irloop_t.h"
#include "irnode_t.h"
#include "irgraph_t.h"
#include "array.h"
#include "pmap.h"
#include "irgwalk.h"
#include "irprog_t.h"
#include "irdump.h"

Götz Lindenmaier's avatar
Götz Lindenmaier committed
42
43
#define NO_CFLOOPS_WITHOUT_HEAD 1

44
45
46
47
48
49
50
51
52
53
54
/** The outermost graph the scc is computed for */
static ir_graph *outermost_ir_graph;
/** Current cfloop construction is working on. */
static ir_loop *current_loop;
/** Counts the number of allocated cfloop nodes.
 * Each cfloop node gets a unique number.
 * @todo What for? ev. remove.
 */
static int loop_node_cnt = 0;
/** Counter to generate depth first numbering of visited nodes. */
static int current_dfn = 1;
55
56

static int max_loop_depth = 0;
57

58
void link_to_reg_end(ir_node *n, void *env);
59
60
61
62
63
64
65
66
67

/**********************************************************************/
/* Node attributes                                                   **/
/**********************************************************************/

/**********************************************************************/
/* Node attributes needed for the construction.                      **/
/**********************************************************************/

Michael Beck's avatar
Michael Beck committed
68
69
70
71
/**
 * The SCC info. Additional fields for an ir-node needed for the
 * construction.
 */
72
typedef struct scc_info {
73
74
75
	int in_stack;          /**< Marks whether node is on the stack. */
	int dfn;               /**< Depth first search number. */
	int uplink;            /**< dfn number of ancestor. */
76
77
} scc_info;

78
/** Allocate a new scc_info on the given obstack */
79
80
static inline scc_info *new_scc_info(struct obstack *obst)
{
81
	return OALLOCZ(obst, scc_info);
82
83
}

Michael Beck's avatar
Michael Beck committed
84
85
86
/**
 * Marks the node n to be on the stack.
 */
87
88
static inline void mark_irn_in_stack(ir_node *n)
{
89
	scc_info *info = (scc_info*) get_irn_link(n);
90
	info->in_stack = 1;
91
92
}

Michael Beck's avatar
Michael Beck committed
93
94
95
/**
 * Marks the node n to be not on the stack.
 */
96
97
static inline void mark_irn_not_in_stack(ir_node *n)
{
98
	scc_info *info = (scc_info*) get_irn_link(n);
99
	info->in_stack = 0;
100
101
}

Michael Beck's avatar
Michael Beck committed
102
103
104
/**
 * Returns whether node n is on the stack.
 */
105
106
static inline int irn_is_in_stack(ir_node *n)
{
107
	scc_info *info = (scc_info*) get_irn_link(n);
108
	return info->in_stack;
109
110
}

Michael Beck's avatar
Michael Beck committed
111
112
113
/**
 * Sets node n uplink value.
 */
114
115
static inline void set_irn_uplink(ir_node *n, int uplink)
{
116
	scc_info *info = (scc_info*) get_irn_link(n);
117
	info->uplink = uplink;
118
119
}

Michael Beck's avatar
Michael Beck committed
120
121
122
/**
 * Return node n uplink value.
 */
123
124
static inline int get_irn_uplink(ir_node *n)
{
125
	scc_info *info = (scc_info*) get_irn_link(n);
126
	return info->uplink;
127
128
}

Michael Beck's avatar
Michael Beck committed
129
130
131
/**
 * Sets node n dfn value.
 */
132
133
static inline void set_irn_dfn(ir_node *n, int dfn)
{
134
	scc_info *info = (scc_info*) get_irn_link(n);
135
	info->dfn = dfn;
136
137
}

Michael Beck's avatar
Michael Beck committed
138
139
140
/**
 * Returns node n dfn value.
 */
141
142
static inline int get_irn_dfn(ir_node *n)
{
143
	scc_info *info = (scc_info*) get_irn_link(n);
144
	return info->dfn;
145
146
147
148
149
150
}

/**********************************************************************/
/* A stack.                                                          **/
/**********************************************************************/

151
152
153
154
/** An IR-node stack */
static ir_node **stack = NULL;
/** The top (index) of the IR-node stack */
static int tos = 0;
155

Michael Beck's avatar
Michael Beck committed
156
157
158
/**
 * Initializes the IR-node stack
 */
159
160
static inline void init_stack(void)
{
161
162
163
164
165
166
	if (stack) {
		ARR_RESIZE(ir_node *, stack, 1000);
	} else {
		stack = NEW_ARR_F(ir_node *, 1000);
	}
	tos = 0;
167
168
}

yb9976's avatar
yb9976 committed
169
170
171
172
173
174
static void finish_stack(void)
{
	DEL_ARR_F(stack);
	stack = NULL;
}

Michael Beck's avatar
Michael Beck committed
175
176
177
/**
 * Push a node n onto the IR-node stack.
 */
178
179
static inline void push(ir_node *n)
{
180
	if (tos == ARR_LEN(stack)) {
181
		size_t nlen = ARR_LEN(stack) * 2;
182
183
184
185
		ARR_RESIZE(ir_node *, stack, nlen);
	}
	stack[tos++] = n;
	mark_irn_in_stack(n);
186
187
}

Michael Beck's avatar
Michael Beck committed
188
189
190
/**
 * Pop a node from the IR-node stack and return it.
 */
191
192
static inline ir_node *pop(void)
{
193
194
195
	ir_node *n = stack[--tos];
	mark_irn_not_in_stack(n);
	return n;
196
197
}

Michael Beck's avatar
Michael Beck committed
198
199
200
201
/**
 * The nodes from tos up to n belong to the current loop.
 * Removes them from the stack and adds them to the current loop.
 */
202
203
static inline void pop_scc_to_loop(ir_node *n)
{
204
	ir_node *m;
205

206
207
208
209
210
211
212
	do {
		m = pop();
		loop_node_cnt++;
		set_irn_dfn(m, loop_node_cnt);
		add_loop_node(current_loop, m);
		set_irn_loop(m, current_loop);
	} while (m != n);
213
214
215
216
217
}

/* GL ??? my last son is my grandson???  Removes cfloops with no
   ir_nodes in them.  Such loops have only another loop as son. (Why
   can't they have two loops as sons? Does it never get that far? ) */
218
219
static void close_loop(ir_loop *l)
{
220
221
222
223
224
225
226
	int last = get_loop_n_elements(l) - 1;
	loop_element lelement = get_loop_element(l, last);
	ir_loop *last_son = lelement.son;

	if (get_kind(last_son) == k_ir_loop &&
	    get_loop_n_elements(last_son) == 1) {
		ir_loop *gson;
227

228
229
230
231
		lelement = get_loop_element(last_son, 0);
		gson = lelement.son;
		if (get_kind(gson) == k_ir_loop) {
			loop_element new_last_son;
232

233
234
235
			gson->outer_loop = l;
			new_last_son.son = gson;
			l->children[last] = new_last_son;
236

237
238
239
240
			/* the loop last_son is dead now, recover at least some memory */
			DEL_ARR_F(last_son->children);
		}
	}
241

242
	current_loop = l;
243
244
}

Michael Beck's avatar
Michael Beck committed
245
246
247
248
/**
 * Removes and unmarks all nodes up to n from the stack.
 * The nodes must be visited once more to assign them to a scc.
 */
249
250
static inline void pop_scc_unmark_visit(ir_node *n)
{
251
	ir_node *m;
252

253
254
255
256
	do {
		m = pop();
		set_irn_visited(m, 0);
	} while (m != n);
257
258
259
260
261
262
}

/**********************************************************************/
/* The loop datastructure.                                           **/
/**********************************************************************/

Michael Beck's avatar
Michael Beck committed
263
264
265
/**
 * Allocates a new loop as son of current_loop.  Sets current_loop
 * to the new loop and returns its father.
266
 * The loop is allocated on the outermost_ir_graphs's obstack.
Michael Beck's avatar
Michael Beck committed
267
 */
268
269
static ir_loop *new_loop(void)
{
270
271
	ir_loop *father = current_loop;
	ir_loop *son    = alloc_loop(father, outermost_ir_graph->obst);
272

273
	if (son->depth > max_loop_depth) max_loop_depth = son->depth;
274
275
	current_loop = son;
	return father;
276
277
278
279
280
281
282
283
}

/**********************************************************************/
/* Constructing and destructing the loop/backedge information.       **/
/**********************************************************************/

/* Initialization steps. **********************************************/

Michael Beck's avatar
Michael Beck committed
284
285
286
287
288
/**
 * Allocates a scc_info for every Block node n.
 * Clear the backedges for all nodes.
 * Called from a walker.
 */
289
290
static inline void init_node(ir_node *n, void *env)
{
291
	struct obstack *obst = (struct obstack*) env;
292
293
294
	if (is_Block(n))
		set_irn_link(n, new_scc_info(obst));
	clear_backedges(n);
295
296
}

Michael Beck's avatar
Michael Beck committed
297
/**
Michael Beck's avatar
Michael Beck committed
298
 * Initializes the common global settings for the scc algorithm
Michael Beck's avatar
Michael Beck committed
299
 */
300
301
static inline void init_scc_common(void)
{
302
303
304
	current_dfn   = 1;
	loop_node_cnt = 0;
	init_stack();
305
306
}

Michael Beck's avatar
Michael Beck committed
307
308
/**
 * Initializes the scc algorithm for the intraprocedural case.
309
 * Add scc info to every block node.
Michael Beck's avatar
Michael Beck committed
310
 */
311
312
static inline void init_scc(ir_graph *irg, struct obstack *obst)
{
313
314
	init_scc_common();
	irg_walk_graph(irg, init_node, NULL, obst);
315
316
}

317
static inline void finish_scc(void)
yb9976's avatar
yb9976 committed
318
319
320
321
{
	finish_stack();
}

Michael Beck's avatar
Michael Beck committed
322
323
324
325
/**
 * Condition for breaking the recursion: n is the block
 * that gets the initial control flow from the Start node.
 */
326
327
static int is_outermost_StartBlock(ir_node *n)
{
328
329
330
331
332
333
334
335
336
	/* Test whether this is the outermost Start node.  If so
	   recursion must end. */
	assert(is_Block(n));
	if (get_Block_n_cfgpreds(n) == 1  &&
	    is_Start(skip_Proj(get_Block_cfgpred(n, 0))) &&
	    get_Block_cfgpred_block(n, 0) == n) {
		return 1;
	}
	return 0;
337
338
}

339
/** Returns non-zero if n is a loop header, i.e., it is a Block node
340
341
 *  and has predecessors within the cfloop and out of the cfloop.
 *
Michael Beck's avatar
Michael Beck committed
342
 *  @param n     the block node to check
Michael Beck's avatar
Michael Beck committed
343
 *  @param root  only needed for assertion.
344
 */
345
346
static int is_head(ir_node *n, ir_node *root)
{
347
348
	int i, arity;
	int some_outof_loop = 0, some_in_loop = 0;
349
	(void) root;
350
351
352
353

	assert(is_Block(n));

	if (!is_outermost_StartBlock(n)) {
Michael Beck's avatar
Michael Beck committed
354
		arity = get_Block_n_cfgpreds(n);
355
		for (i = 0; i < arity; i++) {
356
357
358
359
360
361
			ir_node *pred = get_Block_cfgpred_block(n, i);
			/* ignore Bad control flow: it cannot happen */
			if (is_Bad(pred))
				continue;
			if (is_backedge(n, i))
				continue;
362
363
364
			if (!irn_is_in_stack(pred)) {
				some_outof_loop = 1;
			} else {
Michael Beck's avatar
Michael Beck committed
365
				assert(get_irn_uplink(pred) >= get_irn_uplink(root));
366
367
368
369
370
				some_in_loop = 1;
			}
		}
	}
	return some_outof_loop & some_in_loop;
371
372
}

Götz Lindenmaier's avatar
Götz Lindenmaier committed
373

Michael Beck's avatar
Michael Beck committed
374
/**
375
 * Returns non-zero if n is possible loop head of an endless loop.
376
 * I.e., it is a Block node and has only predecessors
Michael Beck's avatar
Michael Beck committed
377
 * within the loop.
Michael Beck's avatar
Michael Beck committed
378
379
380
 *
 * @param n     the block node to check
 * @param root  only needed for assertion.
Michael Beck's avatar
Michael Beck committed
381
 */
382
383
static int is_endless_head(ir_node *n, ir_node *root)
{
384
	int i, arity;
385
	int none_outof_loop = 1, some_in_loop = 0;
386
	(void) root;
387
388
389
390

	assert(is_Block(n));
	/* Test for legal loop header: Block, Phi, ... */
	if (!is_outermost_StartBlock(n)) {
Michael Beck's avatar
Michael Beck committed
391
		arity = get_Block_n_cfgpreds(n);
392
		for (i = 0; i < arity; i++) {
393
394
395
396
			ir_node *pred = get_Block_cfgpred_block(n, i);
			/* ignore Bad control flow: it cannot happen */
			if (is_Bad(pred))
				continue;
397
398
399
			if (is_backedge(n, i))
				continue;
			if (!irn_is_in_stack(pred)) {
400
				none_outof_loop = 0;
401
			} else {
Michael Beck's avatar
Michael Beck committed
402
				assert(get_irn_uplink(pred) >= get_irn_uplink(root));
403
404
405
406
				some_in_loop = 1;
			}
		}
	}
407
	return none_outof_loop && some_in_loop;
Götz Lindenmaier's avatar
Götz Lindenmaier committed
408
409
}

Michael Beck's avatar
Michael Beck committed
410
411
412
413
/**
 * Returns index of the predecessor with the smallest dfn number
 * greater-equal than limit.
 */
414
415
static int smallest_dfn_pred(ir_node *n, int limit)
{
416
417
418
	int i, index = -2, min = -1;

	if (!is_outermost_StartBlock(n)) {
Michael Beck's avatar
Michael Beck committed
419
		int arity = get_Block_n_cfgpreds(n);
420
		for (i = 0; i < arity; i++) {
421
422
423
424
			ir_node *pred = get_Block_cfgpred_block(n, i);
			/* ignore Bad control flow: it cannot happen */
			if (is_Bad(pred))
				continue;
425
426
427
428
429
430
431
432
433
			if (is_backedge(n, i) || !irn_is_in_stack(pred))
				continue;
			if (get_irn_dfn(pred) >= limit && (min == -1 || get_irn_dfn(pred) < min)) {
				index = i;
				min = get_irn_dfn(pred);
			}
		}
	}
	return index;
434
435
}

Michael Beck's avatar
Michael Beck committed
436
437
438
/**
 * Returns index of the predecessor with the largest dfn number.
 */
439
440
static int largest_dfn_pred(ir_node *n)
{
441
442
443
	int i, index = -2, max = -1;

	if (!is_outermost_StartBlock(n)) {
Michael Beck's avatar
Michael Beck committed
444
		int arity = get_Block_n_cfgpreds(n);
445
		for (i = 0; i < arity; i++) {
446
447
448
449
			ir_node *pred = get_Block_cfgpred_block(n, i);
			/* ignore Bad control flow: it cannot happen */
			if (is_Bad(pred))
				continue;
450
451
452
453
454
455
456
457
458
			if (is_backedge(n, i) || !irn_is_in_stack(pred))
				continue;
			if (get_irn_dfn(pred) > max) {
				index = i;
				max = get_irn_dfn(pred);
			}
		}
	}
	return index;
459
460
}

Michael Beck's avatar
Michael Beck committed
461
462
463
464
465
466
/**
 * Searches the stack for possible loop heads.  Tests these for backedges.
 * If it finds a head with an unmarked backedge it marks this edge and
 * returns the tail of the loop.
 * If it finds no backedge returns NULL.
 */
467
468
static ir_node *find_tail(ir_node *n)
{
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
	ir_node *m;
	int i, res_index = -2;

	m = stack[tos-1];  /* tos = top of stack */
	if (is_head(m, n)) {
		res_index = smallest_dfn_pred(m, 0);
		if ((res_index == -2) &&  /* no smallest dfn pred found. */
			(n ==  m))
			return NULL;
	} else {
		if (m == n)
			return NULL;
		for (i = tos-2; i >= 0; --i) {

			m = stack[i];
			if (is_head(m, n)) {
				res_index = smallest_dfn_pred(m, get_irn_dfn(m) + 1);
				if (res_index == -2)  /* no smallest dfn pred found. */
					res_index = largest_dfn_pred(m);

				if ((m == n) && (res_index == -2)) {
					i = -1;
				}
				break;
			}


			/* We should not walk past our selves on the stack:  The upcoming nodes
			   are not in this loop. We assume a loop not reachable from Start. */
			if (m == n) {
				i = -1;
				break;
			}
		}

		if (i < 0) {
			/* A dead loop not reachable from Start. */
			for (i = tos-2; i >= 0; --i) {
				m = stack[i];
508
				if (is_endless_head(m, n)) {
509
510
					res_index = smallest_dfn_pred (m, get_irn_dfn(m) + 1);
					if (res_index == -2)  /* no smallest dfn pred found. */
511
						res_index = largest_dfn_pred(m);
512
513
514
515
516
517
518
519
520
521
					break;
				}
				if (m == n) break;   /* It's not an unreachable loop, either. */
			}
			//assert(0 && "no head found on stack");
		}
	}
	assert(res_index > -2);

	set_backedge(m, res_index);
522
	return is_outermost_StartBlock(n) ? NULL : get_Block_cfgpred_block(m, res_index);
523
524
}

Michael Beck's avatar
Michael Beck committed
525
526
527
/**
 * returns non.zero if l is the outermost loop.
 */
528
529
inline static int is_outermost_loop(ir_loop *l)
{
530
	return l == get_loop_outer_loop(l);
Götz Lindenmaier's avatar
Götz Lindenmaier committed
531
532
}

533
534
535
536
/*-----------------------------------------------------------*
 *                   The core algorithm.                     *
 *-----------------------------------------------------------*/

Michael Beck's avatar
Michael Beck committed
537
538
539
/**
 * Walks over all blocks of a graph
 */
540
541
static void cfscc(ir_node *n)
{
542
543
544
545
	int i;

	assert(is_Block(n));

546
	if (irn_visited_else_mark(n)) return;
547
548
549
550
551
552
553
554
555

	/* Initialize the node */
	set_irn_dfn(n, current_dfn);      /* Depth first number for this node */
	set_irn_uplink(n, current_dfn);   /* ... is default uplink. */
	set_irn_loop(n, NULL);
	++current_dfn;
	push(n);

	if (!is_outermost_StartBlock(n)) {
556
		int arity = get_Block_n_cfgpreds(n);
557
558
559
560
561
562

		for (i = 0; i < arity; i++) {
			ir_node *m;

			if (is_backedge(n, i))
				continue;
563
564
565
566
			m = get_Block_cfgpred_block(n, i);
			/* ignore Bad control flow: it cannot happen */
			if (is_Bad(m))
				continue;
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595

			cfscc(m);
			if (irn_is_in_stack(m)) {
				/* Uplink of m is smaller if n->m is a backedge.
				   Propagate the uplink to mark the cfloop. */
				if (get_irn_uplink(m) < get_irn_uplink(n))
					set_irn_uplink(n, get_irn_uplink(m));
			}
		}
	}

	if (get_irn_dfn(n) == get_irn_uplink(n)) {
		/* This condition holds for
		   1) the node with the incoming backedge.
		      That is: We found a cfloop!
		   2) Straight line code, because no uplink has been propagated, so the
		      uplink still is the same as the dfn.

		   But n might not be a proper cfloop head for the analysis. Proper cfloop
		   heads are Block and Phi nodes. find_tail searches the stack for
		   Block's and Phi's and takes those nodes as cfloop heads for the current
		   cfloop instead and marks the incoming edge as backedge. */

		ir_node *tail = find_tail(n);
		if (tail) {
			/* We have a cfloop, that is no straight line code,
			   because we found a cfloop head!
			   Next actions: Open a new cfloop on the cfloop tree and
			   try to find inner cfloops */
596
597
598

#if NO_CFLOOPS_WITHOUT_HEAD

599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
			/* This is an adaption of the algorithm from fiasco / optscc to
			 * avoid cfloops without Block or Phi as first node.  This should
			 * severely reduce the number of evaluations of nodes to detect
			 * a fixpoint in the heap analysis.
			 * Further it avoids cfloops without firm nodes that cause errors
			 * in the heap analyses. */

			ir_loop *l;
			int close;
			if ((get_loop_n_elements(current_loop) > 0) || (is_outermost_loop(current_loop))) {
				l = new_loop();
				close = 1;
			} else {
				l = current_loop;
				close = 0;
			}
615
616
617

#else

618
			ir_loop *l = new_loop();
619
620
621

#endif

622
			/* Remove the cfloop from the stack ... */
623
			pop_scc_unmark_visit(n);
624

625
626
627
628
			/* The current backedge has been marked, that is temporarily eliminated,
			   by find tail. Start the scc algorithm
			   anew on the subgraph thats left (the current cfloop without the backedge)
			   in order to find more inner cfloops. */
629

630
			cfscc(tail);
631

632
			assert(irn_visited(n));
633
#if NO_CFLOOPS_WITHOUT_HEAD
634
			if (close)
635
#endif
636
637
638
639
640
641
642
643
644
				close_loop(l);
		} else {
			/* AS: No cfloop head was found, that is we have straight line code.
			       Pop all nodes from the stack to the current cfloop. */
			pop_scc_to_loop(n);
		}
	}
}

Michael Beck's avatar
Michael Beck committed
645
/* Constructs control flow backedge information for irg. */
646
647
int construct_cf_backedges(ir_graph *irg)
{
648
649
650
651
652
	ir_graph *rem = current_ir_graph;
	ir_loop *head_rem;
	ir_node *end = get_irg_end(irg);
	struct obstack temp;
	int i;
653

654
	max_loop_depth = 0;
655

656
657
	current_ir_graph   = irg;
	outermost_ir_graph = irg;
658

659
660
	obstack_init(&temp);
	init_scc(irg, &temp);
661

662
663
664
	current_loop = NULL;
	new_loop();  /* sets current_loop */
	head_rem = current_loop; /* Just for assertion */
665

666
	inc_irg_visited(irg);
667

668
669
670
671
672
673
674
	/* walk over all blocks of the graph, including keep alives */
	cfscc(get_irg_end_block(irg));
	for (i = get_End_n_keepalives(end) - 1; i >= 0; --i) {
		ir_node *el = get_End_keepalive(end, i);
		if (is_Block(el))
			cfscc(el);
	}
yb9976's avatar
yb9976 committed
675
	finish_scc();
Michael Beck's avatar
Michael Beck committed
676
	obstack_free(&temp, NULL);
677

678
	assert(head_rem == current_loop);
679
	mature_loops(current_loop, irg->obst);
680
681
682
	set_irg_loop(irg, current_loop);
	set_irg_loopinfo_state(irg, loopinfo_cf_consistent);
	assert(get_irg_loop(irg)->kind == k_ir_loop);
683

684
685
	current_ir_graph = rem;
	return max_loop_depth;
686
687
}

688
689
void assure_cf_loop(ir_graph *irg)
{
Michael Beck's avatar
Michael Beck committed
690
691
692
693
694
	irg_loopinfo_state state = get_irg_loopinfo_state(irg);

	if (state != loopinfo_cf_consistent)
		construct_cf_backedges(irg);
}