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 * File name: ir/opt/opt_polymorphy.h
23 * Purpose: Optimize polymorphic Sel and Load nodes.
27 * Copyright: (c) 2005 Universität Karlsruhe
32 * This file subsumes optimization code from cgana.
34 #ifndef _OPT_POLYMORPHY_H_
35 #define _OPT_POLYMORPHY_H_
37 #include "firm_types.h"
44 * Transform Sel(Alloc)[method]
45 * to SymC[method] under the following conditions:
47 * - opt_dyn_meth_dispatch must be set
48 * - the method is not overwritten OR
49 * - the dynamic type is known
51 ir_node *transform_node_Sel(ir_node *node);
53 /** Transform Load(Sel(Alloc)[constant static entity])
54 * to Const[constant static entity value].
56 * This function returns a node replacing the Proj(Load)[Value].
57 * If this is actually called in transform_node, we must build
58 * a tuple, or replace the Projs of the load.
59 * Therefore we call this optimization in ldstopt.
61 ir_node *transform_node_Load(ir_node *n);
67 #endif /* _OPT_POLYMORPHY_H_ */