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
7412de5c
Commit
7412de5c
authored
Aug 16, 2009
by
Michael Beck
Browse files
- add pass for combo()
- fixed pass generator for lower_intrinsics - add irpass.h to firm.h header [r26346]
parent
eabef690
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/libfirm/firm.h
View file @
7412de5c
...
...
@@ -83,6 +83,7 @@ extern "C" {
#include
"iroptimize.h"
/* optimize ir by reassociation */
#include
"ircgopt.h"
/* Optimizations based on interprocedural graph */
#include
"iropt.h"
#include
"irpass.h"
/* Pass management */
/* Lowering */
#include
"lowering.h"
/* lowering of different calls parameters, intrinsic calls, double word types, high-level constructs */
...
...
include/libfirm/iroptimize.h
View file @
7412de5c
...
...
@@ -550,6 +550,17 @@ void optimize_class_casts(void);
*/
void
combo
(
ir_graph
*
irg
);
/**
* Creates an ir_graph pass for combo.
*
* @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
*
combo_pass
(
const
char
*
name
,
int
verify
,
int
dump
);
/** Inlines all small methods at call sites where the called address comes
* from a SymConst node that references the entity representing the called
* method.
...
...
include/libfirm/lowering.h
View file @
7412de5c
...
...
@@ -324,7 +324,7 @@ ir_prog_pass_t *lower_intrinsics_pass(
const
char
*
name
,
int
verify
,
int
dump
,
i_record
*
list
,
int
length
);
i_record
*
list
,
int
length
,
int
part_block_used
);
/**
* A mapper for the integer/float absolute value: type abs(type v).
...
...
ir/lower/lower_intrinsics.c
View file @
7412de5c
...
...
@@ -168,7 +168,7 @@ struct pass_t {
};
/**
* Wrapper for running lower_intrinsics() as an irprog pass.
* Wrapper for running lower_intrinsics() as an ir
_
prog pass.
*/
static
int
pass_wrapper
(
ir_prog
*
irp
,
void
*
context
)
{
...
...
@@ -179,7 +179,7 @@ static int pass_wrapper(ir_prog *irp, void *context)
}
/* pass_wrapper */
/**
* Creates an irprog pass for lower_intrinsics.
* Creates an ir
_
prog pass for lower_intrinsics.
*
* @param name the name of this pass or NULL
* @param verify should this pass be verified?
...
...
@@ -192,7 +192,7 @@ ir_prog_pass_t *lower_intrinsics_pass(
const
char
*
name
,
int
verify
,
int
dump
,
i_record
*
list
,
int
length
)
i_record
*
list
,
int
length
,
int
part_block_used
)
{
struct
pass_t
*
pass
=
xmalloc
(
sizeof
(
*
pass
)
+
(
length
-
1
)
*
sizeof
(
pass
->
list
[
0
]));
...
...
@@ -206,6 +206,10 @@ ir_prog_pass_t *lower_intrinsics_pass(
INIT_LIST_HEAD
(
&
pass
->
pass
.
list
);
memcpy
(
pass
->
list
,
list
,
sizeof
(
list
[
0
])
*
length
);
pass
->
length
=
length
;
pass
->
part_block_used
=
part_block_used
;
return
&
pass
->
pass
;
}
/* lower_intrinsics_pass*/
...
...
ir/opt/combo.c
View file @
7412de5c
...
...
@@ -72,6 +72,7 @@
#include
"irgraph_t.h"
#include
"irnode_t.h"
#include
"iropt_t.h"
#include
"irpass_t.h"
#include
"irgwalk.h"
#include
"irop.h"
#include
"irouts.h"
...
...
@@ -3567,3 +3568,29 @@ void combo(ir_graph *irg) {
set_value_of_func
(
NULL
);
current_ir_graph
=
rem
;
}
/* combo */
/**
* Wrapper for running combo() as an ir_graph pass.
*/
static
int
pass_wrapper
(
ir_graph
*
irg
,
void
*
context
)
{
(
void
)
context
;
combo
(
irg
);
/* combo is a fix-point iteration */
return
0
;
}
/* pass_wrapper */
/* Creates an ir_graph pass for combo. */
ir_graph_pass_t
*
combo_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
:
"combo"
;
pass
->
verify
=
verify
!=
0
;
pass
->
dump
=
dump
!=
0
;
INIT_LIST_HEAD
(
&
pass
->
list
);
return
pass
;
}
/* combo_pass */
Write
Preview
Supports
Markdown
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