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
ec1b7914
Commit
ec1b7914
authored
Sep 19, 2015
by
Matthias Braun
Browse files
Remove hook_merge_nodes
parent
aea67ab9
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
include/libfirm/iroptimize.h
View file @
ec1b7914
...
...
@@ -505,13 +505,12 @@ FIRM_API int value_not_null(const ir_node *n, const ir_node **confirm);
/**
* Returns the value of a Cmp if one or both predecessors are Confirm nodes.
*
* @param cmp the compare node that will be evaluated
* @param left the left operand of the Cmp
* @param right the right operand of the Cmp
* @param relation the compare relation
*/
FIRM_API
ir_tarval
*
computed_value_Cmp_Confirm
(
const
ir_node
*
cmp
,
ir_node
*
left
,
ir_node
*
right
,
ir_relation
relation
);
FIRM_API
ir_tarval
*
computed_value_Cmp_Confirm
(
ir_node
*
left
,
ir_node
*
right
,
ir_relation
relation
);
/** Type of callbacks for creating entities of the compiler library */
typedef
ident
*
(
*
compilerlib_name_mangle_t
)(
ident
*
id
,
ir_type
*
mt
);
...
...
ir/ir/irhooks.h
View file @
ec1b7914
...
...
@@ -98,12 +98,6 @@ struct hook_entry {
/** This hook is called before an block walk is started. */
void
(
*
_hook_irg_block_walk
)(
void
*
context
,
ir_graph
*
irg
,
ir_node
*
node
,
generic_func
*
pre
,
generic_func
*
post
);
/** This hook is called, when debug info must be merged. */
void
(
*
_hook_merge_nodes
)(
void
*
context
,
ir_node
*
const
*
new_node_array
,
int
new_num_entries
,
ir_node
*
const
*
old_node_array
,
int
old_num_entries
,
hook_opt_kind
opt
);
/** This hook is called, when reassociation is started/stopped. */
void
(
*
_hook_reassociate
)(
void
*
context
,
int
start
);
...
...
@@ -167,7 +161,6 @@ typedef enum {
hook_irg_walk
,
/**< type for hook_irg_walk() hook */
hook_irg_walk_blkwise
,
/**< type for hook_irg_walk_blkwise() hook */
hook_irg_block_walk
,
/**< type for hook_irg_block_walk() hook */
hook_merge_nodes
,
/**< type for hook_merge_nodes() hook */
hook_reassociate
,
/**< type for hook_reassociate() hook */
hook_lower
,
/**< type for hook_lower() hook */
hook_inline
,
/**< type for hook_inline() hook */
...
...
@@ -244,9 +237,6 @@ extern hook_entry_t *hooks[hook_last];
/** Called before a block walk is started */
#define hook_irg_block_walk(irg, node, pre, post) \
hook_exec(hook_irg_block_walk, (hook_ctx_, irg, node, pre, post))
/** Called before 2 nodes get merged */
#define hook_merge_nodes(new_node_array, new_num_entries, old_node_array, old_num_entries, opt) \
hook_exec(hook_merge_nodes, (hook_ctx_, new_node_array, new_num_entries, old_node_array, old_num_entries, opt))
/** Called before node inputs get reassociated */
#define hook_reassociate(start) hook_exec(hook_reassociate, (hook_ctx_, start))
/** Called before a node gets lowered */
...
...
ir/lower/lower_intrinsics.c
View file @
ec1b7914
...
...
@@ -184,7 +184,7 @@ int i_mapper_abs(ir_node *call)
/* construct Mux */
mux
=
new_rd_Mux
(
dbg
,
block
,
cmp
,
op
,
minus_op
,
mode
);
DBG_OPT_ALGSIM0
(
call
,
mux
,
FS_OPT_RTS_ABS
);
DBG_OPT_ALGSIM0
(
call
,
mux
);
replace_call
(
mux
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -205,7 +205,7 @@ int i_mapper_sqrt(ir_node *call)
mem
=
get_Call_mem
(
call
);
/* sqrt(0) = 0, sqrt(1) = 1 */
DBG_OPT_ALGSIM0
(
call
,
op
,
FS_OPT_RTS_SQRT
);
DBG_OPT_ALGSIM0
(
call
,
op
);
replace_call
(
op
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -226,7 +226,7 @@ int i_mapper_cbrt(ir_node *call)
mem
=
get_Call_mem
(
call
);
/* cbrt(0) = 0, cbrt(1) = 1, cbrt(-1) = -1 */
DBG_OPT_ALGSIM0
(
call
,
op
,
FS_OPT_RTS_CBRT
);
DBG_OPT_ALGSIM0
(
call
,
op
);
replace_call
(
op
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -291,7 +291,7 @@ int i_mapper_pow(ir_node *call)
irn
=
new_r_Conv
(
block
,
irn
,
result_mode
);
}
}
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_POW
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
reg_jmp
,
exc_jmp
);
return
1
;
}
...
...
@@ -306,7 +306,7 @@ int i_mapper_exp(ir_node *call)
ir_mode
*
mode
=
get_irn_mode
(
val
);
ir_node
*
irn
=
new_r_Const_one
(
irg
,
mode
);
ir_node
*
mem
=
get_Call_mem
(
call
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_EXP
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -326,14 +326,14 @@ int i_mapper_exp10(ir_node *call)
/**
* A mapper for mapping f(0.0) to 0.0.
*/
static
int
i_mapper_zero_to_zero
(
ir_node
*
call
,
int
reason
)
static
int
i_mapper_zero_to_zero
(
ir_node
*
call
)
{
ir_node
*
val
=
get_Call_param
(
call
,
0
);
if
(
is_Const
(
val
)
&&
is_Const_null
(
val
))
{
/* f(0.0) = 0.0 */
ir_node
*
mem
=
get_Call_mem
(
call
);
DBG_OPT_ALGSIM0
(
call
,
val
,
reason
);
DBG_OPT_ALGSIM0
(
call
,
val
);
replace_call
(
val
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -343,7 +343,7 @@ static int i_mapper_zero_to_zero(ir_node *call, int reason)
/**
* A mapper for mapping f(1.0) to 0.0.
*/
static
int
i_mapper_one_to_zero
(
ir_node
*
call
,
int
reason
)
static
int
i_mapper_one_to_zero
(
ir_node
*
call
)
{
ir_node
*
val
=
get_Call_param
(
call
,
0
);
...
...
@@ -353,7 +353,7 @@ static int i_mapper_one_to_zero(ir_node *call, int reason)
ir_mode
*
mode
=
get_irn_mode
(
val
);
ir_node
*
irn
=
new_r_Const_null
(
irg
,
mode
);
ir_node
*
mem
=
get_Call_mem
(
call
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
reason
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -365,7 +365,7 @@ static int i_mapper_one_to_zero(ir_node *call, int reason)
* f(-x) = f(x).
* f(0.0) = 1.0
*/
static
int
i_mapper_symmetric_zero_to_one
(
ir_node
*
call
,
int
reason
)
static
int
i_mapper_symmetric_zero_to_one
(
ir_node
*
call
)
{
int
changed
=
0
;
ir_node
*
val
=
get_Call_param
(
call
,
0
);
...
...
@@ -380,14 +380,14 @@ static int i_mapper_symmetric_zero_to_one(ir_node *call, int reason)
op
=
get_Minus_op
(
op
);
val
=
new_rd_Conv
(
dbg
,
block
,
op
,
mode
);
DBG_OPT_ALGSIM2
(
call
,
op
,
call
,
FS_OPT_RTS_SYMMETRIC
);
DBG_OPT_ALGSIM2
(
call
,
op
,
call
);
set_Call_param
(
call
,
0
,
val
);
changed
=
1
;
}
}
else
if
(
is_Minus
(
val
))
{
/* f(-x) = f(x) */
val
=
get_Minus_op
(
val
);
DBG_OPT_ALGSIM2
(
call
,
val
,
call
,
FS_OPT_RTS_SYMMETRIC
);
DBG_OPT_ALGSIM2
(
call
,
val
,
call
);
set_Call_param
(
call
,
0
,
val
);
changed
=
1
;
}
...
...
@@ -398,7 +398,7 @@ static int i_mapper_symmetric_zero_to_one(ir_node *call, int reason)
ir_mode
*
mode
=
get_irn_mode
(
val
);
ir_node
*
irn
=
new_r_Const_one
(
irg
,
mode
);
ir_node
*
mem
=
get_Call_mem
(
call
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
reason
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
changed
=
1
;
}
...
...
@@ -408,73 +408,73 @@ static int i_mapper_symmetric_zero_to_one(ir_node *call, int reason)
int
i_mapper_log
(
ir_node
*
call
)
{
/* log(1.0) = 0.0 */
return
i_mapper_one_to_zero
(
call
,
FS_OPT_RTS_LOG
);
return
i_mapper_one_to_zero
(
call
);
}
int
i_mapper_log2
(
ir_node
*
call
)
{
/* log2(1.0) = 0.0 */
return
i_mapper_one_to_zero
(
call
,
FS_OPT_RTS_LOG
);
return
i_mapper_one_to_zero
(
call
);
}
int
i_mapper_log10
(
ir_node
*
call
)
{
/* log10(1.0) = 0.0 */
return
i_mapper_one_to_zero
(
call
,
FS_OPT_RTS_LOG
);
return
i_mapper_one_to_zero
(
call
);
}
int
i_mapper_sin
(
ir_node
*
call
)
{
/* sin(0.0) = 0.0 */
return
i_mapper_zero_to_zero
(
call
,
FS_OPT_RTS_SIN
);
return
i_mapper_zero_to_zero
(
call
);
}
int
i_mapper_cos
(
ir_node
*
call
)
{
/* cos(0.0) = 1.0, cos(-x) = x */
return
i_mapper_symmetric_zero_to_one
(
call
,
FS_OPT_RTS_COS
);
return
i_mapper_symmetric_zero_to_one
(
call
);
}
int
i_mapper_tan
(
ir_node
*
call
)
{
/* tan(0.0) = 0.0 */
return
i_mapper_zero_to_zero
(
call
,
FS_OPT_RTS_TAN
);
return
i_mapper_zero_to_zero
(
call
);
}
int
i_mapper_asin
(
ir_node
*
call
)
{
/* asin(0.0) = 0.0 */
return
i_mapper_zero_to_zero
(
call
,
FS_OPT_RTS_ASIN
);
return
i_mapper_zero_to_zero
(
call
);
}
int
i_mapper_acos
(
ir_node
*
call
)
{
/* acos(1.0) = 0.0 */
return
i_mapper_one_to_zero
(
call
,
FS_OPT_RTS_ACOS
);
return
i_mapper_one_to_zero
(
call
);
}
int
i_mapper_atan
(
ir_node
*
call
)
{
/* atan(0.0) = 0.0 */
return
i_mapper_zero_to_zero
(
call
,
FS_OPT_RTS_ATAN
);
return
i_mapper_zero_to_zero
(
call
);
}
int
i_mapper_sinh
(
ir_node
*
call
)
{
/* sinh(0.0) = 0.0 */
return
i_mapper_zero_to_zero
(
call
,
FS_OPT_RTS_SINH
);
return
i_mapper_zero_to_zero
(
call
);
}
int
i_mapper_cosh
(
ir_node
*
call
)
{
/* cosh(0.0) = 1.0, cosh(-x) = x */
return
i_mapper_symmetric_zero_to_one
(
call
,
FS_OPT_RTS_COSH
);
return
i_mapper_symmetric_zero_to_one
(
call
);
}
int
i_mapper_tanh
(
ir_node
*
call
)
{
/* tanh(0.0) = 0.0 */
return
i_mapper_zero_to_zero
(
call
,
FS_OPT_RTS_TANH
);
return
i_mapper_zero_to_zero
(
call
);
}
/**
...
...
@@ -599,7 +599,7 @@ int i_mapper_strlen(ir_node *call)
if
(
irn
)
{
ir_node
*
mem
=
get_Call_mem
(
call
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_STRLEN
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -753,7 +753,7 @@ int i_mapper_strcmp(ir_node *call)
ir_mode
*
mode
=
get_type_mode
(
res_tp
);
irn
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_STRCMP
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -808,7 +808,7 @@ replace_by_call:
}
if
(
irn
!=
NULL
)
{
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_STRCMP
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
reg
,
exc
);
return
1
;
}
...
...
@@ -835,7 +835,7 @@ int i_mapper_strncmp(ir_node *call)
ir_mode
*
mode
=
get_type_mode
(
res_tp
);
irn
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_STRNCMP
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -852,7 +852,7 @@ int i_mapper_strcpy(ir_node *call)
ir_node
*
mem
=
get_Call_mem
(
call
);
ir_node
*
dst
=
get_Call_param
(
call
,
0
);
DBG_OPT_ALGSIM0
(
call
,
dst
,
FS_OPT_RTS_STRCPY
);
DBG_OPT_ALGSIM0
(
call
,
dst
);
replace_call
(
dst
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -870,7 +870,7 @@ int i_mapper_memcpy(ir_node *call)
a memcpy(d, s, 0) ==> d */
ir_node
*
mem
=
get_Call_mem
(
call
);
DBG_OPT_ALGSIM0
(
call
,
dst
,
FS_OPT_RTS_MEMCPY
);
DBG_OPT_ALGSIM0
(
call
,
dst
);
replace_call
(
dst
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -888,7 +888,7 @@ int i_mapper_memmove(ir_node *call)
a memmove(d, s, 0) ==> d */
ir_node
*
mem
=
get_Call_mem
(
call
);
DBG_OPT_ALGSIM0
(
call
,
dst
,
FS_OPT_RTS_MEMMOVE
);
DBG_OPT_ALGSIM0
(
call
,
dst
);
replace_call
(
dst
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -904,7 +904,7 @@ int i_mapper_memset(ir_node *call)
ir_node
*
mem
=
get_Call_mem
(
call
);
ir_node
*
dst
=
get_Call_param
(
call
,
0
);
DBG_OPT_ALGSIM0
(
call
,
dst
,
FS_OPT_RTS_MEMSET
);
DBG_OPT_ALGSIM0
(
call
,
dst
);
replace_call
(
dst
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
@@ -930,7 +930,7 @@ int i_mapper_memcmp(ir_node *call)
ir_mode
*
mode
=
get_type_mode
(
res_tp
);
irn
=
new_r_Const_null
(
irg
,
mode
);
DBG_OPT_ALGSIM0
(
call
,
irn
,
FS_OPT_RTS_MEMCMP
);
DBG_OPT_ALGSIM0
(
call
,
irn
);
replace_call
(
irn
,
call
,
mem
,
NULL
,
NULL
);
return
1
;
}
...
...
ir/opt/combo.c
View file @
ec1b7914
...
...
@@ -2783,7 +2783,7 @@ static void apply_cf(ir_node *block, void *ctx)
if
(
can_exchange
(
pred
,
block
))
{
ir_node
*
new_block
=
get_nodes_block
(
pred
);
DB
((
dbg
,
LEVEL_1
,
"Fuse %+F with %+F
\n
"
,
block
,
new_block
));
DBG_OPT_COMBO
(
block
,
new_block
,
FS_OPT_COMBO_CF
);
DBG_OPT_COMBO
(
block
,
new_block
);
exchange
(
block
,
new_block
);
node
->
node
=
new_block
;
env
->
modified
=
true
;
...
...
@@ -2821,7 +2821,7 @@ static void apply_cf(ir_node *block, void *ctx)
set_irn_node
(
c
,
node
);
node
->
node
=
c
;
DB
((
dbg
,
LEVEL_1
,
"%+F is replaced by %+F
\n
"
,
phi
,
c
));
DBG_OPT_COMBO
(
phi
,
c
,
FS_OPT_COMBO_CONST
);
DBG_OPT_COMBO
(
phi
,
c
);
exchange
(
phi
,
c
);
env
->
modified
=
true
;
}
else
{
...
...
@@ -2843,7 +2843,7 @@ static void apply_cf(ir_node *block, void *ctx)
node
->
node
=
s
;
DB
((
dbg
,
LEVEL_1
,
"%+F is replaced by %+F because of cf change
\n
"
,
phi
,
s
));
DBG_OPT_COMBO
(
phi
,
s
,
FS_OPT_COMBO_FOLLOWER
);
DBG_OPT_COMBO
(
phi
,
s
);
exchange
(
phi
,
s
);
phi_node
->
node
=
s
;
env
->
modified
=
true
;
...
...
@@ -2861,7 +2861,7 @@ static void apply_cf(ir_node *block, void *ctx)
if
(
can_exchange
(
pred
,
block
))
{
ir_node
*
new_block
=
get_nodes_block
(
pred
);
DBG_OPT_COMBO
(
block
,
new_block
,
FS_OPT_COMBO_CF
);
DBG_OPT_COMBO
(
block
,
new_block
);
exchange
(
block
,
new_block
);
node
->
node
=
new_block
;
env
->
modified
=
true
;
...
...
@@ -3016,7 +3016,7 @@ static void apply_result(ir_node *irn, void *ctx)
set_irn_node
(
jmp
,
node
);
node
->
node
=
jmp
;
DB
((
dbg
,
LEVEL_1
,
"%+F is replaced by %+F
\n
"
,
irn
,
jmp
));
DBG_OPT_COMBO
(
irn
,
jmp
,
FS_OPT_COMBO_CF
);
DBG_OPT_COMBO
(
irn
,
jmp
);
exchange
(
irn
,
jmp
);
env
->
modified
=
true
;
}
else
if
(
is_Switch
(
cond
))
{
...
...
@@ -3046,7 +3046,7 @@ static void apply_result(ir_node *irn, void *ctx)
set_irn_node
(
c
,
node
);
node
->
node
=
c
;
DB
((
dbg
,
LEVEL_1
,
"%+F is replaced by %+F
\n
"
,
irn
,
c
));
DBG_OPT_COMBO
(
irn
,
c
,
FS_OPT_COMBO_CONST
);
DBG_OPT_COMBO
(
irn
,
c
);
exchange_leader
(
irn
,
c
);
env
->
modified
=
true
;
}
...
...
@@ -3059,7 +3059,7 @@ static void apply_result(ir_node *irn, void *ctx)
node
->
node
=
addr
;
DB
((
dbg
,
LEVEL_1
,
"%+F is replaced by %+F
\n
"
,
irn
,
addr
));
DBG_OPT_COMBO
(
irn
,
addr
,
FS_OPT_COMBO_CONST
);
DBG_OPT_COMBO
(
irn
,
addr
);
exchange_leader
(
irn
,
addr
);
env
->
modified
=
true
;
}
...
...
@@ -3088,9 +3088,9 @@ static void apply_result(ir_node *irn, void *ctx)
if
(
!
non_strict_phi
)
{
DB
((
dbg
,
LEVEL_1
,
"%+F from part%d is replaced by %+F
\n
"
,
irn
,
node
->
part
->
nr
,
leader
));
if
(
node
->
is_follower
)
DBG_OPT_COMBO
(
irn
,
leader
,
FS_OPT_COMBO_FOLLOWER
);
DBG_OPT_COMBO
(
irn
,
leader
);
else
DBG_OPT_COMBO
(
irn
,
leader
,
FS_OPT_COMBO_CONGRUENT
);
DBG_OPT_COMBO
(
irn
,
leader
);
exchange_leader
(
irn
,
leader
);
env
->
modified
=
true
;
}
...
...
ir/opt/gvn_pre.c
View file @
ec1b7914
...
...
@@ -85,7 +85,6 @@ typedef struct elim_pair {
ir_node
*
old_node
;
/* node that will be replaced */
ir_node
*
new_node
;
/* replacement for old_node */
struct
elim_pair
*
next
;
/* links all instances for easy access */
int
reason
;
/* reason for the replacement */
}
elim_pair
;
/** environment for the GVN-PRE algorithm */
...
...
@@ -1709,10 +1708,6 @@ static void eliminate(ir_node *irn, void *ctx)
p
->
old_node
=
irn
;
p
->
new_node
=
expr
;
p
->
next
=
env
->
pairs
;
if
(
get_irn_idx
(
expr
)
>
env
->
last_idx
)
p
->
reason
=
FS_OPT_GVN_PARTLY
;
else
p
->
reason
=
FS_OPT_GVN_FULLY
;
env
->
pairs
=
p
;
DEBUG_ONLY
(
inc_stats
(
gvnpre_stats
->
replaced
);)
}
...
...
@@ -1755,7 +1750,7 @@ static void eliminate_nodes(elim_pair *pairs, ir_nodeset_t *keeps)
p
->
new_node
=
res
;
}
}
DBG_OPT_GVN_PRE
(
p
->
old_node
,
p
->
new_node
,
p
->
reason
);
DBG_OPT_GVN_PRE
(
p
->
old_node
,
p
->
new_node
);
exchange
(
p
->
old_node
,
p
->
new_node
);
}
...
...
ir/opt/iropt.c
View file @
ec1b7914
This diff is collapsed.
Click to expand it.
ir/opt/iropt_dbg.h
View file @
ec1b7914
...
...
@@ -24,7 +24,6 @@
*/
#define DBG_OPT_DEAD_BLOCK(oldn, n) \
do { \
hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_DEAD_BLOCK); \
__dbg_info_merge_pair(n, oldn, dbg_dead_code); \
} while(0)
...
...
@@ -41,7 +40,6 @@
ir_node *ons[2]; \
ons[0] = oldn; \
ons[1] = get_Block_cfgpred(oldn, 0); \
hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_STG); \
__dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_straightening); \
} while(0)
...
...
@@ -60,7 +58,6 @@
ons[1] = proj1; \
ons[2] = proj2; \
ons[3] = get_Proj_pred(proj1); \
hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_IFSIM); \
__dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_if_simplification); \
} while(0)
...
...
@@ -71,7 +68,6 @@
*/
#define DBG_OPT_IFSIM2(oldn, n) \
do { \
hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_IFSIM); \
__dbg_info_merge_pair(n, oldn, dbg_if_simplification); \
} while(0)
...
...
@@ -84,7 +80,6 @@
*/
#define DBG_OPT_CSTEVAL(oldn, n) \
do { \
hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_CONST_EVAL); \
__dbg_info_merge_pair(n, oldn, dbg_const_eval); \
} while(0)
...
...
@@ -93,11 +88,9 @@
*
* @param oldn the old node
* @param n the new node replacing oldn
* @param flag firm statistics option
*/
#define DBG_OPT_ALGSIM0(oldn, n
, flag)
\
#define DBG_OPT_ALGSIM0(oldn, n
)
\
do { \
hook_merge_nodes(&n, 1, &oldn, 1, (hook_opt_kind)flag); \
__dbg_info_merge_pair(n, oldn, dbg_algebraic_simplification); \
} while(0)
...
...
@@ -108,15 +101,13 @@
* @param a a predecessor of oldn
* @param b a predecessor of oldn
* @param n the new node replacing oldn
* @param flag firm statistics option
*/
#define DBG_OPT_ALGSIM1(oldn, a, b, n
, flag)
\
#define DBG_OPT_ALGSIM1(oldn, a, b, n
)
\
do { \
ir_node *ons[3]; \
ons[0] = oldn; \
ons[1] = a; \
ons[2] = b; \
hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), (hook_opt_kind)flag); \
__dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_algebraic_simplification); \
} while(0)
...
...
@@ -126,27 +117,24 @@
* @param oldn the old node
* @param pred the predecessor of oldn
* @param n the new node replacing oldn
* @param flag firm statistics option
*/
#define DBG_OPT_ALGSIM2(oldn, pred, n
, flag)
\
#define DBG_OPT_ALGSIM2(oldn, pred, n
)
\
do { \
ir_node *ons[3]; \
ons[0] = oldn; \
ons[1] = pred; \
ons[2] = n; \
hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), (hook_opt_kind)flag); \
__dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_algebraic_simplification); \
} while(0)
/**
* Merge the debug info due to an algebraic_simplification.
*/
#define DBG_OPT_ALGSIM3(oldn, a, n
, flag)
\
#define DBG_OPT_ALGSIM3(oldn, a, n
)
\
do { \
ir_node *ons[2]; \
ons[0] = oldn; \
ons[1] = a; \
hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), flag); \
__dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_algebraic_simplification); \
} while(0)
...
...
@@ -159,7 +147,6 @@
*/
#define DBG_OPT_PHI(phi, n) \
do { \
hook_merge_nodes(&n, 1, &phi, 1, HOOK_OPT_PHI); \
__dbg_info_merge_sets(&n, 1, &phi, 1, dbg_opt_ssa); \
} while(0)
...
...
@@ -173,7 +160,6 @@
*/
#define DBG_OPT_SYNC(sync, n) \
do { \
hook_merge_nodes(&n, 1, &sync, 1, HOOK_OPT_SYNC); \
__dbg_info_merge_sets(&n, 1, &sync, 1, dbg_opt_ssa); \
} while(0)
...
...
@@ -190,7 +176,6 @@
ir_node *ons[2]; \
ons[0] = oldst; \
ons[1] = st; \
hook_merge_nodes(&st, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_WAW); \
__dbg_info_merge_sets(&st, 1, ons, ARRAY_SIZE(ons), dbg_write_after_write); \
} while(0)
...
...
@@ -206,7 +191,6 @@
ir_node *ons[2]; \
ons[0] = store; \
ons[1] = load; \
hook_merge_nodes(&load, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_WAR); \
__dbg_info_merge_sets(&load, 1, ons, ARRAY_SIZE(ons), dbg_write_after_read); \
} while(0)
...
...
@@ -222,7 +206,6 @@
ir_node *ons[2]; \
ons[0] = load; \
ons[1] = value; \
hook_merge_nodes(&value, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_RAW); \
__dbg_info_merge_sets(&value, 1, ons, ARRAY_SIZE(ons), dbg_read_after_write); \
} while(0)
...
...
@@ -238,7 +221,6 @@
ir_node *ons[2]; \
ons[0] = oldld; \
ons[1] = ld; \
hook_merge_nodes(&ld, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_RAR); \
__dbg_info_merge_sets(&ld, 1, ons, ARRAY_SIZE(ons), dbg_read_after_read); \
} while(0)
...
...
@@ -255,7 +237,6 @@
ir_node *ons[2]; \
ons[0] = ld; \
ons[1] = c; \
hook_merge_nodes(&c, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_RC); \
__dbg_info_merge_sets(&ld, 1, ons, ARRAY_SIZE(ons), dbg_read_a_const); \
} while(0)
...
...
@@ -273,7 +254,6 @@
ons[0] = proj; \
ons[1] = tuple; \
ons[2] = n; \
hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_TUPLE); \
__dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_opt_auxnode); \
} while(0)
...
...
@@ -289,7 +269,6 @@
ir_node *ons[2]; \
ons[0] = id; \
ons[1] = n; \
hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_ID); \
__dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_opt_auxnode); \
} while(0)
...
...
@@ -304,7 +283,6 @@
ir_node *ons[2]; \
ons[0] = oldn; \
ons[1] = n; \
hook_merge_nodes(&n, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_CSE); \
__dbg_info_merge_sets(&n, 1, ons, ARRAY_SIZE(ons), dbg_opt_cse); \
} while(0)
...
...
@@ -321,7 +299,6 @@
ons[0] = sel; \
ons[1] = skip_Proj(get_Sel_ptr(sel)); \
ons[2] = c; \
hook_merge_nodes(&c, 1, ons, ARRAY_SIZE(ons), HOOK_OPT_POLY_CALL); \
__dbg_info_merge_sets(&c, 1, ons, ARRAY_SIZE(ons), dbg_rem_poly_call); \
} while(0)
...
...
@@ -333,7 +310,6 @@
*/
#define DBG_OPT_CONFIRM(oldn, n) \
do { \
hook_merge_nodes(&n, 1, &oldn, 1, HOOK_OPT_CONFIRM); \
__dbg_info_merge_pair(n, oldn, dbg_opt_confirm); \
} while(0)
...
...
@@ -345,41 +321,17 @@
*/
#define DBG_OPT_CONFIRM_C(oldn, c) \
do { \
hook_merge_nodes(&c, 1, &oldn, 1, HOOK_OPT_CONFIRM_C); \
__dbg_info_merge_pair(c, oldn, dbg_opt_confirm); \
} while(0)
/**
* A exception exdge was removed due to a Confirmation prove.
*
* @param oldn the old node
*/
#define DBG_OPT_EXC_REM(oldn) \
do { \
hook_merge_nodes(NULL, 0, &oldn, 1, HOOK_OPT_EXC_REM); \
} while(0)
/**
* A node could be evaluated to a value due to a Confirm.
* This will lead to a constant evaluation.
*
* @param n the node that could be evaluated
*/
#define DBG_EVAL_CONFIRM(n) \
do { \
hook_merge_nodes(NULL, 0, (ir_node**)&n, 1, HOOK_OPT_CONFIRM_E); \
} while(0)
/**