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
1a7bc837
Commit
1a7bc837
authored
Feb 29, 2016
by
Christoph Mallon
Browse files
ia32: Add peephole optimization 'lea c(, %i, 2), %d' -> 'lea c(%i, %i), %d'.
With base the displacement may be a single byte.
parent
700d2d80
Changes
2
Hide whitespace changes
Inline
Side-by-side
NEWS.md
View file @
1a7bc837
...
...
@@ -16,6 +16,7 @@ libFirm 1.22.1 (2016-01-07)
*
Add peephole optimization 'mov $0, %r' -> 'xorl %r, %r' (amd64)
*
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)
*
Bugfixes
libFirm 1.22.0 (2015-12-31)
...
...
ir/be/ia32/ia32_optimize.c
View file @
1a7bc837
...
...
@@ -948,9 +948,15 @@ exchange:
arch_set_irn_register
(
res
,
oreg
);
SET_IA32_ORIG_NODE
(
res
,
node
);
replace
(
node
,
res
);
return
;
}
}
}
if
(
!
breg
&&
scale
==
1
)
{
/* lea c(, %i, 2), %d -> lea c(%i, %i), %d */
set_irn_n
(
node
,
n_ia32_Lea_base
,
idx
);
set_ia32_am_scale
(
node
,
0
);
}
}
/**
...
...
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