libFirm
iroptimize.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
3  *
4  * This file is part of libFirm.
5  *
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.
10  *
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.
14  *
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
17  * PURPOSE.
18  */
19 
24 #ifndef FIRM_IROPTIMIZE_H
25 #define FIRM_IROPTIMIZE_H
26 
27 #include "firm_types.h"
28 #include "nodeops.h"
29 #include "begin.h"
30 
47 FIRM_API void optimize_cf(ir_graph *irg);
48 
56 FIRM_API ir_graph_pass_t *optimize_cf_pass(const char *name);
57 
64 
73 
80 FIRM_API void opt_bool(ir_graph *irg);
81 
89 FIRM_API ir_graph_pass_t *opt_bool_pass(const char *name);
90 
96 FIRM_API void conv_opt(ir_graph *irg);
97 
105 FIRM_API ir_graph_pass_t *conv_opt_pass(const char *name);
106 
111 typedef int (*check_alloc_entity_func)(ir_entity *ent);
112 
121  check_alloc_entity_func callback);
122 
145 FIRM_API void escape_analysis(int run_scalar_replace,
146  check_alloc_entity_func callback);
147 
170 FIRM_API void optimize_funccalls(void);
171 
179 
189 FIRM_API void do_gvn_pre(ir_graph *irg);
190 
198 FIRM_API ir_graph_pass_t *do_gvn_pre_pass(const char *name);
199 
211 typedef int (*arch_allow_ifconv_func)(ir_node *sel, ir_node *mux_false,
212  ir_node *mux_true);
213 
222 FIRM_API void opt_if_conv(ir_graph *irg);
223 
231 FIRM_API ir_graph_pass_t *opt_if_conv_pass(const char *name);
232 
239 
248 
261 
288 
297 
303 FIRM_API void opt_ldst(ir_graph *irg);
304 
312 FIRM_API ir_graph_pass_t *opt_ldst_pass(const char *name);
313 
324 
335 FIRM_API void opt_frame_irg(ir_graph *irg);
336 
344 FIRM_API ir_graph_pass_t *opt_frame_irg_pass(const char *name);
345 
347 typedef enum osr_flags {
354 } osr_flags;
355 
357 #define osr_flag_default osr_flag_lftr_with_ov_check
358 
417 FIRM_API void opt_osr(ir_graph *irg, unsigned flags);
418 
427 FIRM_API ir_graph_pass_t *opt_osr_pass(const char *name, unsigned flags);
428 
440 
449 
450 
452 #define DEFAULT_CLONE_THRESHOLD 20
453 
465 FIRM_API void proc_cloning(float threshold);
466 
475 FIRM_API ir_prog_pass_t *proc_cloning_pass(const char *name, float threshold);
476 
492 
501 
523 
532 
554 
563 
572 
581 
597 
606 
618 FIRM_API void opt_tail_recursion(void);
619 
628 
631 typedef ir_type *(*gen_pointer_type_to_func)(ir_type *tp);
632 
659 
668  gen_pointer_type_to_func gppt_fct);
669 
690 FIRM_API void optimize_class_casts(void);
691 
701 FIRM_API void combo(ir_graph *irg);
702 
710 FIRM_API ir_graph_pass_t *combo_pass(const char *name);
711 
731 FIRM_API void inline_small_irgs(ir_graph *irg, int size);
732 
741 FIRM_API ir_graph_pass_t *inline_small_irgs_pass(const char *name, int size);
742 
766 FIRM_API void inline_leaf_functions(unsigned maxsize, unsigned leafsize,
767  unsigned size, int ignore_runtime);
768 
785  unsigned maxsize, unsigned leafsize, unsigned size,
786  int ignore_runtime);
787 
789 typedef void (*opt_ptr)(ir_graph *irg);
790 
802 FIRM_API void inline_functions(unsigned maxsize, int inline_threshold,
803  opt_ptr after_inline_opt);
804 
821  unsigned maxsize, int inline_threshold, opt_ptr after_inline_opt);
822 
828 FIRM_API void shape_blocks(ir_graph *irg);
829 
837 FIRM_API ir_graph_pass_t *shape_blocks_pass(const char *name);
838 
845 
852 
857 
865 FIRM_API ir_graph_pass_t *loop_inversion_pass(const char *name);
866 
874 FIRM_API ir_graph_pass_t *loop_unroll_pass(const char *name);
875 
883 FIRM_API ir_graph_pass_t *loop_peeling_pass(const char *name);
884 
892 FIRM_API ir_graph_pass_t *set_vrp_pass(const char *name);
893 
903 
906 
927 
936 
971 FIRM_API int inline_method(ir_node *call, ir_graph *called_graph);
972 
987 FIRM_API void place_code(ir_graph *irg);
988 
998 FIRM_API ir_graph_pass_t *place_code_pass(const char *name);
999 
1006 
1019 
1030 FIRM_API int value_not_zero(const ir_node *n, const ir_node **confirm);
1031 
1045 FIRM_API int value_not_null(const ir_node *n, const ir_node **confirm);
1046 
1055 
1065  const ir_node *cmp, ir_node *left, ir_node *right, ir_relation relation);
1066 
1068 typedef ir_entity *(*compilerlib_entity_creator_t)(ident *id, ir_type *mt);
1069 
1077 
1080 
1089 
1092 #include "end.h"
1093 
1094 #endif