Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
a141b05a
Commit
a141b05a
authored
Dec 02, 2012
by
Christoph Mallon
Browse files
cleanup: Remove end-of-if/for/function comments.
parent
62920488
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
ir/opt/combo.c
View file @
a141b05a
This diff is collapsed.
Click to expand it.
ir/opt/gvn_pre.c
View file @
a141b05a
...
...
@@ -214,7 +214,7 @@ static void dump_value_set(ir_valueset_t *set, const char *txt, ir_node *block)
++
i
;
}
DB
((
dbg
,
LEVEL_2
,
"
\n
}
\n
"
));
}
/* dump_value_set */
}
/**
* Dump all exp_gen value sets.
...
...
@@ -440,7 +440,7 @@ static void alloc_block_info(ir_node *block, pre_env *env)
info
->
next
=
env
->
list
;
env
->
list
=
info
;
}
/* alloc_block_info */
}
static
void
free_block_info
(
block_info
*
block_info
)
{
...
...
@@ -1228,7 +1228,7 @@ static void update_new_set(ir_node *block, ir_node *idom)
if
(
updated
)
dump_value_set
(
curr_info
->
avail_out
,
"Updated [Avail_out]"
,
block
);
#endif
}
/* update_new_set */
}
/**
* Checks if hoisting irn is greedy.
...
...
@@ -1806,7 +1806,7 @@ static void eliminate(ir_node *irn, void *ctx)
}
}
}
}
/* eliminate */
}
/**
* Do all the recorded changes and optimize
...
...
@@ -1856,7 +1856,7 @@ static void eliminate_nodes(elim_pair *pairs, ir_nodeset_t *keeps)
foreach_ir_nodeset
(
keeps
,
m_phi
,
iter
)
{
remove_End_keepalive
(
end
,
m_phi
);
}
}
/* eliminate_nodes */
}
/* --------------------------------------------------------
...
...
ir/opt/jumpthreading.c
View file @
a141b05a
...
...
@@ -789,4 +789,4 @@ void opt_jumpthreading(ir_graph* irg)
ir_graph_pass_t
*
opt_jumpthreading_pass
(
const
char
*
name
)
{
return
def_graph_pass
(
name
?
name
:
"jumpthreading"
,
opt_jumpthreading
);
}
/* opt_jumpthreading_pass */
}
ir/opt/ldstopt.c
View file @
a141b05a
...
...
@@ -113,7 +113,7 @@ static ldst_info_t *get_ldst_info(ir_node *node, struct obstack *obst)
set_irn_link
(
node
,
info
);
}
return
info
;
}
/* get_ldst_info */
}
/**
* get the Block info of a node
...
...
@@ -127,7 +127,7 @@ static block_info_t *get_block_info(ir_node *node, struct obstack *obst)
set_irn_link
(
node
,
info
);
}
return
info
;
}
/* get_block_info */
}
/**
* update the projection info for a Load/Store
...
...
@@ -147,7 +147,7 @@ static unsigned update_projs(ldst_info_t *info, ir_node *proj)
info
->
projs
[
nr
]
=
proj
;
return
0
;
}
}
/* update_projs */
}
/**
* update the exception block info for a Load/Store node.
...
...
@@ -163,7 +163,7 @@ static unsigned update_exc(ldst_info_t *info, ir_node *block, int pos)
info
->
exc_block
=
block
;
info
->
exc_idx
=
pos
;
return
0
;
}
/* update_exc */
}
/**
* walker, collects all Load/Store/Proj nodes
...
...
@@ -234,7 +234,7 @@ static void collect_nodes(ir_node *node, void *env)
}
}
}
}
/* collect_nodes */
}
/**
* Returns an entity if the address ptr points to a constant one.
...
...
@@ -322,7 +322,7 @@ static ir_entity *find_constant_entity(ir_node *ptr)
}
else
return
NULL
;
}
}
/* find_constant_entity */
}
/**
* Return the Selection index of a Sel node from dimension n
...
...
@@ -332,7 +332,7 @@ static long get_Sel_array_index_long(ir_node *n, int dim)
ir_node
*
index
=
get_Sel_index
(
n
,
dim
);
assert
(
is_Const
(
index
));
return
get_tarval_long
(
get_Const_tarval
(
index
));
}
/* get_Sel_array_index_long */
}
typedef
struct
path_entry
{
ir_entity
*
ent
;
...
...
@@ -547,7 +547,7 @@ static void handle_load_update(ir_node *load)
kill_node
(
load
);
reduce_adr_usage
(
ptr
);
}
}
/* handle_load_update */
}
/**
* A use of an address node has vanished. Check if this was a Proj
...
...
@@ -570,7 +570,7 @@ static void reduce_adr_usage(ir_node *ptr)
/* this node lost its result proj, handle that */
handle_load_update
(
pred
);
}
}
/* reduce_adr_usage */
}
/**
* Check, if an already existing value of mode old_mode can be converted
...
...
@@ -619,7 +619,7 @@ static unsigned is_Call_pure(ir_node *call)
}
}
return
(
prop
&
(
mtp_property_const
|
mtp_property_pure
))
!=
0
;
}
/* is_Call_pure */
}
static
ir_node
*
get_base_and_offset
(
ir_node
*
ptr
,
long
*
pOffset
)
{
...
...
@@ -909,7 +909,7 @@ static unsigned follow_Mem_chain(ir_node *load, ir_node *curr)
}
return
res
;
}
/* follow_Mem_chain */
}
ir_node
*
can_replace_load_by_const
(
const
ir_node
*
load
,
ir_node
*
c
)
{
...
...
@@ -1058,7 +1058,7 @@ static unsigned optimize_load(ir_node *load)
INC_MASTER
();
res
=
follow_Mem_chain
(
load
,
skip_Proj
(
mem
));
return
res
;
}
/* optimize_load */
}
/**
* Check whether a value of mode new_mode would completely overwrite a value
...
...
@@ -1067,7 +1067,7 @@ static unsigned optimize_load(ir_node *load)
static
int
is_completely_overwritten
(
ir_mode
*
old_mode
,
ir_mode
*
new_mode
)
{
return
get_mode_size_bits
(
new_mode
)
>=
get_mode_size_bits
(
old_mode
);
}
/* is_completely_overwritten */
}
/**
* Check whether small is a part of large (starting at same address).
...
...
@@ -1082,7 +1082,7 @@ static int is_partially_same(ir_node *small, ir_node *large)
&&
get_mode_size_bytes
(
sm
)
<
get_mode_size_bytes
(
lm
)
&&
get_mode_arithmetic
(
sm
)
==
irma_twos_complement
&&
get_mode_arithmetic
(
lm
)
==
irma_twos_complement
;
}
/* is_partially_same */
}
/**
* follow the memory chain as long as there are only Loads and alias free Stores.
...
...
@@ -1215,7 +1215,7 @@ static unsigned follow_Mem_chain_for_Store(ir_node *store, ir_node *curr)
}
}
return
res
;
}
/* follow_Mem_chain_for_Store */
}
/** find entity used as base for an address calculation */
static
ir_entity
*
find_entity
(
ir_node
*
ptr
)
...
...
@@ -1286,7 +1286,7 @@ static unsigned optimize_store(ir_node *store)
INC_MASTER
();
return
follow_Mem_chain_for_Store
(
store
,
skip_Proj
(
mem
));
}
/* optimize_store */
}
/* check if a node has more than one real user. Keepalive edges do not count as
* real users */
...
...
@@ -1500,7 +1500,7 @@ static unsigned optimize_phi(ir_node *phi, walk_env_t *wenv)
exchange
(
phi
,
projM
);
return
res
|
DF_CHANGED
;
}
/* optimize_phi */
}
static
int
optimize_conv_load
(
ir_node
*
conv
)
{
...
...
@@ -1568,7 +1568,7 @@ static void do_load_store_optimize(ir_node *n, void *env)
default:
break
;
}
}
/* do_load_store_optimize */
}
/** A scc. */
typedef
struct
scc
{
...
...
@@ -1610,7 +1610,7 @@ static node_entry *get_irn_ne(ir_node *irn, loop_env *env)
ir_nodehashmap_insert
(
&
env
->
map
,
irn
,
e
);
}
return
e
;
}
/* get_irn_ne */
}
/**
* Push a node onto the stack.
...
...
@@ -1629,7 +1629,7 @@ static void push(loop_env *env, ir_node *n)
env
->
stack
[
env
->
tos
++
]
=
n
;
e
=
get_irn_ne
(
n
,
env
);
e
->
in_stack
=
1
;
}
/* push */
}
/**
* pop a node from the stack
...
...
@@ -1645,7 +1645,7 @@ static ir_node *pop(loop_env *env)
e
->
in_stack
=
0
;
return
n
;
}
/* pop */
}
/**
* Check if irn is a region constant.
...
...
@@ -1659,7 +1659,7 @@ static int is_rc(ir_node *irn, ir_node *header_block)
ir_node
*
block
=
get_nodes_block
(
irn
);
return
(
block
!=
header_block
)
&&
block_dominates
(
block
,
header_block
);
}
/* is_rc */
}
typedef
struct
phi_entry
phi_entry
;
struct
phi_entry
{
...
...
@@ -1688,7 +1688,7 @@ static int cmp_avail_entry(const void *elt, const void *key, size_t size)
(
void
)
size
;
return
a
->
ptr
!=
b
->
ptr
||
a
->
mode
!=
b
->
mode
;
}
/* cmp_avail_entry */
}
/**
* Calculate the hash value of an avail entry.
...
...
@@ -1696,7 +1696,7 @@ static int cmp_avail_entry(const void *elt, const void *key, size_t size)
static
unsigned
hash_cache_entry
(
const
avail_entry_t
*
entry
)
{
return
get_irn_idx
(
entry
->
ptr
)
*
9
+
hash_ptr
(
entry
->
mode
);
}
/* hash_cache_entry */
}
/**
* Move loops out of loops if possible.
...
...
@@ -1829,7 +1829,7 @@ static void move_loads_out_of_loops(scc *pscc, loop_env *env)
}
}
del_set
(
avail
);
}
/* move_loads_out_of_loops */
}
/**
* Process a loop SCC.
...
...
@@ -1955,7 +1955,7 @@ static void process_loop(scc *pscc, loop_env *env)
fail:
;
}
/* process_loop */
}
/**
* Process a SCC.
...
...
@@ -1988,7 +1988,7 @@ static void process_scc(scc *pscc, loop_env *env)
/* this SCC has more than one member */
process_loop
(
pscc
,
env
);
}
}
/* process_scc */
}
/**
* Do Tarjan's SCC algorithm and drive load/store optimization.
...
...
@@ -2063,7 +2063,7 @@ static void dfs(ir_node *irn, loop_env *env)
process_scc
(
pscc
,
env
);
}
}
/* dfs */
}
/**
* Do the DFS on the memory edges a graph.
...
...
@@ -2105,7 +2105,7 @@ static void do_dfs(ir_graph *irg, loop_env *env)
if
(
is_Phi
(
ka
)
&&
!
irn_visited
(
ka
))
dfs
(
ka
,
env
);
}
}
/* do_dfs */
}
/**
* Optimize Loads/Stores in loops.
...
...
@@ -2132,7 +2132,7 @@ static int optimize_loops(ir_graph *irg)
ir_nodehashmap_destroy
(
&
env
.
map
);
return
env
.
changes
;
}
/* optimize_loops */
}
void
optimize_load_store
(
ir_graph
*
irg
)
{
...
...
@@ -2179,4 +2179,4 @@ void optimize_load_store(ir_graph *irg)
ir_graph_pass_t
*
optimize_load_store_pass
(
const
char
*
name
)
{
return
def_graph_pass
(
name
?
name
:
"ldst"
,
optimize_load_store
);
}
/* optimize_load_store_pass */
}
ir/opt/opt_blocks.c
View file @
a141b05a
...
...
@@ -170,7 +170,7 @@ static void dump_partition(const char *msg, const partition_t *part)
first
=
0
;
}
DB
((
dbg
,
LEVEL_2
,
"
\n
}
\n
"
));
}
/* dump_partition */
}
/**
* Dumps a list.
...
...
@@ -186,7 +186,7 @@ static void dump_list(const char *msg, const block_t *block)
first
=
0
;
}
DB
((
dbg
,
LEVEL_3
,
"
\n
}
\n
"
));
}
/* do_dump_list */
}
#else
#define dump_partition(msg, part)
#define dump_list(msg, block)
...
...
@@ -202,7 +202,7 @@ static int listmap_cmp_ptr(const void *elt, const void *key, size_t size)
(
void
)
size
;
return
e1
->
id
!=
e2
->
id
;
}
/* listmap_cmp_ptr */
}
/**
* Initializes a listmap.
...
...
@@ -213,7 +213,7 @@ static void listmap_init(listmap_t *map)
{
map
->
map
=
new_set
(
listmap_cmp_ptr
,
16
);
map
->
values
=
NULL
;
}
/* listmap_init */
}
/**
* Terminates a listmap.
...
...
@@ -223,7 +223,7 @@ static void listmap_init(listmap_t *map)
static
void
listmap_term
(
listmap_t
*
map
)
{
del_set
(
map
->
map
);
}
/* listmap_term */
}
/**
* Return the associated listmap entry for a given id.
...
...
@@ -248,7 +248,7 @@ static listmap_entry_t *listmap_find(listmap_t *map, void *id)
map
->
values
=
entry
;
}
return
entry
;
}
/* listmap_find */
}
/**
* Calculate the hash value for an opcode map entry.
...
...
@@ -261,7 +261,7 @@ static unsigned opcode_hash(const opcode_key_t *entry)
{
/* assume long >= int */
return
(
unsigned
)(
PTR_TO_INT
(
entry
->
mode
)
*
9
+
entry
->
code
+
entry
->
u
.
proj
*
3
+
hash_ptr
(
entry
->
u
.
addr
)
+
entry
->
arity
);
}
/* opcode_hash */
}
/**
* Compare two entries in the opcode map.
...
...
@@ -275,7 +275,7 @@ static int cmp_opcode(const void *elt, const void *key, size_t size)
return
o1
->
code
!=
o2
->
code
||
o1
->
mode
!=
o2
->
mode
||
o1
->
arity
!=
o2
->
arity
||
o1
->
u
.
proj
!=
o2
->
u
.
proj
||
o1
->
u
.
addr
!=
o2
->
u
.
addr
;
}
/* cmp_opcode */
}
/**
* Creates a new empty partition and put in on the
...
...
@@ -294,7 +294,7 @@ static partition_t *create_partition(ir_node *meet_block, environment_t *env)
DEBUG_ONLY
(
part
->
nr
=
part_nr
++
;)
list_add_tail
(
&
part
->
part_list
,
&
env
->
partitions
);
return
part
;
}
/* create_partition */
}
/**
* Allocate a new block in the given partition.
...
...
@@ -328,7 +328,7 @@ static block_t *create_block(ir_node *block, int meet_input, partition_t *partit
env
->
all_blocks
=
bl
;
return
bl
;
}
/* create_block */
}
/**
* Allocate a new node and add it to a blocks wait queue.
...
...
@@ -347,7 +347,7 @@ static node_t *create_node(ir_node *irn, block_t *block, environment_t *env)
list_add_tail
(
&
node
->
node_list
,
&
block
->
nodes
);
return
node
;
}
/* create_node */
}
/**
* Add an input pair to a block.
...
...
@@ -367,7 +367,7 @@ static void add_pair(block_t *block, ir_node *irn, int idx, environment_t *env)
pair
->
ins
=
NULL
;
block
->
input_pairs
=
pair
;
}
/* add_pair */
}
/**
* Add a Phi to a block.
...
...
@@ -385,7 +385,7 @@ static void add_phi(block_t *block, ir_node *phi, environment_t *env)
node
->
ins
=
NULL
;
block
->
phis
=
node
;
}
/** add_phi */
}
/**
* Creates an opcode from a node.
...
...
@@ -436,7 +436,7 @@ static opcode_key_t *opcode(const node_t *node, environment_t *env)
entry
=
set_insert
(
opcode_key_t
,
env
->
opcode2id_map
,
&
key
,
sizeof
(
key
),
opcode_hash
(
&
key
));
return
entry
;
}
/* opcode */
}
/**
* Split a partition by a local list.
...
...
@@ -476,7 +476,7 @@ static partition_t *split(partition_t *Z, block_t *g, environment_t *env)
dump_partition
(
"Now "
,
Z
);
dump_partition
(
"Created new "
,
Z_prime
);
return
Z_prime
;
}
/* split */
}
/**
* Return non-zero if pred should be tread as a input node.
...
...
@@ -491,7 +491,7 @@ static int is_input_node(ir_node *pred, ir_node *irn, int index)
if
(
!
is_Call
(
irn
))
return
1
;
return
0
;
}
/* is_input_node */
}
/**
* Propagate nodes on all wait queues of the given partition.
...
...
@@ -602,7 +602,7 @@ static void propagate_blocks(partition_t *part, environment_t *env)
split
(
part
,
S
,
env
);
}
listmap_term
(
&
map
);
}
/* propagate_blocks */
}
/**
* Propagate nodes on all wait queues.
...
...
@@ -619,7 +619,7 @@ static void propagate(environment_t *env)
}
else
propagate_blocks
(
part
,
env
);
}
}
/* propagate */
}
/**
* Map a block to the phi[block->input] live-trough.
...
...
@@ -635,7 +635,7 @@ static void *live_throughs(const block_t *bl, const ir_node *phi)
if
(
get_nodes_block
(
input
)
==
bl
->
block
)
return
NULL
;
return
input
;
}
/* live_throughs */
}
/**
* Split partition by live-outs and live-troughs.
...
...
@@ -690,7 +690,7 @@ static void propagate_blocks_live_troughs(partition_t *part, environment_t *env)
}
listmap_term
(
&
map
);
}
}
/* propagate_blocks_live_troughs */
}
/**
* Propagate live-troughs on all partitions on the partition list.
...
...
@@ -702,7 +702,7 @@ static void propagate_live_troughs(environment_t *env)
list_for_each_entry_safe
(
partition_t
,
part
,
next
,
&
env
->
partitions
,
part_list
)
{
propagate_blocks_live_troughs
(
part
,
env
);
}
}
/* propagate_live_troughs */
}
/**
* Apply analysis results by replacing all blocks of a partition
...
...
@@ -917,7 +917,7 @@ continue_outer:
/* fix inputs of the meet block */
set_irn_in
(
meet_block
,
j
,
ins
);
DEL_ARR_F
(
ins
);
}
/* apply */
}
/**
* Create a partition for a the end block.
...
...
@@ -968,7 +968,7 @@ static void partition_for_end_block(ir_node *end_block, environment_t *env)
}
dump_partition
(
"Created"
,
part
);
}
/* partition_for_end_block */
}
#ifdef GENERAL_SHAPE
/**
...
...
@@ -1000,7 +1000,7 @@ static void partition_for_block(ir_node *block, pred_t preds[], int n_preds, env
}
dump_partition
(
"Created"
,
part
);
}
/* partition_for_block */
}
/**
* Walker: clear the links of all block phi lists and normal
...
...
@@ -1013,7 +1013,7 @@ static void clear_phi_links(ir_node *irn, void *env)
set_Block_phis
(
irn
,
NULL
);
set_irn_link
(
irn
,
NULL
);
}
}
/* clear_phi_links */
}
/**
* Walker, detect live-out nodes.
...
...
@@ -1056,7 +1056,7 @@ static void find_liveouts(ir_node *irn, void *ctx)
live_outs
[
idx
]
=
pred_block
;
}
}
}
/* find_liveouts */
}
/**
* Check if the current block is the meet block of its predecessors.
...
...
@@ -1095,7 +1095,7 @@ static void check_for_cf_meet(ir_node *block, void *ctx)
if
(
k
>
1
)
partition_for_block
(
block
,
preds
,
k
,
env
);
}
/* check_for_cf_meet */
}
/**
* Compare two nodes for root ordering.
...
...
@@ -1127,7 +1127,7 @@ static int cmp_nodes(const void *a, const void *b)
idx_b
=
get_irn_idx
(
irn_b
);
return
(
idx_a
>
idx_b
)
-
(
idx_a
<
idx_b
);
}
/* cmp_nodes */
}
/**
* Add the roots to all blocks.
...
...
@@ -1176,7 +1176,7 @@ static void add_roots(ir_graph *irg, environment_t *env)
DEL_ARR_F
(
bl
->
roots
);
bl
->
roots
=
NULL
;
}
}
/* add_roots */
}
#endif
/* GENERAL_SHAPE */
/* Combines congruent end blocks into one. */
...
...
@@ -1256,9 +1256,9 @@ void shape_blocks(ir_graph *irg)
DEL_ARR_F
(
env
.
live_outs
);
del_set
(
env
.
opcode2id_map
);
obstack_free
(
&
env
.
obst
,
NULL
);
}
/* shape_blocks */
}
ir_graph_pass_t
*
shape_blocks_pass
(
const
char
*
name
)
{
return
def_graph_pass
(
name
?
name
:
"shape_blocks"
,
shape_blocks
);
}
/* shape_blocks_pass */
}
ir/opt/opt_confirms.c
View file @
a141b05a
...
...
@@ -167,7 +167,7 @@ int value_not_zero(const ir_node *n, const ir_node **confirm)
return
(
relation
!=
ir_relation_equal
)
&&
(
relation
!=
ir_relation_unordered
);
#undef RET_ON
}
/* value_not_zero */
}
/*
* Check, if the value of a node cannot represent a NULL pointer.
...
...
@@ -222,7 +222,7 @@ int value_not_null(const ir_node *n, const ir_node **confirm)
}
}
return
0
;
}
/* value_not_null */
}
#ifdef __cplusplus
extern
"C++"
{
...
...
@@ -337,7 +337,7 @@ ir_value_classify_sign classify_value_sign(ir_node *n)
default:
return
value_classified_unknown
;
}
}
/* classify_value_sign */
}
/**
* construct an interval from a value
...
...
@@ -381,7 +381,7 @@ static interval_t *get_interval_from_tv(interval_t *iv, ir_tarval *tv)
iv
->
flags
=
MIN_INCLUDED
|
MAX_INCLUDED
;
return
iv
;
}
/* get_interval_from_tv */
}
/**
* construct an interval from a Confirm
...
...
@@ -483,7 +483,7 @@ static interval_t *get_interval(interval_t *iv, ir_node *bound, ir_relation rela
if
(
iv
->
min
!=
tarval_bad
&&
iv
->
max
!=
tarval_bad
)
return
iv
;
return
NULL
;
}
/* get_interval */
}
/**
* Try to evaluate l_iv relation r_iv.
...
...
@@ -616,7 +616,7 @@ static ir_tarval *(compare_iv)(const interval_t *l_iv, const interval_t *r_iv, i
return
tarval_bad
;
}
return
tarval_bad
;
}
/* compare_iv */
}
/**
* Returns non-zero, if a given relation is transitive.
...
...
@@ -624,7 +624,7 @@ static ir_tarval *(compare_iv)(const interval_t *l_iv, const interval_t *r_iv, i
static
int
is_transitive
(
ir_relation
relation
)
{
return
(
ir_relation_false
<
relation
&&
relation
<
ir_relation_less_greater
);
}
/* is_transitive */
}
/**
* Return the value of a Cmp if one or both predecessors
...
...
@@ -807,7 +807,7 @@ check_null_case:
DBG_EVAL_CONFIRM
(
cmp
);
return
tv
;
}
/* computed_value_Cmp_Confirm */
}
#ifdef DEBUG_CONFIRM
/**
...
...
@@ -836,7 +836,7 @@ static int iv_snprintf(char *buf, size_t len, const interval_t *iv)
return
snprintf
(
buf
,
len
,
"%s"
,
smin
);
}
return
snprintf
(
buf
,
len
,
"<UNKNOWN>"
);
}
/* iv_snprintf */
}
/**
* For debugging. Prints an interval compare.
...
...
@@ -853,7 +853,7 @@ static void print_iv_cmp(const interval_t *l_iv, const interval_t *r_iv, ir_rela
iv_snprintf
(
sr
,
sizeof
(
sr
),
r_iv
);
ir_printf
(
"%s %= %s"
,
sl
,
relation
,
sr
);
}
/* print_iv_cmp */
}
/**
* For debugging. call *compare_iv() and prints inputs and result.
...
...
@@ -873,6 +873,6 @@ static tarval *compare_iv_dbg(const interval_t *l_iv, const interval_t *r_iv, ir
print_iv_cmp
(
l_iv
,
r_iv
,
relation
);
ir_printf
(
" = %T
\n
"
,
tv
);