Commit 1d13a49e authored by Matthias Braun's avatar Matthias Braun
Browse files

remove overly complicate pass management code

Nobody uses it currently, and it is a burden for everyone writing a new
pass.
parent 3b01f130
......@@ -38,7 +38,6 @@ libfirminclude_HEADERS = \
iropt.h \
iroptimize.h \
irouts.h \
irpass.h \
irprintf.h \
irprog.h \
irtypeinfo.h \
......
......@@ -209,12 +209,6 @@ FIRM_API const backend_params *be_get_backend_param(void);
*/
FIRM_API void be_lower_for_target(void);
/**
* Creates an ir_prog pass which performs lowerings necessary for the target
* architecture. (Calling backend_params->lower_for_target)
*/
FIRM_API ir_prog_pass_t *lower_for_target_pass(const char *name);
/**
* Main interface to the frontend.
*/
......
......@@ -96,7 +96,6 @@
#include "iropt.h"
#include "iroptimize.h"
#include "irouts.h"
#include "irpass.h"
#include "irprintf.h"
#include "irprog.h"
#include "irtypeinfo.h"
......
......@@ -87,16 +87,6 @@ typedef struct ir_entity ir_entity;
/** @ingroup ir_cdep
* Control Dependence Analysis Results */
typedef struct ir_cdep ir_cdep;
/** A graph transformation pass */
typedef struct ir_graph_pass_t ir_graph_pass_t;
/** A whole program transformation pass */
typedef struct ir_prog_pass_t ir_prog_pass_t;
/** A graph pass manager */
typedef struct ir_graph_pass_manager_t ir_graph_pass_manager_t;
/** A program pass manager */
typedef struct ir_prog_pass_manager_t ir_prog_pass_manager_t;
/** @ingroup ir_initializer
* Initializer (for entities) */
typedef union ir_initializer_t ir_initializer_t;
......
......@@ -23,18 +23,6 @@
*/
FIRM_API void stat_dump_snapshot(const char *fname, const char *phase);
/**
* Creates an ir_prog pass for stat_dump_snapshot().
*
* @param name the name of this pass or NULL
* @param fname base name of the statistic output file
* @param phase a phase name. Prefix will be firmstat-\<phase\>-
*
* @return the newly created ir_prog pass
*/
FIRM_API ir_prog_pass_t *stat_dump_snapshot_pass(
const char *name, const char *fname, const char *phase);
/**
* initialize the statistics module.
* Should be called directly after ir_init
......
......@@ -27,14 +27,6 @@
*/
FIRM_API void gc_irgs(size_t n_keep, ir_entity *keep_arr[]);
/**
* Creates an ir_prog pass for gc_irgs().
*
* @param name the name of this pass or NULL
* @return the newly created ir_graph pass
*/
FIRM_API ir_prog_pass_t *gc_irgs_pass(const char *name);
#include "end.h"
#endif
......@@ -37,15 +37,6 @@
*/
FIRM_API void construct_confirms(ir_graph *irg);
/**
* Creates an ir_graph pass for construct_confirms().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *construct_confirms_pass(const char *name);
/**
* Remove all Confirm nodes from a graph.
*
......@@ -54,15 +45,6 @@ FIRM_API ir_graph_pass_t *construct_confirms_pass(const char *name);
*/
FIRM_API void remove_confirms(ir_graph *irg);
/**
* Creates an ir_graph pass for remove_confirms().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *remove_confirms_pass(const char *name);
#include "end.h"
#endif
......@@ -113,17 +113,6 @@ FIRM_API const char *ir_get_dump_filter(void);
/** Returns true if dump file filter is not set, or if it is a prefix of name */
FIRM_API int ir_should_dump(const char *name);
/**
* Creates an ir_prog pass for dump_all_ir_graphs().
*
* @param name the name of this pass or NULL
* @param suffix A suffix for the file name.
*
* @return the newly created ir_prog pass
*/
FIRM_API ir_prog_pass_t *dump_all_ir_graph_pass(const char *name,
const char *suffix);
/*@}*/
/**
......
......@@ -200,17 +200,6 @@ FIRM_API int edges_verify_kind(ir_graph *irg, ir_edge_kind_t kind);
*/
FIRM_API void edges_init_dbg(int do_dbg);
/**
* Creates an ir_graph pass for edges_verify().
*
* @param name the name of this pass or NULL
* @param assert_on_problem assert if problems were found
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *irg_verify_edges_pass(const char *name,
unsigned assert_on_problem);
/**
* Activates data and block edges for an irg.
* If the irg phase is phase_backend, Dependence edges are
......
......@@ -85,15 +85,6 @@ FIRM_API void remove_bads(ir_graph *irg);
*/
FIRM_API void remove_tuples(ir_graph *irg);
/**
* Creates an ir_graph pass for optimize_graph_df().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *optimize_graph_df_pass(const char *name);
/** Places an empty basic block on critical control flow edges thereby
* removing them.
*
......
......@@ -230,15 +230,6 @@ FIRM_API void set_irp_memory_disambiguator_options(unsigned options);
*/
FIRM_API void mark_private_methods(void);
/**
* Creates an ir_prog pass for mark_private_methods().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_prog pass
*/
FIRM_API ir_prog_pass_t *mark_private_methods_pass(const char *name);
/** @} */
#include "end.h"
......
......@@ -31,15 +31,6 @@
*/
FIRM_API void optimize_cf(ir_graph *irg);
/**
* Creates an ir_graph pass for optimize_cf().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *optimize_cf_pass(const char *name);
/**
* Perform path-sensitive jump threading on the given graph.
*
......@@ -47,15 +38,6 @@ FIRM_API ir_graph_pass_t *optimize_cf_pass(const char *name);
*/
FIRM_API void opt_jumpthreading(ir_graph* irg);
/**
* Creates an ir_graph pass for opt_jumpthreading().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *opt_jumpthreading_pass(const char *name);
/**
* Simplifies boolean expression in the given ir graph.
* eg. x < 5 && x < 6 becomes x < 5
......@@ -64,15 +46,6 @@ FIRM_API ir_graph_pass_t *opt_jumpthreading_pass(const char *name);
*/
FIRM_API void opt_bool(ir_graph *irg);
/**
* Creates an ir_graph pass for opt_bool().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *opt_bool_pass(const char *name);
/**
* Reduces the number of Conv nodes in the given ir graph.
*
......@@ -80,15 +53,6 @@ FIRM_API ir_graph_pass_t *opt_bool_pass(const char *name);
*/
FIRM_API void conv_opt(ir_graph *irg);
/**
* Creates an ir_graph pass for conv_opt().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *conv_opt_pass(const char *name);
/**
* A callback that checks whether a entity is an allocation
* routine.
......@@ -154,14 +118,6 @@ FIRM_API void escape_analysis(int run_scalar_replace,
*/
FIRM_API void optimize_funccalls(void);
/**
* Creates an ir_prog pass for optimize_funccalls().
*
* @param name the name of this pass or NULL
* @return the newly created ir_prog pass
*/
FIRM_API ir_prog_pass_t *optimize_funccalls_pass(const char *name);
/**
* Does Partial Redundancy Elimination combined with
* Global Value Numbering.
......@@ -173,15 +129,6 @@ FIRM_API ir_prog_pass_t *optimize_funccalls_pass(const char *name);
*/
FIRM_API void do_gvn_pre(ir_graph *irg);
/**
* Creates an ir_graph pass for do_gvn_pre().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *do_gvn_pre_pass(const char *name);
/**
* This function is called to evaluate, if a
* mux(@p sel, @p mux_false, @p mux_true) should be built for the current
......@@ -206,15 +153,6 @@ typedef int (*arch_allow_ifconv_func)(ir_node *sel, ir_node *mux_false,
*/
FIRM_API void opt_if_conv(ir_graph *irg);
/**
* Creates an ir_graph pass for opt_if_conv().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *opt_if_conv_pass(const char *name);
/**
* Tries to reduce dependencies for memory nodes where possible by parallelizing
* them and synchronizing with Sync nodes
......@@ -222,15 +160,6 @@ FIRM_API ir_graph_pass_t *opt_if_conv_pass(const char *name);
*/
FIRM_API void opt_parallelize_mem(ir_graph *irg);
/**
* Creates an ir_graph pass for opt_sync().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *opt_parallelize_mem_pass(const char *name);
/**
* Check if we can replace the load by a given const from
* the const code irg.
......@@ -271,15 +200,6 @@ FIRM_API ir_node *can_replace_load_by_const(const ir_node *load, ir_node *c);
*/
FIRM_API void optimize_load_store(ir_graph *irg);
/**
* Creates an ir_graph pass for optimize_load_store().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *optimize_load_store_pass(const char *name);
/**
* New experimental alternative to optimize_load_store.
* Based on a dataflow analysis, so load/stores are moved out of loops
......@@ -287,15 +207,6 @@ FIRM_API ir_graph_pass_t *optimize_load_store_pass(const char *name);
*/
FIRM_API void opt_ldst(ir_graph *irg);
/**
* Creates an ir_graph pass for opt_ldst().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *opt_ldst_pass(const char *name);
/**
* Optimize loops by peeling or unrolling them if beneficial.
*
......@@ -319,15 +230,6 @@ FIRM_API void loop_optimization(ir_graph *irg);
*/
FIRM_API void opt_frame_irg(ir_graph *irg);
/**
* Creates an ir_graph pass for opt_frame_irg().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *opt_frame_irg_pass(const char *name);
/** Possible flags for the Operator Scalar Replacement. */
typedef enum osr_flags {
osr_flag_none = 0, /**< no additional flags */
......@@ -401,16 +303,6 @@ typedef enum osr_flags {
*/
FIRM_API void opt_osr(ir_graph *irg, unsigned flags);
/**
* Creates an ir_graph pass for remove_phi_cycles().
*
* @param name the name of this pass or NULL
* @param flags set of osr_flags
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *opt_osr_pass(const char *name, unsigned flags);
/**
* Removes useless Phi cycles, i.e cycles of Phi nodes with only one
* non-Phi node.
......@@ -423,16 +315,6 @@ FIRM_API ir_graph_pass_t *opt_osr_pass(const char *name, unsigned flags);
*/
FIRM_API void remove_phi_cycles(ir_graph *irg);
/**
* Creates an ir_graph pass for remove_phi_cycles().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *remove_phi_cycles_pass(const char *name);
/** A default threshold. */
#define DEFAULT_CLONE_THRESHOLD 20
......@@ -449,16 +331,6 @@ FIRM_API ir_graph_pass_t *remove_phi_cycles_pass(const char *name);
*/
FIRM_API void proc_cloning(float threshold);
/**
* Creates an ir_prog pass for proc_cloning().
*
* @param name the name of this pass or NULL
* @param threshold the threshold for cloning
*
* @return the newly created ir_prog pass
*/
FIRM_API ir_prog_pass_t *proc_cloning_pass(const char *name, float threshold);
/**
* Reassociation.
*
......@@ -475,15 +347,6 @@ FIRM_API ir_prog_pass_t *proc_cloning_pass(const char *name, float threshold);
*/
FIRM_API void optimize_reassociation(ir_graph *irg);
/**
* Creates an ir_graph pass for optimize_reassociation().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *optimize_reassociation_pass(const char *name);
/**
* Normalize the Returns of a graph by creating a new End block
* with One Return(Phi).
......@@ -506,15 +369,6 @@ FIRM_API ir_graph_pass_t *optimize_reassociation_pass(const char *name);
*/
FIRM_API void normalize_one_return(ir_graph *irg);
/**
* Creates an ir_graph pass for normalize_one_return().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *normalize_one_return_pass(const char *name);
/**
* Normalize the Returns of a graph by moving
* the Returns upwards as much as possible.
......@@ -537,15 +391,6 @@ FIRM_API ir_graph_pass_t *normalize_one_return_pass(const char *name);
*/
FIRM_API void normalize_n_returns(ir_graph *irg);
/**
* Creates an ir_graph pass for normalize_n_returns().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *normalize_n_returns_pass(const char *name);
/**
* Performs the scalar replacement optimization.
* Replaces local compound entities (like structures and arrays)
......@@ -555,15 +400,6 @@ FIRM_API ir_graph_pass_t *normalize_n_returns_pass(const char *name);
*/
FIRM_API void scalar_replacement_opt(ir_graph *irg);
/**
* Creates an ir_graph pass for scalar_replacement_opt().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *scalar_replacement_opt_pass(const char *name);
/**
* Optimizes tail-recursion calls by converting them into loops.
* Depends on the flag opt_tail_recursion.
......@@ -580,15 +416,6 @@ FIRM_API ir_graph_pass_t *scalar_replacement_opt_pass(const char *name);
*/
FIRM_API void opt_tail_rec_irg(ir_graph *irg);
/**
* Creates an ir_graph pass for opt_tail_rec_irg().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *opt_tail_rec_irg_pass(const char *name);
/**
* Optimize tail-recursion calls for all IR-Graphs.
* Can currently handle:
......@@ -602,15 +429,6 @@ FIRM_API ir_graph_pass_t *opt_tail_rec_irg_pass(const char *name);
*/
FIRM_API void opt_tail_recursion(void);
/**
* Creates an ir_prog pass for opt_tail_recursion().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_prog pass
*/
FIRM_API ir_prog_pass_t *opt_tail_recursion_pass(const char *name);
/**
* CLiff Click's combo algorithm from
* "Combining Analyses, combining Optimizations".
......@@ -622,15 +440,6 @@ FIRM_API ir_prog_pass_t *opt_tail_recursion_pass(const char *name);
*/
FIRM_API void combo(ir_graph *irg);
/**
* Creates an ir_graph pass for combo.
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *combo_pass(const char *name);
/** pointer to an optimization function */
typedef void (*opt_ptr)(ir_graph *irg);
......@@ -648,24 +457,6 @@ typedef void (*opt_ptr)(ir_graph *irg);
FIRM_API void inline_functions(unsigned maxsize, int inline_threshold,
opt_ptr after_inline_opt);
/**
* Creates an ir_prog pass for inline_functions().
*
* @param name the name of this pass or NULL
* @param maxsize Do not inline any calls if a method has more than
* maxsize firm nodes. It may reach this limit by
* inlineing.
* @param inline_threshold inlining threshold
* @param after_inline_opt a function that is called after inlining a
* procedure. You should run fast local optimisations
* here which cleanup the graph before further
* inlining
*
* @return the newly created ir_prog pass
*/
FIRM_API ir_prog_pass_t *inline_functions_pass(const char *name,
unsigned maxsize, int inline_threshold, opt_ptr after_inline_opt);
/**
* Combines congruent blocks into one.
*
......@@ -673,15 +464,6 @@ FIRM_API ir_prog_pass_t *inline_functions_pass(const char *name,
*/
FIRM_API void shape_blocks(ir_graph *irg);
/**
* Creates an ir_graph pass for shape_blocks().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *shape_blocks_pass(const char *name);
/**
* Perform loop inversion on a given graph.
* Loop inversion transforms a head controlled loop (like while(...) {} and
......@@ -701,42 +483,6 @@ FIRM_API void do_loop_unrolling(ir_graph *irg);
*/
FIRM_API void do_loop_peeling(ir_graph *irg);
/**
* Creates an ir_graph pass for loop inversion.
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *loop_inversion_pass(const char *name);
/**
* Creates an ir_graph pass for loop unrolling.
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *loop_unroll_pass(const char *name);
/**
* Creates an ir_graph pass for loop peeling.
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *loop_peeling_pass(const char *name);
/**
* Creates an ir_graph pass for set_vrp_data()
*
* @param name The name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *set_vrp_pass(const char *name);
/**
* Removes all entities which are unused.
*
......@@ -747,9 +493,6 @@ FIRM_API ir_graph_pass_t *set_vrp_pass(const char *name);
*/
FIRM_API void garbage_collect_entities(void);
/** Pass for garbage_collect_entities */
FIRM_API ir_prog_pass_t *garbage_collect_entities_pass(const char *name);
/**
* Performs dead node elimination by copying the ir graph to a new obstack.
*
......@@ -771,15 +514,6 @@ FIRM_API ir_prog_pass_t *garbage_collect_entities_pass(const char *name);
*/
FIRM_API void dead_node_elimination(ir_graph *irg);
/**
* Creates an ir_graph pass for dead_node_elimination().
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *dead_node_elimination_pass(const char *name);
/**
* Inlines a method at the given call site.
*
......@@ -832,17 +566,6 @@ FIRM_API int inline_method(ir_node *call, ir_graph *called_graph);
*/
FIRM_API void place_code(ir_graph *irg);
/**
* Creates an ir_graph pass for place_code().
* This pass enables GCSE, runs optimize_graph_df() and finally
* place_code();
*
* @param name the name of this pass or NULL
*
* @return the newly created ir_graph pass
*/
FIRM_API ir_graph_pass_t *place_code_pass(const char *name);
/**
* Determines information about the values of nodes and perform simplifications
* using this information. This optimization performs a data-flow analysis to
......@@ -856,19 +579,6 @@ FIRM_API void fixpoint_vrp(ir_graph*);
*/
FIRM_API void occult_consts(ir_graph*);
/**