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
0b898220
Commit
0b898220
authored
Mar 07, 2011
by
Matthias Braun
Browse files
allocate spillslots at beginning/end of stackframe depending on omit_fp mode
parent
07615f9f
Changes
6
Hide whitespace changes
Inline
Side-by-side
ir/be/amd64/bearch_amd64.c
View file @
0b898220
...
...
@@ -237,11 +237,13 @@ static void amd64_collect_frame_entity_nodes(ir_node *node, void *data)
static
void
amd64_after_ra
(
ir_graph
*
irg
)
{
be_fec_env_t
*
fec_env
=
be_new_frame_entity_coalescer
(
irg
);
be_stack_layout_t
*
stack_layout
=
be_get_irg_stack_layout
(
irg
);
bool
at_begin
=
stack_layout
->
sp_relative
?
true
:
false
;
be_fec_env_t
*
fec_env
=
be_new_frame_entity_coalescer
(
irg
);
/* create and coalesce frame entities */
irg_walk_graph
(
irg
,
NULL
,
amd64_collect_frame_entity_nodes
,
fec_env
);
be_assign_entities
(
fec_env
,
amd64_set_frame_entity
);
be_assign_entities
(
fec_env
,
amd64_set_frame_entity
,
at_begin
);
be_free_frame_entity_coalescer
(
fec_env
);
irg_block_walk_graph
(
irg
,
NULL
,
amd64_after_ra_walker
,
NULL
);
...
...
ir/be/arm/bearch_arm.c
View file @
0b898220
...
...
@@ -269,10 +269,12 @@ static void arm_set_frame_entity(ir_node *node, ir_entity *entity)
static
void
arm_after_ra
(
ir_graph
*
irg
)
{
be_fec_env_t
*
fec_env
=
be_new_frame_entity_coalescer
(
irg
);
be_stack_layout_t
*
stack_layout
=
be_get_irg_stack_layout
(
irg
);
bool
at_begin
=
stack_layout
->
sp_relative
?
true
:
false
;
be_fec_env_t
*
fec_env
=
be_new_frame_entity_coalescer
(
irg
);
irg_walk_graph
(
irg
,
NULL
,
arm_collect_frame_entity_nodes
,
fec_env
);
be_assign_entities
(
fec_env
,
arm_set_frame_entity
);
be_assign_entities
(
fec_env
,
arm_set_frame_entity
,
at_begin
);
be_free_frame_entity_coalescer
(
fec_env
);
irg_block_walk_graph
(
irg
,
NULL
,
arm_after_ra_walker
,
NULL
);
...
...
ir/be/bespillslots.c
View file @
0b898220
...
...
@@ -74,6 +74,8 @@ struct be_fec_env_t {
affinity_edge_t
**
affinity_edges
;
set
*
memperms
;
set_frame_entity_func
set_frame_entity
;
bool
at_begin
;
/**< frame entities should be allocate at
the beginning of the stackframe */
};
/** Compare 2 affinity edges (used in quicksort) */
...
...
@@ -522,12 +524,10 @@ static memperm_t *get_memperm(be_fec_env_t *env, ir_node *block)
static
ir_entity
*
create_stack_entity
(
be_fec_env_t
*
env
,
spill_slot_t
*
slot
)
{
ir_graph
*
irg
=
env
->
irg
;
ir_type
*
frame
=
get_irg_frame_type
(
irg
);
/* TODO: backend should be able to specify wether we want spill slots
* at begin or end of frame */
int
at_start
=
1
;
ir_entity
*
res
=
frame_alloc_area
(
frame
,
slot
->
size
,
slot
->
align
,
at_start
);
ir_graph
*
irg
=
env
->
irg
;
ir_type
*
frame
=
get_irg_frame_type
(
irg
);
ir_entity
*
res
=
frame_alloc_area
(
frame
,
slot
->
size
,
slot
->
align
,
env
->
at_begin
);
/* adjust size of the entity type... */
ir_type
*
enttype
=
get_entity_type
(
res
);
...
...
@@ -783,9 +783,11 @@ void be_free_frame_entity_coalescer(be_fec_env_t *env)
}
void
be_assign_entities
(
be_fec_env_t
*
env
,
set_frame_entity_func
set_frame_entity
)
set_frame_entity_func
set_frame_entity
,
bool
alloc_entities_at_begin
)
{
env
->
set_frame_entity
=
set_frame_entity
;
env
->
at_begin
=
alloc_entities_at_begin
;
stat_ev_dbl
(
"spillslots"
,
set_count
(
env
->
spills
));
...
...
ir/be/bespillslots.h
View file @
0b898220
...
...
@@ -27,6 +27,7 @@
#ifndef FIRM_BE_BESPILLSLOTS_H
#define FIRM_BE_BESPILLSLOTS_H
#include
<stdbool.h>
#include
"beirg.h"
typedef
struct
be_fec_env_t
be_fec_env_t
;
...
...
@@ -60,6 +61,7 @@ typedef void (*set_frame_entity_func)(ir_node *node, ir_entity *entity);
* Assigned frame entities to all the nodes added by be_node_needs_frame_entity.
* Adds memory perms where needed.
*/
void
be_assign_entities
(
be_fec_env_t
*
env
,
set_frame_entity_func
set_frame
);
void
be_assign_entities
(
be_fec_env_t
*
env
,
set_frame_entity_func
set_frame
,
bool
alloc_entities_at_begin
);
#endif
ir/be/ia32/bearch_ia32.c
View file @
0b898220
...
...
@@ -1328,11 +1328,13 @@ need_stackent:
*/
static
void
ia32_after_ra
(
ir_graph
*
irg
)
{
be_fec_env_t
*
fec_env
=
be_new_frame_entity_coalescer
(
irg
);
be_stack_layout_t
*
stack_layout
=
be_get_irg_stack_layout
(
irg
);
bool
at_begin
=
stack_layout
->
sp_relative
?
true
:
false
;
be_fec_env_t
*
fec_env
=
be_new_frame_entity_coalescer
(
irg
);
/* create and coalesce frame entities */
irg_walk_graph
(
irg
,
NULL
,
ia32_collect_frame_entity_nodes
,
fec_env
);
be_assign_entities
(
fec_env
,
ia32_set_frame_entity
);
be_assign_entities
(
fec_env
,
ia32_set_frame_entity
,
at_begin
);
be_free_frame_entity_coalescer
(
fec_env
);
irg_block_walk_graph
(
irg
,
NULL
,
ia32_after_ra_walker
,
NULL
);
...
...
ir/be/sparc/bearch_sparc.c
View file @
0b898220
...
...
@@ -281,10 +281,12 @@ static void sparc_set_frame_entity(ir_node *node, ir_entity *entity)
static
void
sparc_after_ra
(
ir_graph
*
irg
)
{
be_fec_env_t
*
fec_env
=
be_new_frame_entity_coalescer
(
irg
);
be_stack_layout_t
*
stack_layout
=
be_get_irg_stack_layout
(
irg
);
bool
at_begin
=
stack_layout
->
sp_relative
?
true
:
false
;
be_fec_env_t
*
fec_env
=
be_new_frame_entity_coalescer
(
irg
);
irg_walk_graph
(
irg
,
NULL
,
sparc_collect_frame_entity_nodes
,
fec_env
);
be_assign_entities
(
fec_env
,
sparc_set_frame_entity
);
be_assign_entities
(
fec_env
,
sparc_set_frame_entity
,
at_begin
);
be_free_frame_entity_coalescer
(
fec_env
);
irg_block_walk_graph
(
irg
,
NULL
,
sparc_after_ra_walker
,
NULL
);
...
...
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