libFirm 1.20
libfirm/iroptimize.h File Reference

Available Optimisations of libFirm. More...

#include "firm_types.h"
#include "nodeops.h"
#include "begin.h"
#include "end.h"

Go to the source code of this file.

Defines

#define osr_flag_default   osr_flag_lftr_with_ov_check
 default setting
#define DEFAULT_CLONE_THRESHOLD   20
 A default threshold.

Typedefs

typedef int(* check_alloc_entity_func )(ir_entity *ent)
 A callback that checks whether a entity is an allocation routine.
typedef int(* arch_allow_ifconv_func )(ir_node *sel, ir_node *mux_false, ir_node *mux_true)
 This function is called to evaluate, if a mux(sel, mux_false, mux_true) should be built for the current architecture.
typedef ir_type *(* gen_pointer_type_to_func )(ir_type *tp)
 This is the type for a method, that returns a pointer type to tp.
typedef void(* opt_ptr )(ir_graph *irg)
 pointer to an optimization function
typedef ir_entity *(* compilerlib_entity_creator_t )(ident *id, ir_type *mt)
 Type of callbacks for createing entities of the compiler library.

Enumerations

enum  osr_flags { osr_flag_none = 0, osr_flag_lftr_with_ov_check = 1, osr_flag_ignore_x86_shift = 2, osr_flag_keep_reg_pressure = 4 }
 Possible flags for the Operator Scalar Replacement. More...

Functions

void optimize_cf (ir_graph *irg)
 Control flow optimization.
ir_graph_pass_toptimize_cf_pass (const char *name)
 Creates an ir_graph pass for optimize_cf().
void opt_jumpthreading (ir_graph *irg)
 Perform path-sensitive jump threading on the given graph.
ir_graph_pass_topt_jumpthreading_pass (const char *name)
 Creates an ir_graph pass for opt_jumpthreading().
void opt_bool (ir_graph *irg)
 Simplifies boolean expression in the given ir graph.
ir_graph_pass_topt_bool_pass (const char *name)
 Creates an ir_graph pass for opt_bool().
int conv_opt (ir_graph *irg)
 Reduces the number of Conv nodes in the given ir graph.
ir_graph_pass_tconv_opt_pass (const char *name)
 Creates an ir_graph pass for conv_opt().
void escape_enalysis_irg (ir_graph *irg, check_alloc_entity_func callback)
 Performs simple and fast escape analysis for one graph.
void escape_analysis (int run_scalar_replace, check_alloc_entity_func callback)
 Performs simple and fast escape analysis for all graphs.
void optimize_funccalls (void)
 Optimize function calls by handling const functions.
ir_prog_pass_toptimize_funccalls_pass (const char *name)
 Creates an ir_prog pass for optimize_funccalls().
void do_gvn_pre (ir_graph *irg)
 Does Partial Redundancy Elimination combined with Global Value Numbering.
ir_graph_pass_tdo_gvn_pre_pass (const char *name)
 Creates an ir_graph pass for do_gvn_pre().
void opt_if_conv (ir_graph *irg)
 Perform If conversion on a graph.
ir_graph_pass_topt_if_conv_pass (const char *name)
 Creates an ir_graph pass for opt_if_conv().
void opt_parallelize_mem (ir_graph *irg)
 Tries to reduce dependencies for memory nodes where possible by parallelizing them and synchronizing with Sync nodes.
ir_graph_pass_topt_parallelize_mem_pass (const char *name)
 Creates an ir_graph pass for opt_sync().
ir_nodecan_replace_load_by_const (const ir_node *load, ir_node *c)
 Check if we can replace the load by a given const from the const code irg.
int optimize_load_store (ir_graph *irg)
 Load/Store optimization.
ir_graph_pass_toptimize_load_store_pass (const char *name)
 Creates an ir_graph pass for optimize_load_store().
int opt_ldst (ir_graph *irg)
 New experimental alternative to optimize_load_store.
ir_graph_pass_topt_ldst_pass (const char *name)
 Creates an ir_graph pass for opt_ldst().
void loop_optimization (ir_graph *irg)
 Optimize loops by peeling or unrolling them if beneficial.
void opt_frame_irg (ir_graph *irg)
 Optimize the frame type of an irg by removing never touched entities.
ir_graph_pass_topt_frame_irg_pass (const char *name)
 Creates an ir_graph pass for opt_frame_irg().
void opt_osr (ir_graph *irg, unsigned flags)
 Performs the Operator Scalar Replacement optimization and linear function test replacement for loop control.
ir_graph_pass_topt_osr_pass (const char *name, unsigned flags)
 Creates an ir_graph pass for remove_phi_cycles().
void remove_phi_cycles (ir_graph *irg)
 Removes useless Phi cycles, i.e cycles of Phi nodes with only one non-Phi node.
ir_graph_pass_tremove_phi_cycles_pass (const char *name)
 Creates an ir_graph pass for remove_phi_cycles().
void proc_cloning (float threshold)
 Performs procedure cloning.
ir_prog_pass_tproc_cloning_pass (const char *name, float threshold)
 Creates an ir_prog pass for proc_cloning().
int optimize_reassociation (ir_graph *irg)
 Reassociation.
ir_graph_pass_toptimize_reassociation_pass (const char *name)
 Creates an ir_graph pass for optimize_reassociation().
void normalize_one_return (ir_graph *irg)
 Normalize the Returns of a graph by creating a new End block with One Return(Phi).
ir_graph_pass_tnormalize_one_return_pass (const char *name)
 Creates an ir_graph pass for normalize_one_return().
