Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Charles Southerland
frama-c
Commits
67a679f2
Commit
67a679f2
authored
4 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Auto loop unroll: renames is_safe into is_constant and fixes its comment.
parent
dc605d01
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/value/partitioning/auto_loop_unroll.ml
+5
-6
5 additions, 6 deletions
src/plugins/value/partitioning/auto_loop_unroll.ml
with
5 additions
and
6 deletions
src/plugins/value/partitioning/auto_loop_unroll.ml
+
5
−
6
View file @
67a679f2
...
@@ -192,17 +192,16 @@ let find_lonely_candidate loop_effect expr =
...
@@ -192,17 +192,16 @@ let find_lonely_candidate loop_effect expr =
in
in
aux
None
lvalues
aux
None
lvalues
(* Returns true if the instruction
assigns
[lval]. *)
(* Returns true if the instruction
does not modify
[lval]. *)
let
is_safe_instruction
lval
=
function
let
is_safe_instruction
lval
=
function
|
Set
(
lv
,
_
,
_
)
|
Set
(
lv
,
_
,
_
)
|
Call
(
Some
lv
,
_
,
_
,
_
)
->
not
(
Cil_datatype
.
LvalStructEq
.
equal
lval
lv
)
|
Call
(
Some
lv
,
_
,
_
,
_
)
->
not
(
Cil_datatype
.
LvalStructEq
.
equal
lval
lv
)
|
Call
(
None
,
_
,
_
,
_
)
|
Local_init
_
|
Skip
_
|
Code_annot
_
->
true
|
Call
(
None
,
_
,
_
,
_
)
|
Local_init
_
|
Skip
_
|
Code_annot
_
->
true
|
Asm
_
->
false
|
Asm
_
->
false
(* Returns true if the statement may assign [lval] during an iteration of the
(* Returns true if the statement [stmt] of function [kf] does not modify [lval].
loop [loop]. [lval] is a candidate for the automatic loop unroll heuristic,
[lval] is a candidate for the automatic loop unrolling of [loop] [loop]. *)
and thus is modified within the loop. *)
let
is_constant
kf
~
loop
lval
stmt
=
let
is_safe
lval
kf
~
loop
stmt
=
let
rec
is_safe_stmt
~
goto
stmt
=
let
rec
is_safe_stmt
~
goto
stmt
=
match
stmt
.
skind
with
match
stmt
.
skind
with
|
Instr
instr
->
is_safe_instruction
lval
instr
|
Instr
instr
->
is_safe_instruction
lval
instr
...
@@ -409,7 +408,7 @@ module Make (Abstract: Abstractions.Eva) = struct
...
@@ -409,7 +408,7 @@ module Make (Abstract: Abstractions.Eva) = struct
List
.
fold_left
(
fun
acc
(
s
,
_
,
_
,
_
,
_
)
->
delta_stmt
acc
s
)
acc
list
List
.
fold_left
(
fun
acc
(
s
,
_
,
_
,
_
,
_
)
->
delta_stmt
acc
s
)
acc
list
|
_
->
|
_
->
(* For other statements, we only check that they do not modify [lval]. *)
(* For other statements, we only check that they do not modify [lval]. *)
if
is_
safe
lval
kf
~
loop
stmt
then
acc
else
raise
NoIncrement
if
is_
constant
kf
~
loop
lval
stmt
then
acc
else
raise
NoIncrement
and
delta_block
acc
block
=
and
delta_block
acc
block
=
List
.
fold_left
delta_stmt
acc
block
.
bstmts
List
.
fold_left
delta_stmt
acc
block
.
bstmts
in
in
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment