Implement better magic to handle changing control dependencies when welding blocks
[libfirm] / ir / opt / cfopt.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/opt/cfopt.h
4  * Purpose:     control flow optimizations
5  * Author:      Goetz Lindenmaier
6  * Created:
7  * CVS-ID:      $Id$
8  * Copyright:   (c) 1998-2004 Universität Karlsruhe
9  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
10  */
11
12 /**
13  * @file cfopt.h
14  *
15  * Control flow optimization.
16  *
17  * @author Goetz Lindenmaier
18  */
19 #ifndef _CFOPT_H_
20 #define _CFOPT_H_
21
22 #include "irgraph.h"
23
24 /** Control flow optimization.
25  *
26  * Removes empty blocks doing if simplifications and loop simplifications.
27  * A block is empty if it contains only a Jmp node and Phi nodes.
28  * Merges single entry single exit blocks with their predecessor
29  * and propagates dead control flow by calling equivalent_node().
30  * Independent of compiler flag it removes Tuples from cf edges,
31  * Bad predecessors from Blocks and Phis, and unnecessary predecessors of End.
32  *
33  * @bug So far destroys backedge information.
34  * @bug Chokes on Id nodes if called in a certain order with other
35  *      optimizations.  Call local_optimize_graph() before to remove
36  *      Ids.
37  */
38 void optimize_cf(ir_graph *irg);
39
40 #endif /* _CFOPT_H_ */