Commit 5af4cb6f authored by Matthias Braun's avatar Matthias Braun
Browse files

rename set_using_visited to set_using_irn_visited, some cosmetics, remove...

rename set_using_visited to set_using_irn_visited, some cosmetics, remove obsolete irflag functions from public headers

[r17400]
parent e1bef3be
......@@ -58,16 +58,6 @@ typedef unsigned optimization_state_t;
void set_optimize (int value);
int get_optimize(void);
/** This function enables/disables output of information about phases and
* controls the verbosity level.
*
* 0: no output at all.
* 1: very short output
* >>1: very verbose output.
*/
void set_firm_verbosity (int value);
int get_firm_verbosity (void);
/** Enables/Disables constant folding optimization.
*
* If opt_constant_folding == 1 perform
......@@ -78,29 +68,10 @@ int get_firm_verbosity (void);
*/
void set_opt_constant_folding (int value);
/** Enables/Disables loop unrolling.
*
* If opt_loop_unrolling == 1 perform loop_unrolling.
* See loop_unrolling.h.
*
* Default: opt_loop_unrolling = 1;
*/
void set_opt_loop_unrolling (int value);
/** Enables/Disables output of information about loop unrolling.
*/
void set_opt_loop_unrolling_verbose (int value);
/** Enables/Disables removal of redundant Loads and Stores.
*
* - Remove Store that overwrites a just stored value (WAW).
* - Remove Store if it stores a value just loaded (WAR with the same value).
* - Remove Load that loads a value just saved (RAW with the same value).
* - remove Load that loads a value already loaded (RAR)
* - replace Load of constant values with constants (RC)
*/
void set_opt_redundant_loadstore(int value);
/** Enables/Disables common subexpression elimination.
*
* If opt_cse == 1 perform common subexpression elimination.
......@@ -163,35 +134,6 @@ void set_opt_control_flow_weak_simplification(int value);
/** Enables/Disables strong if and loop simplification (in optimize_cf). */
void set_opt_control_flow_strong_simplification(int value);
/** Enables/Disables reassociation.
*
* If opt_reassociation == 1 reassociation is performed.
* Default: opt_reassociation == 1.
*/
void set_opt_reassociation(int value);
/** Enables/Disables dead node elimination.
*
* If opt_dead_node_elimination == 1 deallocate all dead nodes
* by copying the firm graph.
* Default: opt_dead_node_elimination == 1. */
void set_opt_dead_node_elimination (int value);
/** Enables/Disables dead method elimination.
*
* If opt_dead_method_elimination == 1 methods never called are
* removed.
* Default: opt_dead_method_elimination == 1.
*/
void set_opt_dead_method_elimination (int value);
void set_opt_dead_method_elimination_verbose (int value);
/** Enable/Disables method inlining.
*
* If opt_inline == 1 the inlining transformation is performed.
*/
void set_opt_inline (int value);
/** Enable/Disable optimization of dynamic method dispatch.
*
* This flag enables/disables the optimization of dynamic method dispatch.
......@@ -217,14 +159,6 @@ void set_opt_optimize_class_casts_verbose (int value);
void set_opt_suppress_downcast_optimization(int value);
int get_opt_suppress_downcast_optimization(void);
/** Enable/Disable optimization of tail-recursion calls.
*
* This flag enables/disables the optimization tail-recursion call.
* If the flag is turned on tail-recursion calls are optimized into loops.
*/
void set_opt_tail_recursion(int value);
void set_opt_tail_recursion_verbose(int value);
/** Enable/Disable floating of fragile ops.
*
* This flags enables/disables the floating of fragile operations.
......@@ -234,16 +168,6 @@ void set_opt_tail_recursion_verbose(int value);
*/
void set_opt_fragile_ops(int value);
/**
* Enable/Disable function call optimization.
*
* Function call optimization detects const and pure functions and
* allows the CSE of Call nodes. A const function is one that
* do only evaluate it's parameters and did not read or write memory
* to compute its results. Pure functions are allowed to read global memory.
*/
void set_opt_function_call(int value);
/**
* Enable/Disable Confirm node removal during local optimization.
*/
......
......@@ -515,9 +515,9 @@ void set_irg_block_visited(ir_graph *irg, unsigned long i);
void set_using_block_visited(ir_graph *irg);
void clear_using_block_visited(ir_graph *irg);
int using_block_visited(const ir_graph *irg);
void set_using_visited(ir_graph *irg);
void clear_using_visited(ir_graph *irg);
int using_visited(const ir_graph *irg);
void set_using_irn_visited(ir_graph *irg);
void clear_using_irn_visited(ir_graph *irg);
int using_irn_visited(const ir_graph *irg);
void set_using_irn_link(ir_graph *irg);
void clear_using_irn_link(ir_graph *irg);
int using_irn_link(const ir_graph *irg);
......
......@@ -283,7 +283,7 @@ void insert_new(HashSet *self, unsigned hash, ValueType value)
HashSetEntry *entry = & self->entries[bucknum];
if(EntryIsEmpty(*entry)) {
size_t p;
size_t p;
HashSetEntry *nentry;
if(insert_pos != ILLEGAL_POS) {
......@@ -388,7 +388,7 @@ void maybe_shrink(HashSet *self)
return;
self->consider_shrink = 0;
size = hashset_size(self);
size = hashset_size(self);
if(size <= HT_MIN_BUCKETS)
return;
......
......@@ -362,7 +362,7 @@ static blocksched_entry_t *finish_block_schedule(blocksched_env_t *env)
ir_node *startblock = get_irg_start_block(irg);
blocksched_entry_t *entry = get_irn_link(startblock);
set_using_visited(irg);
set_using_irn_visited(irg);
inc_irg_visited(irg);
env->worklist = new_pdeq();
......@@ -370,7 +370,7 @@ static blocksched_entry_t *finish_block_schedule(blocksched_env_t *env)
assert(pdeq_empty(env->worklist));
del_pdeq(env->worklist);
clear_using_visited(irg);
clear_using_irn_visited(irg);
return entry;
}
......@@ -714,7 +714,7 @@ static ir_node **create_extbb_block_schedule(ir_graph *irg, ir_exec_freq *execfr
list.n_blks = 0;
set_using_irn_link(irg);
set_using_visited(irg);
set_using_irn_visited(irg);
inc_irg_block_visited(irg);
create_block_list(get_irg_start_block(irg), &list);
......@@ -728,7 +728,7 @@ static ir_node **create_extbb_block_schedule(ir_graph *irg, ir_exec_freq *execfr
}
clear_using_irn_link(irg);
clear_using_visited(irg);
clear_using_irn_visited(irg);
return blk_list;
}
......
......@@ -155,6 +155,8 @@ typedef int decide_func_t(const co_mst_irn_t *node, int col);
*/
static void dbg_aff_chunk(const co_mst_env_t *env, const aff_chunk_t *c) {
int i, l;
(void) env;
if (c->weight_consistent)
ir_fprintf(stderr, " $%d ", c->weight);
ir_fprintf(stderr, "{");
......
......@@ -235,7 +235,7 @@ int be_remove_empty_blocks(ir_graph *irg)
blocks_removed = 0;
set_using_visited(irg);
set_using_irn_visited(irg);
inc_irg_visited(irg);
remove_empty_block(get_irg_end_block(irg));
end = get_irg_end(irg);
......@@ -246,7 +246,7 @@ int be_remove_empty_blocks(ir_graph *irg)
continue;
remove_empty_block(pred);
}
clear_using_visited(irg);
clear_using_irn_visited(irg);
if (blocks_removed) {
/* invalidate analysis info */
......
......@@ -322,13 +322,13 @@ static void displace(workset_t *new_vals, int is_usage)
ir_nodeset_insert(&used, val);
if (! workset_contains(ws, val)) {
DBG((dbg, DBG_DECIDE, " insert %+F\n", val));
DB((dbg, DBG_DECIDE, " insert %+F\n", val));
if (is_usage) {
DBG((dbg, DBG_SPILL, "Reload %+F before %+F\n", val, instr));
DB((dbg, DBG_SPILL, "Reload %+F before %+F\n", val, instr));
be_add_reload(senv, val, instr, cls, 1);
}
} else {
DBG((dbg, DBG_DECIDE, " %+F already in workset\n", val));
DB((dbg, DBG_DECIDE, " %+F already in workset\n", val));
assert(is_usage);
/* remove the value from the current workset so it is not accidently
* spilled */
......@@ -347,7 +347,7 @@ static void displace(workset_t *new_vals, int is_usage)
ir_node *curr_bb = get_nodes_block(instr);
workset_t *ws_start = get_block_info(curr_bb)->start_workset;
DBG((dbg, DBG_DECIDE, " disposing %d values\n", spills_needed));
DB((dbg, DBG_DECIDE, " disposing %d values\n", spills_needed));
/* calculate current next-use distance for live values */
for (i = 0; i < len; ++i) {
......@@ -365,7 +365,7 @@ static void displace(workset_t *new_vals, int is_usage)
for (i = len - spills_needed; i < len; ++i) {
ir_node *val = ws->vals[i].node;
DBG((dbg, DBG_DECIDE, " disposing node %+F (%u)\n", val,
DB((dbg, DBG_DECIDE, " disposing node %+F (%u)\n", val,
workset_get_time(ws, i)));
if(!USES_IS_INFINITE(ws->vals[i].time)
......@@ -375,7 +375,7 @@ static void displace(workset_t *new_vals, int is_usage)
if (!is_Phi(val) && ! ir_nodeset_contains(&used, val)) {
workset_remove(ws_start, val);
DBG((dbg, DBG_DECIDE, " (and removing %+F from start workset)\n", val));
DB((dbg, DBG_DECIDE, " (and removing %+F from start workset)\n", val));
}
}
......@@ -417,7 +417,7 @@ static loc_t to_take_or_not_to_take(ir_node* first, ir_node *node,
/* We have to keep nonspillable nodes in the workingset */
if(arch_irn_get_flags(arch_env, node) & arch_irn_flags_dont_spill) {
loc.time = 0;
DBG((dbg, DBG_START, " %+F taken (dontspill node)\n", node, loc.time));
DB((dbg, DBG_START, " %+F taken (dontspill node)\n", node, loc.time));
return loc;
}
......@@ -426,7 +426,7 @@ static loc_t to_take_or_not_to_take(ir_node* first, ir_node *node,
// the nodes marked as live in shouldn't be dead, so it must be a phi
assert(is_Phi(node));
loc.time = USES_INFINITY;
DBG((dbg, DBG_START, " %+F not taken (dead)\n", node));
DB((dbg, DBG_START, " %+F not taken (dead)\n", node));
if(is_Phi(node)) {
be_spill_phi(senv, node);
}
......@@ -436,10 +436,10 @@ static loc_t to_take_or_not_to_take(ir_node* first, ir_node *node,
loc.time = next_use.time;
if(next_use.outermost_loop >= get_loop_depth(loop)) {
DBG((dbg, DBG_START, " %+F taken (%u, loop %d)\n", node, loc.time, next_use.outermost_loop));
DB((dbg, DBG_START, " %+F taken (%u, loop %d)\n", node, loc.time, next_use.outermost_loop));
} else {
loc.time = USES_PENDING;
DBG((dbg, DBG_START, " %+F delayed (outerloopdepth %d < loopdetph %d)\n", node, next_use.outermost_loop, get_loop_depth(loop)));
DB((dbg, DBG_START, " %+F delayed (outerloopdepth %d < loopdetph %d)\n", node, next_use.outermost_loop, get_loop_depth(loop)));
}
return loc;
}
......@@ -469,7 +469,7 @@ static void compute_live_ins(const ir_node *block)
starters = NEW_ARR_F(loc_t, 0);
delayed = NEW_ARR_F(loc_t, 0);
DBG((dbg, DBG_START, "Living at start of %+F:\n", block));
DB((dbg, DBG_START, "Living at start of %+F:\n", block));
first = sched_first(block);
/* check all Phis first */
......@@ -514,7 +514,7 @@ static void compute_live_ins(const ir_node *block)
qsort(delayed, ARR_LEN(delayed), sizeof(delayed[0]), loc_compare);
for (i = 0; i < ARR_LEN(delayed) && i < free_slots; ++i) {
DBG((dbg, DBG_START, " delayed %+F taken\n", delayed[i].node));
DB((dbg, DBG_START, " delayed %+F taken\n", delayed[i].node));
ARR_APP1(loc_t, starters, delayed[i]);
delayed[i].node = NULL;
}
......@@ -527,7 +527,7 @@ static void compute_live_ins(const ir_node *block)
if(node == NULL || !is_Phi(node) || get_nodes_block(node) != block)
continue;
DBG((dbg, DBG_START, " spilling delayed phi %+F\n", node));
DB((dbg, DBG_START, " spilling delayed phi %+F\n", node));
be_spill_phi(senv, node);
}
DEL_ARR_F(delayed);
......@@ -548,7 +548,7 @@ static void compute_live_ins(const ir_node *block)
if (! is_Phi(node) || get_nodes_block(node) != block)
continue;
DBG((dbg, DBG_START, " spilling phi %+F\n", node));
DB((dbg, DBG_START, " spilling phi %+F\n", node));
be_spill_phi(senv, node);
}
......@@ -663,22 +663,22 @@ static void belady(ir_node *block)
compute_live_ins(block);
}
DBG((dbg, DBG_DECIDE, "\n"));
DBG((dbg, DBG_DECIDE, "Decide for %+F\n", block));
DB((dbg, DBG_DECIDE, "\n"));
DB((dbg, DBG_DECIDE, "Decide for %+F\n", block));
block_info = new_block_info();
set_block_info(block, block_info);
DBG((dbg, DBG_WSETS, "Start workset for %+F:\n", block));
DB((dbg, DBG_WSETS, "Start workset for %+F:\n", block));
workset_foreach(ws, irn, iter) {
DBG((dbg, DBG_WSETS, " %+F (%u)\n", irn,
DB((dbg, DBG_WSETS, " %+F (%u)\n", irn,
workset_get_time(ws, iter)));
}
block_info->start_workset = workset_clone(ws);
/* process the block from start to end */
DBG((dbg, DBG_WSETS, "Processing...\n"));
DB((dbg, DBG_WSETS, "Processing...\n"));
ir_nodeset_init(&used);
instr_nr = 0;
/* TODO: this leaks (into the obstack)... */
......@@ -692,7 +692,7 @@ static void belady(ir_node *block)
if (is_Phi(irn)) {
continue;
}
DBG((dbg, DBG_DECIDE, " ...%+F\n", irn));
DB((dbg, DBG_DECIDE, " ...%+F\n", irn));
/* set instruction in the workset */
instr = irn;
......@@ -733,9 +733,9 @@ static void belady(ir_node *block)
/* Remember end-workset for this block */
block_info->end_workset = workset_clone(ws);
DBG((dbg, DBG_WSETS, "End workset for %+F:\n", block));
DB((dbg, DBG_WSETS, "End workset for %+F:\n", block));
workset_foreach(ws, irn, iter)
DBG((dbg, DBG_WSETS, " %+F (%u)\n", irn,
DB((dbg, DBG_WSETS, " %+F (%u)\n", irn,
workset_get_time(ws, iter)));
/* add successor blocks into worklist */
......@@ -758,8 +758,8 @@ static void fix_block_borders(ir_node *block, void *data)
int iter;
(void) data;
DBG((dbg, DBG_FIX, "\n"));
DBG((dbg, DBG_FIX, "Fixing %+F\n", block));
DB((dbg, DBG_FIX, "\n"));
DB((dbg, DBG_FIX, "Fixing %+F\n", block));
start_workset = get_block_info(block)->start_workset;
......@@ -770,7 +770,7 @@ static void fix_block_borders(ir_node *block, void *data)
workset_t *pred_end_workset = get_block_info(pred)->end_workset;
ir_node *node;
DBG((dbg, DBG_FIX, " Pred %+F\n", pred));
DB((dbg, DBG_FIX, " Pred %+F\n", pred));
/* spill all values not used anymore */
workset_foreach(pred_end_workset, node, iter) {
......@@ -793,7 +793,7 @@ static void fix_block_borders(ir_node *block, void *data)
&& !pred_end_workset->vals[iter].reloaded) {
ir_node *insert_point
= be_get_end_of_block_insertion_point(pred);
DBG((dbg, DBG_SPILL, "Spill %+F before %+F\n", node,
DB((dbg, DBG_SPILL, "Spill %+F before %+F\n", node,
insert_point));
be_add_spill(senv, node, insert_point);
}
......@@ -817,8 +817,8 @@ static void fix_block_borders(ir_node *block, void *data)
continue;
/* node is not in memory at the end of pred -> reload it */
DBG((dbg, DBG_FIX, " reload %+F\n", node));
DBG((dbg, DBG_SPILL, "Reload %+F before %+F,%d\n", node, block, i));
DB((dbg, DBG_FIX, " reload %+F\n", node));
DB((dbg, DBG_SPILL, "Reload %+F before %+F,%d\n", node, block, i));
be_add_reload_on_edge(senv, node, block, i, cls, 1);
}
}
......
......@@ -390,7 +390,7 @@ static void be_spill_linearscan(be_irg_t *birg,
obstack_init(&obst);
set_using_visited(irg);
set_using_irn_visited(irg);
set_using_irn_link(irg);
inc_irg_visited(irg);
......@@ -407,7 +407,7 @@ static void be_spill_linearscan(be_irg_t *birg,
do_spilling();
clear_using_visited(irg);
clear_using_irn_visited(irg);
clear_using_irn_link(irg);
DEL_ARR_F(intervals);
......
......@@ -292,7 +292,7 @@ void be_ssa_construction_init(be_ssa_construction_env_t *env, be_irg_t *birg)
env->min_dom = INT_MAX;
env->max_dom = 0;
set_using_visited(irg);
set_using_irn_visited(irg);
set_using_block_visited(irg);
set_using_irn_link(irg);
......@@ -310,7 +310,7 @@ void be_ssa_construction_destroy(be_ssa_construction_env_t *env)
del_waitq(env->worklist);
DEL_ARR_F(env->new_phis);
clear_using_visited(env->irg);
clear_using_irn_visited(env->irg);
clear_using_block_visited(env->irg);
clear_using_irn_link(env->irg);
......
......@@ -560,7 +560,7 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env,
ir_nodemap_init(&env.spill_infos);
assure_doms(irg);
set_using_visited(irg);
set_using_irn_visited(irg);
set_using_irn_link(irg);
inc_irg_visited(irg);
......@@ -570,7 +570,7 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env,
/* fix block end_states that don't match the next blocks start_state */
irg_block_walk_graph(irg, fix_block_borders, NULL, &env);
clear_using_visited(irg);
clear_using_irn_visited(irg);
clear_using_irn_link(irg);
/* reconstruct ssa-form */
......
......@@ -180,7 +180,7 @@ static const lc_opt_table_entry_t ia32_architecture_options[] = {
&fp_unit_var),
LC_OPT_ENT_NEGBIT("nooptcc", "do not optimize calling convention",
&opt_cc, 1),
LC_OPT_ENT_BIT("unsafe_floatconv", "do unsage floating point controlword "
LC_OPT_ENT_BIT("unsafe_floatconv", "do unsafe floating point controlword "
"optimisations", &opt_unsafe_floatconv, 1),
LC_OPT_LAST
};
......
......@@ -36,3 +36,7 @@ int t2(int a) {
int t3(int a) {
return a*8 + 2;
}
int t4(int x, int y) {
return x + y + y;
}
......@@ -8,7 +8,8 @@ char *duff_copy(char *dst, const char *from, int count)
char *to = dst;
switch (count % 8){
case 0: do{ *to++ = *from++;
do {
case 0: *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to++ = *from++;
case 5: *to++ = *from++;
......
/* fmt and all further parameters must be passed on the stack even for regparams */
#include <stdio.h>
#include <stdarg.h>
static void f(const char* fmt, ...)
......
......@@ -48,6 +48,11 @@ int sub4(int x) {
return 6 - ~x;
}
int addmul(int x, int y)
{
}
int cmp1(int x, int y) {
return -x == -y;
}
......
......@@ -8,7 +8,9 @@ int main()
int i = 0,j = 0;
arraya *p;
p = (arraya*)calloc(1,sizeof(arraya));
(*p)[i][j] = 1;
(*p)
[i]
[j] = 1;
return 0;
}
......@@ -637,13 +637,13 @@ static ir_node **construct_block_lists(ir_graph *irg) {
#ifdef INTERPROCEDURAL_VIEW
int rem_view = get_interprocedural_view();
#endif
int walk_flag = using_visited(irg);
int walk_flag = using_irn_visited(irg);
ir_graph *rem = current_ir_graph;
current_ir_graph = irg;
if(walk_flag)
clear_using_visited(current_ir_graph);
clear_using_irn_visited(current_ir_graph);
for (i = get_irp_n_irgs() - 1; i >= 0; --i)
ird_set_irg_link(get_irp_irg(i), NULL);
......@@ -665,7 +665,7 @@ static ir_node **construct_block_lists(ir_graph *irg) {
#endif
if(walk_flag)
set_using_visited(current_ir_graph);
set_using_irn_visited(current_ir_graph);
current_ir_graph = rem;
return ird_get_irg_link(irg);
......
......@@ -904,18 +904,18 @@ int using_block_visited(const ir_graph *irg) {
}
void set_using_visited(ir_graph *irg) {
assert(irg->using_visited == 0);
irg->using_visited = 1;
void set_using_irn_visited(ir_graph *irg) {
assert(irg->using_irn_visited == 0);
irg->using_irn_visited = 1;
}
void clear_using_visited(ir_graph *irg) {
assert(irg->using_visited == 1);
irg->using_visited = 0;
void clear_using_irn_visited(ir_graph *irg) {
assert(irg->using_irn_visited == 1);
irg->using_irn_visited = 0;
}
int using_visited(const ir_graph *irg) {
return irg->using_visited;
int using_irn_visited(const ir_graph *irg) {
return irg->using_irn_visited;
}
......
......@@ -273,10 +273,10 @@ void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env)
pset_new_destroy(&irg_set);
} else {
#endif
set_using_visited(current_ir_graph);
set_using_irn_visited(current_ir_graph);
inc_irg_visited(current_ir_graph);
nodes_touched = irg_walk_2(node, pre, post, env);
clear_using_visited(current_ir_graph);
clear_using_irn_visited(current_ir_graph);
#ifdef INTERPROCEDURAL_VIEW
}
#endif
......@@ -425,10 +425,10 @@ void irg_walk_in_or_dep(ir_node *node, irg_walk_func *pre, irg_walk_func *post,
if (get_interprocedural_view()) {
assert(0 && "This is not yet implemented.");
} else {
set_using_visited(current_ir_graph);
set_using_irn_visited(current_ir_graph);
inc_irg_visited(current_ir_graph);
nodes_touched = irg_walk_in_or_dep_2(node, pre, post, env);
clear_using_visited(current_ir_graph);
clear_using_irn_visited(current_ir_graph);
}
return;
}
......
......@@ -371,7 +371,7 @@ do_irg_walk_blk(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *en
blks.follow_deps = follow_deps != 0;
/* first step: traverse the graph and fill the lists */
set_using_visited(irg);
set_using_irn_visited(irg);
inc_irg_visited(irg);
collect_walk(end_node, &blks);
......@@ -394,7 +394,7 @@ do_irg_walk_blk(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *en
#ifdef INTERPROCEDURAL_VIEW
set_interprocedural_view(old_view);
#endif
clear_using_visited(irg);
clear_using_irn_visited(irg);
}
void irg_walk_blkwise_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment