2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
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.
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.
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
22 * @brief Control flow optimizations.
23 * @author Goetz Lindenmaier, Michael Beck, Sebastian Hack
26 #ifndef FIRM_OPT_CFOPT_H
27 #define FIRM_OPT_CFOPT_H
31 /** Control flow optimization.
33 * Removes empty blocks doing if simplifications and loop simplifications.
34 * A block is empty if it contains only a Jmp node and Phi nodes.
35 * Merges single entry single exit blocks with their predecessor
36 * and propagates dead control flow by calling equivalent_node().
37 * Independent of compiler flag it removes Tuples from cf edges,
38 * Bad predecessors from Blocks and Phis, and unnecessary predecessors of End.
40 * @bug So far destroys backedge information.
41 * @bug Chokes on Id nodes if called in a certain order with other
42 * optimizations. Call local_optimize_graph() before to remove
45 void optimize_cf(ir_graph *irg);
47 #endif /* FIRM_OPT_CFOPT_H */