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
890209b6
Commit
890209b6
authored
Sep 28, 2015
by
Christoph Mallon
Browse files
ia32: Factorise code to replace a node in the peephole phase.
parent
63bc03f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/be/ia32/ia32_optimize.c
View file @
890209b6
...
...
@@ -49,6 +49,13 @@ static void copy_mark(const ir_node *old, ir_node *newn)
set_ia32_is_remat
(
newn
);
}
static
void
replace
(
ir_node
*
const
old
,
ir_node
*
const
newn
)
{
sched_add_before
(
old
,
newn
);
copy_mark
(
old
,
newn
);
be_peephole_exchange
(
old
,
newn
);
}
typedef
enum
produces_flag_t
{
produces_no_flag
,
produces_zero_sign
,
...
...
@@ -160,9 +167,7 @@ static void peephole_ia32_Cmp(ir_node *const node)
exchange
(
user
,
test
);
}
sched_add_before
(
node
,
test
);
copy_mark
(
node
,
test
);
be_peephole_exchange
(
node
,
test
);
replace
(
node
,
test
);
}
static
bool
is_hl_register
(
arch_register_t
const
*
const
reg
)
...
...
@@ -711,11 +716,7 @@ static void peephole_ia32_Const(ir_node *node)
dbg_info
*
dbgi
=
get_irn_dbg_info
(
node
);
ir_node
*
xorn
=
new_bd_ia32_Xor0
(
dbgi
,
block
);
arch_set_irn_register
(
xorn
,
reg
);
sched_add_before
(
node
,
xorn
);
copy_mark
(
node
,
xorn
);
be_peephole_exchange
(
node
,
xorn
);
replace
(
node
,
xorn
);
}
static
bool
is_disp_const
(
ir_node
const
*
const
node
,
int32_t
const
val
)
...
...
@@ -813,9 +814,7 @@ exchange:
/* Replace the Lea by Add/Shl. */
arch_set_irn_register
(
res
,
out_reg
);
SET_IA32_ORIG_NODE
(
res
,
node
);
sched_add_before
(
node
,
res
);
copy_mark
(
node
,
res
);
be_peephole_exchange
(
node
,
res
);
replace
(
node
,
res
);
}
/**
...
...
Write
Preview
Markdown
is supported
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