void normalize_n_returns (ir_graph *irg)
 Normalize the Returns of a graph by moving the Returns upwards as much as possible.
ir_graph_pass_tnormalize_n_returns_pass (const char *name)
 Creates an ir_graph pass for normalize_n_returns().
int scalar_replacement_opt (ir_graph *irg)
 Performs the scalar replacement optimization.
ir_graph_pass_tscalar_replacement_opt_pass (const char *name)
 Creates an ir_graph pass for scalar_replacement_opt().
int opt_tail_rec_irg (ir_graph *irg)
 Optimizes tail-recursion calls by converting them into loops.
ir_graph_pass_topt_tail_rec_irg_pass (const char *name)
 Creates an ir_graph pass for opt_tail_rec_irg().
void opt_tail_recursion (void)
 Optimize tail-recursion calls for all IR-Graphs.
ir_prog_pass_topt_tail_recursion_pass (const char *name)
 Creates an ir_prog pass for opt_tail_recursion().
void normalize_irp_class_casts (gen_pointer_type_to_func gppt_fct)
 Insert Casts so that class type casts conform exactly with the type hierarchy.
void normalize_irg_class_casts (ir_graph *irg, gen_pointer_type_to_func gppt_fct)
 Insert Casts so that class type casts conform exactly with the type hierarchy in given graph.
void optimize_class_casts (void)
 Optimize casting between class types.
void combo (ir_graph *irg)
 CLiff Click's combo algorithm from "Combining Analyses, combining Optimizations".
ir_graph_pass_tcombo_pass (const char *name)
 Creates an ir_graph pass for combo.
void inline_small_irgs (ir_graph *irg, int size)
 Inlines all small methods at call sites where the called address comes from a SymConst node that references the entity representing the called method.
ir_graph_pass_tinline_small_irgs_pass (const char *name, int size)
 Creates an ir_graph pass for inline_small_irgs().
void inline_leave_functions (unsigned maxsize, unsigned leavesize, unsigned size, int ignore_runtime)
 Inlineing with a different heuristic than inline_small_irgs().
ir_prog_pass_tinline_leave_functions_pass (const char *name, unsigned maxsize, unsigned leavesize, unsigned size, int ignore_runtime)
 Creates an ir_prog pass for inline_leave_functions().
void inline_functions (unsigned maxsize, int inline_threshold, opt_ptr after_inline_opt)
 Heuristic inliner.
ir_prog_pass_tinline_functions_pass (const char *name, unsigned maxsize, int inline_threshold, opt_ptr after_inline_opt)
 Creates an ir_prog pass for inline_functions().
int shape_blocks (ir_graph *irg)
 Combines congruent blocks into one.
ir_graph_pass_tshape_blocks_pass (const char *name)
 Creates an ir_graph pass for shape_blocks().
void do_loop_inversion (ir_graph *irg)
 Perform loop inversion on a given graph.
void do_loop_unrolling (ir_graph *irg)
 Perform loop unrolling on a given graph.
void do_loop_peeling (ir_graph *irg)
 Perform loop peeling on a given graph.
ir_graph_pass_tloop_inversion_pass (const char *name)
 Creates an ir_graph pass for loop inversion.
ir_graph_pass_tloop_unroll_pass (const char *name)
 Creates an ir_graph pass for loop unrolling.
ir_graph_pass_tloop_peeling_pass (const char *name)
 Creates an ir_graph pass for loop peeling.
ir_graph_pass_tset_vrp_pass (const char *name)
 Creates an ir_graph pass for set_vrp_data()
void garbage_collect_entities (void)
 Removes all entities which are unused.
ir_prog_pass_tgarbage_collect_entities_pass (const char *name)
 Pass for garbage_collect_entities.
void dead_node_elimination (ir_graph *irg)
 Performs dead node elimination by copying the ir graph to a new obstack.
ir_graph_pass_tdead_node_elimination_pass (const char *name)
 Creates an ir_graph pass for dead_node_elimination().
int inline_method (ir_node *call, ir_graph *called_graph)
 Inlines a method at the given call site.
void place_code (ir_graph *irg)
 Code Placement.
ir_graph_pass_tplace_code_pass (const char *name)
 Creates an ir_graph pass for place_code().
void fixpoint_vrp (ir_graph *)
 Determines information about the values of nodes and perform simplifications using this information.
ir_graph_pass_tfixpoint_vrp_irg_pass (const char *name)
 Creates an ir_graph pass for fixpoint_vrp().
int value_not_zero (const ir_node *n, const ir_node **confirm)
 Checks if the value of a node is != 0.
int value_not_null (const ir_node *n, const ir_node **confirm)
 Checks if the value of a node cannot represent a NULL pointer.
ir_value_classify_sign classify_value_sign (ir_node *n)
 Checks if the value of a node can be confirmed >= 0 or <= 0, If the mode of the value did not honor signed zeros, else check for >= 0 or < 0.
ir_tarvalcomputed_value_Cmp_Confirm (const ir_node *cmp, ir_node *left, ir_node *right, ir_relation relation)
 Returns the value of a Cmp if one or both predecessors are Confirm nodes.
void set_compilerlib_entity_creator (compilerlib_entity_creator_t cb)
 Sets the compilerlib entity creation callback that is used to create compilerlib function entities.
compilerlib_entity_creator_t get_compilerlib_entity_creator (void)
 Returns the compilerlib entity creation callback.
ir_entitycreate_compilerlib_entity (ident *id, ir_type *mt)
 Constructs the entity for a given function using the current compilerlib entity creation callback.

Detailed Description

Available Optimisations of libFirm.

Definition in file iroptimize.h.