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
e32ef8d2
Commit
e32ef8d2
authored
Nov 20, 2008
by
Michael Beck
Browse files
- improve Confirm construction: if the right argument of an confirm is not a constant,
construct inverse Confirms [r23863]
parent
7a404958
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ana/irconsconfirm.c
View file @
e32ef8d2
...
...
@@ -351,6 +351,34 @@ static void handle_if(ir_node *block, ir_node *cmp, pn_Cmp pnc, env_t *env) {
env
->
num_confirms
+=
1
;
}
}
if
(
!
is_Const
(
right
))
{
/* also construct inverse Confirms */
c
=
NULL
;
pnc
=
get_inversed_pnc
(
pnc
);
for
(
edge
=
get_irn_out_edge_first
(
right
);
edge
;
edge
=
next
)
{
ir_node
*
succ
=
get_edge_src_irn
(
edge
);
int
pos
=
get_edge_src_pos
(
edge
);
ir_node
*
blk
=
get_effective_use_block
(
succ
,
pos
);
next
=
get_irn_out_edge_next
(
left
,
edge
);
if
(
block_dominates
(
block
,
blk
))
{
/*
* Ok, we found a usage of right in a block
* dominated by the branch block.
* We can replace the input with a Confirm(right, pnc^-1, left).
*/
if
(
!
c
)
c
=
new_r_Confirm
(
current_ir_graph
,
block
,
right
,
left
,
pnc
);
pos
=
get_edge_src_pos
(
edge
);
set_irn_n
(
succ
,
pos
,
c
);
DB
((
dbg
,
LEVEL_2
,
"Replacing input %d of node %+F with %+F
\n
"
,
pos
,
succ
,
c
));
env
->
num_confirms
+=
1
;
}
}
}
}
}
/* handle_if */
...
...
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