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
a054cc32
Commit
a054cc32
authored
Mar 01, 2016
by
Christoph Mallon
Browse files
ia32: Add peephole optimization 'lea (%b), %d' -> 'mov %b, %d'.
parent
ab4368f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
NEWS.md
View file @
a054cc32
...
...
@@ -17,6 +17,7 @@ libFirm 1.22.1 (2016-01-07)
*
Add peephole optimization 'lea c(%r), %r' -> 'add $c, %r' (amd64)
*
Add peephole optimization 'lea (%r1, %r2), %r1' -> 'add %r2, %r1' and the commutated case (amd64)
*
Add peephole optimization 'lea c(, %i, 2), %d' -> 'lea c(%i, %i), %d' (ia32)
*
Add peephole optimization 'lea (%b), %d' -> 'mov %b, %d' (ia32)
*
Bugfixes
libFirm 1.22.0 (2015-12-31)
...
...
ir/be/ia32/ia32_optimize.c
View file @
a054cc32
...
...
@@ -913,6 +913,14 @@ static void peephole_ia32_Lea(ir_node *node)
ir_node
*
const
amt
=
ia32_create_Immediate
(
irg
,
scale
);
res
=
new_bd_ia32_Shl
(
dbgi
,
block
,
idx
,
amt
);
goto
exchange
;
}
else
if
(
breg
&&
!
ireg
)
{
/* lea (%b), %d -> mov %b, %d */
dbg_info
*
const
dbgi
=
get_irn_dbg_info
(
node
);
ir_node
*
const
block
=
get_nodes_block
(
node
);
res
=
be_new_d_Copy
(
dbgi
,
block
,
base
);
arch_set_irn_register
(
res
,
oreg
);
be_peephole_replace
(
node
,
res
);
return
;
}
else
if
(
breg
==
oreg
&&
ireg
&&
scale
==
0
)
{
/* lea (%b, %i), %b -> add %i, %b */
res
=
make_add
(
node
,
base
,
idx
);
...
...
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