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
384e2aae
Commit
384e2aae
authored
Aug 17, 2009
by
Matthias Braun
Browse files
fix a few errors and warnings in the new pass code; improve some comments
[r26367]
parent
ddfcdcb1
Changes
11
Hide whitespace changes
Inline
Side-by-side
include/libfirm/irgopt.h
View file @
384e2aae
...
...
@@ -65,7 +65,7 @@ int optimize_graph_df(ir_graph *irg);
*
* @return the newly created ir_graph pass
*/
ir_graph_pass_t
*
optimize_graph_df_pass
(
const
char
*
name
,
int
verify
,
int
dump
);
ir_graph_pass_t
*
optimize_graph_df_pass
(
const
char
*
name
);
/** Performs dead node elimination by copying the ir graph to a new obstack.
*
...
...
include/libfirm/iroptimize.h
View file @
384e2aae
...
...
@@ -53,7 +53,7 @@ void optimize_cf(ir_graph *irg);
*
* @return the newly created ir_graph pass
*/
ir_graph_pass_t
*
optimize_cf_pass
(
const
char
*
name
,
int
verify
,
int
dump
);
ir_graph_pass_t
*
optimize_cf_pass
(
const
char
*
name
);
/**
* Perform path-sensitive jump threading on the given graph.
...
...
ir/ana/irdom.c
View file @
384e2aae
...
...
@@ -356,7 +356,7 @@ void dom_tree_walk_irg(ir_graph *irg, irg_walk_func *pre,
/* The root of the dominator tree should be the Start block. */
ir_node
*
root
=
get_irg_start_block
(
irg
);
assert
(
irg
->
dom_state
==
dom_consistent
assert
(
irg
->
dom_state
==
dom_consistent
&&
"The dominators of the irg must be consistent"
);
assert
(
root
&&
"The start block of the graph is NULL?"
);
assert
(
get_dom_info
(
root
)
->
idom
==
NULL
...
...
ir/common/irtools.c
View file @
384e2aae
...
...
@@ -202,8 +202,7 @@ static int int_graph_wrapper(ir_graph *irg, void *context) {
/* Creates an ir_graph pass for running void function(ir_graph *irg). */
ir_graph_pass_t
*
def_graph_pass_ret
(
const
char
*
name
,
int
verify
,
int
dump
,
int
(
*
function
)(
ir_graph
*
irg
))
const
char
*
name
,
int
(
*
function
)(
ir_graph
*
irg
))
{
struct
ir_graph_pass_t
*
pass
=
XMALLOCZ
(
ir_graph_pass_t
);
...
...
ir/ir/irvrfy.c
View file @
384e2aae
...
...
@@ -1591,8 +1591,10 @@ static int verify_node_Phi(ir_node *n, ir_graph *irg) {
int
i
;
(
void
)
irg
;
/* a Phi node MUST have the same number of inputs as its block
* Exception is a phi with 0 inputs which is used when (re)constructing the
* SSA form */
if
(
!
is_Bad
(
block
)
&&
get_irg_phase_state
(
get_irn_irg
(
n
))
!=
phase_building
&&
get_irn_arity
(
n
)
>
0
)
{
/* a Phi node MUST have the same number of inputs as its block */
ASSERT_AND_RET_DBG
(
get_irn_arity
(
n
)
==
get_irn_arity
(
block
),
"wrong number of inputs in Phi node"
,
0
,
...
...
ir/lower/lower_intrinsics.c
View file @
384e2aae
...
...
@@ -173,6 +173,7 @@ struct pass_t {
static
int
pass_wrapper
(
ir_prog
*
irp
,
void
*
context
)
{
struct
pass_t
*
pass
=
context
;
(
void
)
irp
;
/* TODO: set current irp, or remove parameter */
lower_intrinsics
(
pass
->
list
,
pass
->
length
,
pass
->
part_block_used
);
/* probably this pass should not run again */
return
0
;
...
...
ir/opt/ldstopt.c
View file @
384e2aae
...
...
@@ -2303,5 +2303,5 @@ int 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
);
return
def_graph_pass
_ret
(
name
?
name
:
"ldst"
,
optimize_load_store
);
}
/* optimize_load_store_pass */
ir/opt/opt_ldst.c
View file @
384e2aae
...
...
@@ -2409,5 +2409,5 @@ end:
ir_graph_pass_t
*
opt_ldst_pass
(
const
char
*
name
)
{
return
def_graph_pass
(
name
?
name
:
"ldst_df"
,
opt_ldst
);
return
def_graph_pass
_ret
(
name
?
name
:
"ldst_df"
,
opt_ldst
);
}
/* opt_ldst_pass */
ir/opt/reassoc.c
View file @
384e2aae
...
...
@@ -934,8 +934,8 @@ int optimize_reassociation(ir_graph *irg)
}
/* optimize_reassociation */
/* create a pass for the reassociation */
ir_graph_pass_t
*
optimize_reassociation_pass
(
const
char
*
name
,
int
verify
,
int
dump
)
{
return
def_graph_pass_ret
(
name
?
name
:
"reassoc"
,
verify
,
dump
,
optimize_reassociation
);
ir_graph_pass_t
*
optimize_reassociation_pass
(
const
char
*
name
)
{
return
def_graph_pass_ret
(
name
?
name
:
"reassoc"
,
optimize_reassociation
);
}
/* optimize_reassociation_pass */
/* Sets the default reassociation operation for an ir_op_ops. */
...
...
ir/opt/return.c
View file @
384e2aae
...
...
@@ -30,6 +30,7 @@
#include "ircons_t.h"
#include "irnode_t.h"
#include "irgmod.h"
#include "irtools.h"
#define set_bit(n) (returns[(n) >> 3] |= 1 << ((n) & 7))
#define get_bit(n) (returns[(n) >> 3] & (1 << ((n) & 7)))
...
...
@@ -167,9 +168,9 @@ void normalize_one_return(ir_graph *irg) {
}
/* Create a graph pass. */
ir_graph_pass_t
*
normalize_one_return_pass
(
const
char
*
name
,
int
verify
,
int
dump
)
ir_graph_pass_t
*
normalize_one_return_pass
(
const
char
*
name
)
{
return
def_graph_pass
(
name
?
name
:
"one_ret"
,
verify
,
dump
,
normalize_one_return
);
return
def_graph_pass
(
name
?
name
:
"one_ret"
,
normalize_one_return
);
}
/**
...
...
ir/opt/scalar_replace.c
View file @
384e2aae
...
...
@@ -772,7 +772,8 @@ int scalar_replacement_opt(ir_graph *irg) {
}
ir_graph_pass_t
*
scalar_replacement_opt_pass
(
const
char
*
name
)
{
return
def_graph_pass
(
name
?
name
:
"scalar_rep"
,
scalar_replacement_opt
);
return
def_graph_pass_ret
(
name
?
name
:
"scalar_rep"
,
scalar_replacement_opt
);
}
void
firm_init_scalar_replace
(
void
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment