3 * File name: ir/opt/opt_polymorphy.h
4 * Purpose: Optimize polymorphic Sel and Load nodes.
8 * Copyright: (c) 2005 Universität Karlsruhe
9 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
14 * This file subsumes optimization code from cgana.
16 #ifndef _OPT_POLYMORPHY_H_
17 #define _OPT_POLYMORPHY_H_
19 #include "firm_types.h"
26 * Transform Sel(Alloc)[method]
27 * to SymC[method] under the following conditions:
29 * - opt_dyn_meth_dispatch must be set
30 * - the method is not overwritten OR
31 * - the dynamic type is known
33 ir_node *transform_node_Sel(ir_node *node);
35 /** Transform Load(Sel(Alloc)[constant static entity])
36 * to Const[constant static entity value].
38 * This function returns a node replacing the Proj(Load)[Value].
39 * If this is actually called in transform_node, we must build
40 * a tuple, or replace the Projs of the load.
41 * Therefore we call this optimization in ldstopt.
43 ir_node *transform_node_Load(ir_node *n);
49 #endif /* _OPT_POLYMORPHY_H_ */