db8319041fc8d54e9cef85a9daa537afa325da4c
[libfirm] / ir / opt / cfopt.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /*
21  * Project:     libFIRM
22  * File name:   ir/opt/cfopt.h
23  * Purpose:     control flow optimizations
24  * Author:      Goetz Lindenmaier
25  * Created:
26  * CVS-ID:      $Id$
27  * Copyright:   (c) 1998-2004 Universität Karlsruhe
28  */
29
30 /**
31  * @file cfopt.h
32  *
33  * Control flow optimization.
34  *
35  * @author Goetz Lindenmaier
36  */
37 #ifndef _CFOPT_H_
38 #define _CFOPT_H_
39
40 #include "irgraph.h"
41
42 /** Control flow optimization.
43  *
44  * Removes empty blocks doing if simplifications and loop simplifications.
45  * A block is empty if it contains only a Jmp node and Phi nodes.
46  * Merges single entry single exit blocks with their predecessor
47  * and propagates dead control flow by calling equivalent_node().
48  * Independent of compiler flag it removes Tuples from cf edges,
49  * Bad predecessors from Blocks and Phis, and unnecessary predecessors of End.
50  *
51  * @bug So far destroys backedge information.
52  * @bug Chokes on Id nodes if called in a certain order with other
53  *      optimizations.  Call local_optimize_graph() before to remove
54  *      Ids.
55  */
56 void optimize_cf(ir_graph *irg);
57
58 #endif /* _CFOPT_H_ */