Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
a6a3ed14
Commit
a6a3ed14
authored
Sep 28, 2015
by
Christoph Mallon
Browse files
ia32: Clean up peephole_be_IncSP().
parent
ad4a24bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_optimize.c
View file @
a6a3ed14
...
...
@@ -691,39 +691,24 @@ static void peephole_be_IncSP(ir_node *node)
(
offset
!=
+
8
||
ia32_cg_config
.
use_sub_esp_8
))
return
;
ir_node
*
stack
;
ir_node
*
stack
=
be_get_IncSP_pred
(
node
);
dbg_info
*
dbgi
=
get_irn_dbg_info
(
node
);
ir_node
*
block
=
get_nodes_block
(
node
);
if
(
offset
<
0
)
{
/* we need a free register for pop */
const
arch_register_t
*
reg
=
get_free_gp_reg
(
get_irn_irg
(
node
));
if
(
reg
==
NULL
)
arch_register_t
const
*
const
reg
=
get_free_gp_reg
(
get_irn_irg
(
node
));
if
(
!
reg
)
return
;
dbg_info
*
dbgi
=
get_irn_dbg_info
(
node
);
ir_node
*
block
=
get_nodes_block
(
node
);
stack
=
be_get_IncSP_pred
(
node
);
stack
=
create_pop
(
dbgi
,
block
,
stack
,
node
,
reg
);
if
(
offset
==
-
8
)
{
do
{
stack
=
create_pop
(
dbgi
,
block
,
stack
,
node
,
reg
);
}
}
while
((
offset
+=
4
)
!=
0
);
}
else
{
arch_register_t
const
*
const
esp
=
&
ia32_registers
[
REG_ESP
];
dbg_info
*
dbgi
=
get_irn_dbg_info
(
node
);
ir_node
*
block
=
get_nodes_block
(
node
);
stack
=
be_get_IncSP_pred
(
node
);
stack
=
new_bd_ia32_PushEax
(
dbgi
,
block
,
stack
);
arch_set_irn_register
(
stack
,
esp
);
sched_add_before
(
node
,
stack
);
if
(
offset
==
+
8
)
{
do
{
stack
=
new_bd_ia32_PushEax
(
dbgi
,
block
,
stack
);
arch_set_irn_register
(
stack
,
esp
);
arch_set_irn_register
(
stack
,
&
ia32_registers
[
REG_ESP
]
);
sched_add_before
(
node
,
stack
);
}
}
while
((
offset
-=
4
)
!=
0
);
}
be_peephole_exchange
(
node
,
stack
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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