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
09117779
Commit
09117779
authored
Feb 28, 2016
by
Christoph Mallon
Browse files
bepeephole: Factorise code to register peephole optimizations.
parent
901af1c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
ir/be/arm/arm_optimize.c
View file @
09117779
...
...
@@ -163,15 +163,6 @@ static void peephole_arm_Str_Ldr(ir_node *node)
attr
->
offset
=
0
;
}
/**
* Register a peephole optimization function.
*/
static
void
register_peephole_optimization
(
ir_op
*
op
,
peephole_opt_func
func
)
{
assert
(
op
->
ops
.
generic
==
NULL
);
op
->
ops
.
generic
=
(
op_func
)
func
;
}
/* Perform peephole-optimizations. */
void
arm_peephole_optimization
(
ir_graph
*
irg
)
{
...
...
ir/be/bepeephole.h
View file @
09117779
...
...
@@ -73,6 +73,15 @@ bool be_can_move_down(ir_heights_t *heights, const ir_node *node,
bool
be_can_move_up
(
ir_heights_t
*
heights
,
const
ir_node
*
node
,
const
ir_node
*
after
);
/**
* Register a peephole optimization function.
*/
static
inline
void
register_peephole_optimization
(
ir_op
*
const
op
,
peephole_opt_func
const
func
)
{
assert
(
!
op
->
ops
.
generic
);
op
->
ops
.
generic
=
(
op_func
)
func
;
}
/**
* Do peephole optimizations. It traverses the schedule of all blocks in
* backward direction. The register_values variable indicates which (live)
...
...
ir/be/ia32/ia32_optimize.c
View file @
09117779
...
...
@@ -1011,16 +1011,6 @@ static void peephole_ia32_Rol(ir_node *node)
}
}
/**
* Register a peephole optimization function.
*/
static
void
register_peephole_optimization
(
ir_op
*
op
,
peephole_opt_func
func
)
{
assert
(
op
->
ops
.
generic
==
NULL
);
op
->
ops
.
generic
=
(
op_func
)
func
;
}
/* Perform peephole-optimizations. */
void
ia32_peephole_optimization
(
ir_graph
*
irg
)
{
...
...
ir/be/sparc/sparc_finish.c
View file @
09117779
...
...
@@ -607,12 +607,6 @@ static void peephole_sparc_SubCC(ir_node *node)
remove_unused_CC
(
node
,
op_sparc_Sub
);
}
static
void
register_peephole_optimization
(
ir_op
*
op
,
peephole_opt_func
func
)
{
assert
(
op
->
ops
.
generic
==
NULL
);
op
->
ops
.
generic
=
(
op_func
)
func
;
}
static
bool
is_frame_load
(
const
ir_node
*
node
)
{
return
is_sparc_Ld
(
node
)
||
is_sparc_Ldf
(
node
);
...
...
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