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
e57a540f
Commit
e57a540f
authored
Feb 09, 2007
by
Christian Würdig
Browse files
added isa-callback so backend can provide it's own sorted list of irgs to generate code for
parent
7fa8db74
Changes
5
Hide whitespace changes
Inline
Side-by-side
ir/be/bearch.h
View file @
e57a540f
...
...
@@ -737,6 +737,16 @@ struct _arch_isa_if_t {
* @param self The isa object.
*/
const
be_machine_t
*
(
*
get_machine
)(
const
void
*
self
);
/**
* Return an ordered list of irgs where code should be generated for.
* If NULL is returned, all irg will be taken into account and they will be
* generated in an arbitrary order.
* @param self The isa object.
* @param irgs A flexible array ARR_F of length 0 where the backend cann append the desired irgs.
* @return A flexible array ARR_F containing all desired irgs in the desired order.
*/
ir_graph
**
(
*
get_backend_irg_list
)(
const
void
*
self
,
ir_graph
**
irgs
);
};
#define arch_isa_get_n_reg_class(isa) ((isa)->impl->get_n_reg_class(isa))
...
...
@@ -748,6 +758,7 @@ struct _arch_isa_if_t {
#define arch_isa_get_reg_class_alignment(isa, cls) ((isa)->impl->get_reg_class_alignment((isa), (cls)))
#define arch_isa_get_allowed_execution_units(isa, irn) ((isa)->impl->get_allowed_execution_units((isa), (irn)))
#define arch_isa_get_machine(isa) ((isa)->impl->get_machine((isa)))
#define arch_isa_get_backend_irg_list(isa, irgs) ((isa)->impl->get_backend_irg_list((isa), (irgs)))
#define ARCH_MAX_HANDLERS 8
...
...
ir/be/bemain.c
View file @
e57a540f
...
...
@@ -373,6 +373,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
static
const
char
suffix
[]
=
".prof"
;
be_irg_t
*
birgs
;
unsigned
num_birgs
;
ir_graph
**
irg_list
,
**
backend_irg_list
;
be_ra_timer_t
*
ra_timer
;
...
...
@@ -407,16 +408,21 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
be_dbg_so
(
env
.
db_handle
,
cup_name
);
be_dbg_types
(
env
.
db_handle
);
/* backend may provide an ordered list of irgs where code should be generated for */
irg_list
=
NEW_ARR_F
(
ir_graph
*
,
0
);
backend_irg_list
=
arch_isa_get_backend_irg_list
(
isa
,
irg_list
);
/* we might need 1 birg more for instrumentation constructor */
num_birgs
=
get_irp_n_irgs
();
num_birgs
=
backend_irg_list
?
ARR_LEN
(
backend_irg_list
)
:
get_irp_n_irgs
();
birgs
=
alloca
(
sizeof
(
birgs
[
0
])
*
(
num_birgs
+
1
));
/* First: initialize all birgs */
for
(
i
=
0
;
i
<
get_irp_n_
irgs
()
;
++
i
)
{
ir_graph
*
irg
=
get_irp_irg
(
i
);
for
(
i
=
0
;
i
<
num_b
irgs
;
++
i
)
{
ir_graph
*
irg
=
backend_irg_list
?
backend_irg_list
[
i
]
:
get_irp_irg
(
i
);
initialize_birg
(
&
birgs
[
i
],
irg
,
&
env
);
}
DEL_ARR_F
(
irg_list
);
/*
Get the filename for the profiling data.
...
...
@@ -442,7 +448,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
/* For all graphs */
for
(
i
=
0
;
i
<
num_birgs
;
++
i
)
{
be_irg_t
*
birg
=
&
birgs
[
i
];
be_irg_t
*
birg
=
&
birgs
[
i
];
ir_graph
*
irg
=
birg
->
irg
;
optimization_state_t
state
;
const
arch_code_generator_if_t
*
cg_if
;
...
...
ir/be/firm/bearch_firm.c
View file @
e57a540f
...
...
@@ -627,6 +627,13 @@ static const be_machine_t *firm_get_machine(const void *self) {
return
NULL
;
}
/**
* Return irp irgs in the desired order.
*/
static
ir_graph
**
firm_get_irg_list
(
const
void
*
self
,
ir_graph
**
irg_list
)
{
return
NULL
;
}
/**
* Returns the libFirm configuration parameter for this backend.
*/
...
...
@@ -666,4 +673,5 @@ const arch_isa_if_t firm_isa = {
firm_get_libfirm_params
,
firm_get_allowed_execution_units
,
firm_get_machine
,
firm_get_irg_list
,
};
ir/be/mips/bearch_mips.c
View file @
e57a540f
...
...
@@ -945,6 +945,13 @@ static const be_machine_t *mips_get_machine(const void *self) {
return
NULL
;
}
/**
* Return irp irgs in the desired order.
*/
static
ir_graph
**
mips_get_irg_list
(
const
void
*
self
,
ir_graph
**
irg_list
)
{
return
NULL
;
}
/**
* Returns the libFirm configuration parameter for this backend.
*/
...
...
@@ -984,6 +991,7 @@ const arch_isa_if_t mips_isa_if = {
mips_get_libfirm_params
,
mips_get_allowed_execution_units
,
mips_get_machine
,
mips_get_irg_list
,
};
void
be_init_arch_mips
(
void
)
...
...
ir/be/ppc32/bearch_ppc32.c
View file @
e57a540f
...
...
@@ -884,6 +884,13 @@ static const be_machine_t *ppc32_get_machine(const void *self) {
return
NULL
;
}
/**
* Return irp irgs in the desired order.
*/
static
ir_graph
**
ppc32_get_irg_list
(
const
void
*
self
,
ir_graph
**
irg_list
)
{
return
NULL
;
}
/**
* Returns the libFirm configuration parameter for this backend.
*/
...
...
@@ -923,6 +930,7 @@ const arch_isa_if_t ppc32_isa_if = {
ppc32_get_libfirm_params
,
ppc32_get_allowed_execution_units
,
ppc32_get_machine
,
ppc32_get_irg_list
,
};
void
be_init_arch_ppc32
(
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