perf(llvm): limit expensive live range splitting#362
Merged
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This tunes LLVM greedy register allocation for the large single-function modules that revmc generates. Greedy regalloc's global live range splitting can spend seconds on rematerializable values with many live-range segments; lowering
huge-size-for-splitmakes LLVM use its cheaper splitting path for those cases.Benchmarks
Headline numbers across all benchmarks discovered by
./scripts/bench.py(21 built-ins plus 9tmp/mainnetcontracts): total compile time -27.1%, codegen -32.2%, and total jit size is unchanged. The biggest wins aresnailtracer(8.315s to 1.580s total, codegen 4.134s to 668ms),onchain_lm_v2(4.551s to 1.486s total, codegen 2.060s to 489ms), andburntpix(6.157s to 4.841s total, codegen 2.095s to 1.652s).The full no-argument benchmark set requires a local CLI fix for multi-contract fixtures that defer JIT finalization until all fixture bytecodes are translated. That fix was applied to both sides of this benchmark, so the comparison below isolates the LLVM flag against
mainplus that CLI fix.Codegen statistics
Full details
356
=
113
=
306
=
444 B
=
2
=
3
=
5
=
6
=
348
=
115
=
348
=
601 B
=
2
=
3
=
8
=
9
=
1018
=
343
=
541
=
876 B
=
8
=
7
=
0
-
0
-
54487
=
20614
=
41289
=
114.6 KiB
=
1379
=
2245
=
96
=
528
=
12758
=
3743
=
6180
=
19.0 KiB
=
256
=
342
=
32
=
106
=
968
=
309
=
557
=
1.4 KiB
=
16
=
23
=
0
-
0
-
13888
=
4890
=
9826
=
25.7 KiB
=
308
=
441
=
14
=
82
=
371
=
183
=
339
=
633 B
=
1
=
15
=
0
-
0
-
7162
=
2597
=
4733
=
11.7 KiB
=
105
=
196
=
24
=
23
=
77617
=
24084
=
43709
=
144.0 KiB
=
1773
=
2609
=
173
=
748
=
43815
=
14124
=
24740
=
79.2 KiB
=
888
=
1373
=
80
=
436
=
81868
=
26146
=
46087
-0.1% 🟢
164.4 KiB
-0.3% 🟢
2009
=
2914
=
272
=
537
=
131064
=
50577
=
94440
=
293.2 KiB
=
4232
=
5268
=
437
=
2483
=
27296
=
9377
=
17198
=
47.2 KiB
=
560
=
841
=
57
=
340
=
2119
=
537
=
1013
=
2.6 KiB
=
29
=
53
=
0
-
0
-
1807
=
490
=
911
=
2.5 KiB
=
33
=
51
=
0
-
0
-
597
=
224
=
409
=
716 B
=
8
=
9
=
1
=
1
=
542
=
196
=
398
=
739 B
=
6
=
5
=
0
-
0
-
23318
=
8645
=
15632
=
28.2 KiB
=
522
=
812
=
25
=
106
=
62942
=
21343
=
40361
=
107.6 KiB
=
1353
=
1692
=
67
=
471
=
209433
=
71854
=
131821
=
221.1 KiB
=
5298
=
6832
=
599
=
2709
=
133704
=
38862
=
69733
=
228.9 KiB
=
2987
=
4492
=
358
=
2621
=
137618
=
36315
=
75489
=
302.2 KiB
=
3594
=
5343
=
619
=
2204
=
138128
=
36592
=
75492
=
301.7 KiB
=
3614
=
5337
=
622
=
2099
=
146858
=
41987
=
83405
+0.4% 🔴
313.1 KiB
+0.1% 🔴
3910
=
5108
=
755
=
2334
=
121219
=
38239
=
60775
=
201.1 KiB
=
2536
=
3463
=
462
=
1365
=
120766
=
37192
=
65538
=
208.3 KiB
=
2626
=
3546
=
252
=
1531
=
130435
=
37588
=
68110
-0.3% 🟢
237.1 KiB
+0.5% 🔴
2884
=
4476
=
296
-0.7% 🟢
1616
-0.2% 🟢
119343
=
36765
=
64875
=
202.7 KiB
=
2595
=
3507
=
249
=
1519
=
96771
=
28806
=
43735
=
140.5 KiB
=
1874
=
2758
=
203
=
888
=
1898616
=
592850
=
1087990
=
3.3 MiB
=
45408
=
63764
=
5706
=
24762
=
Compile times
Full compile times
9.85ms
+3.6% 🔴
204.3µs
+4.5% 🔴
482.6µs
-1.1% 🟢
5.92ms
+2.1% 🔴
3.25ms
+7.2% 🔴
10.6ms
+2.2% 🔴
180.7µs
-3.1% 🟢
505.1µs
+7.4% 🔴
6.32ms
+2.7% 🔴
3.55ms
+0.8% 🔴
14.0ms
+2.9% 🔴
338.5µs
-7.8% 🟢
618.7µs
+1.2% 🔴
8.33ms
+2.4% 🔴
4.73ms
+4.9% 🔴
1.580s
-81.0% 🟢
8.37ms
-0.4% 🟢
10.9ms
+7.7% 🔴
893.0ms
-78.5% 🟢
668.0ms
-83.8% 🟢
162.8ms
-0.8% 🟢
2.30ms
+4.7% 🔴
3.05ms
+9.4% 🔴
95.9ms
-2.0% 🟢
61.5ms
+0.6% 🔴
15.1ms
+3.8% 🔴
308.4µs
+3.6% 🔴
624.1µs
+2.9% 🔴
9.21ms
+3.6% 🔴
5.00ms
+4.2% 🔴
317.8ms
-0.3% 🟢
2.33ms
-3.6% 🟢
2.94ms
-7.0% 🟢
185.5ms
-0.9% 🟢
127.0ms
+1.0% 🔴
9.73ms
+0.8% 🔴
169.3µs
-4.6% 🟢
490.3µs
+6.5% 🔴
5.88ms
+2.1% 🔴
3.19ms
-2.0% 🟢
106.1ms
-3.9% 🟢
1.39ms
-3.5% 🟢
1.82ms
-3.9% 🟢
64.5ms
-2.7% 🟢
38.4ms
-5.8% 🟢
1.271s
+2.7% 🔴
15.5ms
-1.0% 🟢
16.5ms
+13.4% 🔴
741.3ms
+0.2% 🔴
497.6ms
+6.4% 🔴
736.5ms
+2.1% 🔴
7.96ms
+10.1% 🔴
9.19ms
+11.0% 🔴
470.8ms
+1.5% 🔴
248.5ms
+2.8% 🔴
1.353s
-1.5% 🟢
14.9ms
+4.5% 🔴
15.8ms
-2.1% 🟢
812.4ms
-0.9% 🟢
509.5ms
-2.7% 🟢
3.122s
-6.6% 🟢
21.2ms
+3.5% 🔴
28.7ms
+15.8% 🔴
2.050s
-6.4% 🟢
1.022s
-7.9% 🟢
483.1ms
-2.3% 🟢
4.61ms
-2.5% 🟢
5.58ms
-1.1% 🟢
324.4ms
-1.7% 🟢
148.5ms
-3.7% 🟢
22.0ms
-4.1% 🟢
502.4µs
-5.6% 🟢
811.4µs
-6.9% 🟢
13.2ms
-3.5% 🟢
7.46ms
-4.7% 🟢
20.4ms
-5.9% 🟢
421.1µs
-7.6% 🟢
733.3µs
-2.4% 🟢
12.1ms
-7.3% 🟢
7.15ms
-3.6% 🟢
11.1ms
-4.6% 🟢
229.7µs
-5.4% 🟢
516.4µs
-5.6% 🟢
6.52ms
-7.6% 🟢
3.81ms
+1.2% 🔴
10.2ms
-9.1% 🟢
221.1µs
-3.0% 🟢
506.4µs
-9.8% 🟢
6.04ms
-11.4% 🟢
3.48ms
-5.1% 🟢
375.3ms
-5.5% 🟢
3.95ms
-1.8% 🟢
4.74ms
+4.4% 🔴
234.3ms
-4.2% 🟢
132.3ms
-8.1% 🟢
1.486s
-67.3% 🟢
249.4ms
-4.7% 🟢
13.8ms
-12.1% 🟢
734.4ms
-66.8% 🟢
488.5ms
-76.3% 🟢
4.841s
-21.4% 🟢
38.2ms
-1.0% 🟢
41.6ms
-12.4% 🟢
3.110s
-21.8% 🟢
1.652s
-21.1% 🟢
2.313s
-7.8% 🟢
24.8ms
+1.1% 🔴
26.1ms
-1.5% 🟢
1.462s
-1.2% 🟢
800.1ms
-18.2% 🟢
1.929s
-6.5% 🟢
23.5ms
-1.5% 🟢
27.0ms
+2.2% 🔴
1.103s
-13.1% 🟢
775.2ms
+4.4% 🔴
1.960s
-26.5% 🟢
22.9ms
+1.3% 🔴
25.8ms
-2.9% 🟢
1.139s
-37.5% 🟢
772.2ms
-3.0% 🟢
2.496s
+3.1% 🔴
25.2ms
-2.4% 🟢
26.8ms
-6.1% 🟢
1.452s
=
992.6ms
+8.3% 🔴
2.397s
+9.1% 🔴
20.1ms
+5.0% 🔴
23.1ms
+2.5% 🔴
1.574s
+13.5% 🔴
779.9ms
+1.5% 🔴
1.989s
-0.2% 🟢
19.9ms
-4.1% 🟢
22.5ms
-10.1% 🟢
1.234s
+0.6% 🔴
712.2ms
-1.0% 🟢
1.986s
-16.2% 🟢
20.6ms
-3.3% 🟢
23.9ms
-7.7% 🟢
1.196s
-13.3% 🟢
746.0ms
-21.0% 🟢
2.014s
-12.7% 🟢
19.7ms
-4.1% 🟢
22.3ms
-5.4% 🟢
1.255s
-15.5% 🟢
717.2ms
-7.7% 🟢
1.512s
-1.3% 🟢
16.5ms
-2.2% 🟢
20.8ms
-1.1% 🟢
941.6ms
-1.3% 🟢
532.8ms
-1.3% 🟢
34.554s
-27.1% 🟢
565.7ms
-2.3% 🟢
378.0ms
-2.2% 🟢
21.147s
-24.5% 🟢
12.463s
-32.2% 🟢