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
52085dfb
Commit
52085dfb
authored
Aug 07, 2014
by
Matthias Braun
Browse files
jumpthreading: cleaner PhiLoop handling
parent
1b9ce672
Changes
1
Show whitespace changes
Inline
Side-by-side
ir/opt/jumpthreading.c
View file @
52085dfb
...
...
@@ -96,7 +96,9 @@ static ir_node *search_def_and_create_phis(ir_node *block, ir_mode *mode,
in
[
i
]
=
dummy
;
}
ir_node
*
phi
=
new_r_Phi
(
block
,
n_cfgpreds
,
in
,
mode
);
/* we might have created a potential endless loop, and need a PhiLoop */
ir_node
*
phi
=
mode
==
mode_M
?
new_r_Phi_loop
(
block
,
n_cfgpreds
,
in
)
:
new_r_Phi
(
block
,
n_cfgpreds
,
in
,
mode
);
set_irn_link
(
block
,
phi
);
mark_irn_visited
(
block
);
...
...
@@ -112,11 +114,6 @@ static ir_node *search_def_and_create_phis(ir_node *block, ir_mode *mode,
}
set_irn_n
(
phi
,
i
,
pred_val
);
}
/* we might have created a potential endless loop, so keep the Phi */
if
(
get_irn_mode
(
phi
)
==
mode_M
)
{
keep_alive
(
phi
);
set_Phi_loop
(
phi
,
true
);
}
return
phi
;
}
...
...
@@ -320,12 +317,9 @@ static void copy_and_fix(const jumpthreading_env_t *env, ir_node *block,
if
(
get_irn_visited
(
keep
)
<
env
->
visited_nr
||
is_Block
(
keep
))
continue
;
ir_node
*
copy
=
get_irn_link
(
keep
);
if
(
is_Phi
(
keep
)
&&
is_Phi
(
copy
))
{
assert
(
get_irn_mode
(
keep
)
==
mode_M
);
assert
(
get_Phi_loop
(
keep
));
/* exact copy does not reproduce the keep alive edges */
if
(
is_Phi
(
copy
)
&&
get_Phi_loop
(
copy
))
add_End_keepalive
(
end
,
copy
);
set_Phi_loop
(
copy
,
true
);
}
}
}
...
...
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