Commit f7752cf
Remi Delmas
Function contracts: performance optimisation for assigns clause checking.
- don't instrument assignments to locals and function parameters,
- don't add function parameters and non-dirty locals to the write set,
- remove from the local write set CARs that are provably not alive,
- remove function parameters and locals from assigns clauses in tests.
Sanity checks:
- change GOTO instruction with false guards into SKIP instructions
(removes artificial loops),
- check loop-freeness before assigns clause instrumentation
(required for soundness of assigns clause checking).
The net effect of these changes is a better proof performance because
of a reduction in the number of generated assertions and of their
size, but otherwise the contract checking functionality remains
unchanged.
Rationale:
Assigning to local variables or function parameter is always
legal so we skip instrumenting these assignments. We avoid adding
function parameters and local variables to the local write set, except
when their address is taken at some point in the program and can later
be assigned to indirectly via pointers.
When generating inclusion checks for assignments, we remove from the
local write set targets which are not possibly alive at the ASSIGN
instruction that gets instrumented.1 parent 4ec7d9b commit f7752cf
File tree
54 files changed
+642
-253
lines changed- regression/contracts
- assigns_enforce_04
- assigns_enforce_05
- assigns_enforce_18
- assigns_enforce_21
- assigns_enforce_arrays_01
- assigns_enforce_arrays_03
- assigns_enforce_arrays_04
- assigns_enforce_arrays_05
- assigns_enforce_detect_local_statics
- assigns_enforce_free_dead
- assigns_enforce_malloc_01
- assigns_enforce_malloc_02
- assigns_enforce_multi_file_02
- assigns_enforce_statics
- assigns_enforce_structs_01
- assigns_enforce_structs_02
- assigns_enforce_structs_03
- assigns_enforce_structs_04
- assigns_enforce_subfunction_calls
- assigns_function_pointer
- assigns_type_checking_valid_cases
- assigns_validity_pointer_01
- assigns_validity_pointer_02
- function_check_02
- history-pointer-enforce-10
- loop-freeness-check
- quantifiers-exists-ensures-enforce
- quantifiers-exists-requires-enforce
- quantifiers-forall-ensures-enforce
- quantifiers-forall-requires-enforce
- quantifiers-nested-01
- quantifiers-nested-03
- test_aliasing_ensure_indirect
- test_aliasing_ensure
- src/goto-instrument/contracts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
54 files changed
+642
-253
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 6 | | |
13 | 7 | | |
14 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | | - | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | | - | |
16 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
0 commit comments