Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CertiCompil
CompCert-KVX
Commits
b6b7b6a5
Commit
b6b7b6a5
authored
Apr 02, 2021
by
Cyril SIX
Browse files
More efficient
parent
6d4dc7ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/Duplicateaux.ml
View file @
b6b7b6a5
...
...
@@ -309,14 +309,18 @@ let get_loop_info f is_loop_header bfs_order code =
let
mark_body
body
=
List
.
iter
(
fun
n
->
match
get_some
@@
PTree
.
get
n
code
with
|
Icond
(
_
,
_
,
ifso
,
ifnot
,
_
)
->
let
b1
=
List
.
mem
ifso
body
in
let
b2
=
List
.
mem
ifnot
body
in
if
(
b1
&&
b2
)
then
()
else
if
(
b1
||
b2
)
then
begin
if
b1
then
loop_info
:=
PTree
.
set
n
(
Some
true
)
!
loop_info
else
if
b2
then
loop_info
:=
PTree
.
set
n
(
Some
false
)
!
loop_info
end
|
Icond
(
_
,
_
,
ifso
,
ifnot
,
_
)
->
begin
match
PTree
.
get
n
!
loop_info
with
|
None
->
()
|
Some
_
->
let
b1
=
List
.
mem
ifso
body
in
let
b2
=
List
.
mem
ifnot
body
in
if
(
b1
&&
b2
)
then
()
else
if
(
b1
||
b2
)
then
begin
if
b1
then
loop_info
:=
PTree
.
set
n
(
Some
true
)
!
loop_info
else
if
b2
then
loop_info
:=
PTree
.
set
n
(
Some
false
)
!
loop_info
end
end
|
_
->
()
)
body
in
let
bodymap
=
get_loop_bodies
code
f
.
fn_entrypoint
in
...
...
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