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 Optimize polymorphic Sel and Load nodes.
23 * @author Goetz Lindenmaier, Michael Beck
26 * This file subsumes optimization code from cgana.
28 #ifndef FIRM_OPT_OPT_POLYMORPHY_H
29 #define FIRM_OPT_OPT_POLYMORPHY_H
31 #include "firm_types.h"
38 * Transform Sel(Alloc)[method]
39 * to SymC[method] under the following conditions:
41 * - opt_dyn_meth_dispatch must be set
42 * - the method is not overwritten OR
43 * - the dynamic type is known
45 ir_node *transform_node_Sel(ir_node *node);
47 /** Transform Load(Sel(Alloc)[constant static entity])
48 * to Const[constant static entity value].
50 * This function returns a node replacing the Proj(Load)[Value].
51 * If this is actually called in transform_node, we must build
52 * a tuple, or replace the Projs of the load.
53 * Therefore we call this optimization in ldstopt.
55 ir_node *transform_node_Load(ir_node *n);
61 #endif /* FIRM_OPT_OPT_POLYMORPHY_H */