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
d5fbca7b
Commit
d5fbca7b
authored
Jun 02, 2006
by
Michael Beck
Browse files
Fixed transform_Phi() code
[r7861]
parent
2ddf4f7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
d5fbca7b
...
...
@@ -42,6 +42,7 @@
#include "archop.h"
#include "opt_polymorphy.h"
#include "opt_confirms.h"
#include "irtools.h"
/* Make types visible to allow most efficient access */
# include "entity_t.h"
...
...
@@ -2664,7 +2665,7 @@ static ir_node *transform_node_Phi(ir_node *phi) {
/* Beware of Phi0 */
if
(
n
>
0
)
{
ir_node
*
pred
=
get_irn_n
(
phi
,
0
);
ir_node
*
bound
;
ir_node
*
bound
,
*
new_Phi
,
*
block
,
**
in
;
pn_Cmp
pnc
;
if
(
!
is_Confirm
(
pred
))
...
...
@@ -2673,6 +2674,9 @@ static ir_node *transform_node_Phi(ir_node *phi) {
bound
=
get_Confirm_bound
(
pred
);
pnc
=
get_Confirm_cmp
(
pred
);
NEW_ARR_A
(
ir_node
*
,
in
,
n
);
in
[
0
]
=
get_Confirm_value
(
pred
);
for
(
i
=
1
;
i
<
n
;
++
i
)
{
pred
=
get_irn_n
(
phi
,
i
);
...
...
@@ -2680,8 +2684,12 @@ static ir_node *transform_node_Phi(ir_node *phi) {
get_Confirm_bound
(
pred
)
!=
bound
||
get_Confirm_cmp
(
pred
)
!=
pnc
)
return
phi
;
in
[
i
]
=
get_Confirm_value
(
pred
);
}
return
new_r_Confirm
(
current_ir_graph
,
get_irn_n
(
phi
,
-
1
),
phi
,
bound
,
pnc
);
/* move the Confirm nodes "behind" the Phi */
block
=
get_irn_n
(
phi
,
-
1
);
new_Phi
=
new_r_Phi
(
current_ir_graph
,
block
,
n
,
in
,
get_irn_mode
(
phi
));
return
new_r_Confirm
(
current_ir_graph
,
block
,
new_Phi
,
bound
,
pnc
);
}
}
return
phi
;
...
...
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