Commit 2d70882
authored
Reuse prebuilt KMIR definition to avoid redundant
If a Rust file contains multiple targets to prove (e.g. [verify-rust-std
challenge
11](https://github.com/runtimeverification/mir-semantics/tree/master/kmir/src/tests/integration/data/verify-rust-std/0011-floats-ints))
then multiple `llvm-kompile` processes will be invoked by
[_prove](https://github.com/runtimeverification/mir-semantics/blob/c92c8ce0b4b0d762d679a15351b562fa243fd8f0/kmir/src/kmir/_prove.py#L70-L77).
This PR pushes this process earlier to create a KMIR definition with all
the required start symbols so that `llvm-kompile` is called once per
file.
In particular:
- `test_verify_rust_std` now compiles a prebuilt KMIR definition with
reduced start symbols. This definition is reused for all proof harnesses
in a file;
- `prove_with_kmir` is added as separate control-flow to `prove`. This
may not be _elegant_, but right now I think it is the clearest
separation, and I was hesitant to add flags or refactor too
aggressively;
Results from verify-std-rust challenge 11:
- Prior to this refactoring: 1 `llvm-kompile` / start-symbol = 138
`llvm-kompile` invocations
- After this refactoring: 1 `llvm-kompile` / file = 16 `llvm-kompile`
invocations
- Approximately 3x increase of performance
<details>
PRIOR:
real 31m16.872s
user 170m18.245s
sys 5m51.240s
real 31m36.755s
user 175m15.830s
sys 6m32.859s
AFTER:
real 10m20.730s
user 44m10.271s
sys 2m15.364s
real 10m58s
user 47m0s
sys 2m24s
real 10m40.395s
user 45m54.822s
sys 2m20.399s
real 10m38.370s
user 45m32.886s
sys 2m19.782s
</details>llvm-kompile processes (#1069)1 parent 47e9021 commit 2d70882
3 files changed
Lines changed: 74 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
52 | 80 | | |
53 | 81 | | |
54 | 82 | | |
| |||
107 | 135 | | |
108 | 136 | | |
109 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
110 | 142 | | |
111 | 143 | | |
112 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
308 | 312 | | |
309 | 313 | | |
310 | 314 | | |
| |||
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
316 | | - | |
317 | | - | |
318 | 320 | | |
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
322 | 324 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
338 | 334 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
343 | 358 | | |
344 | 359 | | |
345 | 360 | | |
| |||
0 commit comments