3 * File name: ir/opt/ifconv.h
4 * Purpose: If conversion.
5 * Author: Sebastian Hack.
8 * Copyright: (c) 1998-2005 Universität Karlsruhe
9 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
11 #ifndef _FIRM_IF_CONV_H
12 #define _FIRM_IF_CONV_H
18 * @author Sebastian Hack
24 * This function is called to evaluate, if a mux can build
25 * of the current architecture.
26 * If it returns non-zero, a mux is created, else the code
28 * @param sel A selector of a Cond.
29 * @param false_res Selected value if condition is false.
30 * @param true_res Selected value if condition is true.
32 typedef int (*arch_allow_mux_func)(ir_node *sel, ir_node *false_res, ir_node *true_res);
35 * The parameters structure.
37 typedef struct _opt_if_conv_info_t {
38 int max_depth; /**< The maximum depth up to which expressions
39 are examined when it has to be decided if they
40 can be placed into another block. */
41 arch_allow_mux_func allow_mux; /**< Evaluator function, if not set all possible Mux
42 nodes will be created. */
46 * Perform If conversion on a graph.
48 * @param irg The graph.
49 * @param params The parameters for the if conversion.
51 * Cannot handle blocks with Bad control predecessors, so call it after control
54 void opt_if_conv(ir_graph *irg, const opt_if_conv_info_t *params);
56 #endif /* _FIRM_IF_CONV_H */