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
10205d4a
Commit
10205d4a
authored
Aug 16, 2009
by
Michael Beck
Browse files
- add pass for optimize_graph_df()
[r26348]
parent
818856f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/libfirm/irgopt.h
View file @
10205d4a
...
...
@@ -56,6 +56,17 @@ void local_optimize_graph(ir_graph *irg);
*/
int
optimize_graph_df
(
ir_graph
*
irg
);
/**
* Creates an ir_graph pass for optimize_graph_df().
*
* @param name the name of this pass or NULL
* @param verify should this pass be verified?
* @param dump should this pass result be dumped?
*
* @return the newly created ir_graph pass
*/
ir_graph_pass_t
*
optimize_graph_df_pass
(
const
char
*
name
,
int
verify
,
int
dump
);
/** Performs dead node elimination by copying the ir graph to a new obstack.
*
* The major intention of this pass is to free memory occupied by
...
...
ir/ir/irgopt.c
View file @
10205d4a
...
...
@@ -39,6 +39,7 @@
#include "adt/pdeq.h"
#include "irpass_t.h"
#include "irflag_t.h"
#include "iredges_t.h"
#include "irtools.h"
...
...
@@ -220,3 +221,27 @@ int optimize_graph_df(ir_graph *irg) {
current_ir_graph
=
rem
;
return
changed
;
}
/**
* Wrapper for running optimize_graph_df() as an ir_graph pass.
*/
static
int
pass_wrapper
(
ir_graph
*
irg
,
void
*
context
)
{
(
void
)
context
;
return
optimize_graph_df
(
irg
);
}
/* pass_wrapper */
/* Creates an ir_graph pass for optimize_graph_df. */
ir_graph_pass_t
*
optimize_graph_df_pass
(
const
char
*
name
,
int
verify
,
int
dump
)
{
struct
ir_graph_pass_t
*
pass
=
XMALLOCZ
(
ir_graph_pass_t
);
pass
->
kind
=
k_ir_prog_pass
;
pass
->
run_on_irg
=
pass_wrapper
;
pass
->
context
=
pass
;
pass
->
name
=
name
?
name
:
"optimize_graph_df"
;
pass
->
verify
=
verify
!=
0
;
pass
->
dump
=
dump
!=
0
;
INIT_LIST_HEAD
(
&
pass
->
list
);
return
pass
;
}
/* combo_pass */
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