Fix perf bounds on amd64/Linux following the change to *_range_field
[ghc.git] / testsuite / tests / perf / compiler / all.T
1 def no_lint(opts):
2    opts.compiler_always_flags = \
3        filter(lambda opt: opt != '-dcore-lint' and opt != '-dcmm-lint', opts.compiler_always_flags)
4
5 setTestOpts(no_lint)
6
7
8 test('T1969',
9      [if_wordsize(32,
10           compiler_stats_range_field('peak_megabytes_allocated', 18, 1)),
11                              # expected value: 14 (x86/Windows 17/05/10)
12                              #                 15 (x86/OS X)
13                              #                 19 (x86/OS X)
14       if_wordsize(64,
15           compiler_stats_range_field('peak_megabytes_allocated', 25, 1)),
16                                              # expected value: 28 (amd64/Linux)
17                                              # expected value: 34 (amd64/Linux)
18                                              # 2012-09-20      23 (amd64/Linux)
19                                              # 2012-10-03      25 (amd64/Linux if .hi exists)
20       if_wordsize(32,
21           compiler_stats_range_field('max_bytes_used', 6149572, 5)),
22                              # expected value: 6707308 (x86/OS X)
23                              #                 5717704 (x86/Windows 17/05/10)
24                              #                 6149572 (x86/Linux, 31/12/09)
25       if_wordsize(64,
26           compiler_stats_range_field('max_bytes_used', 9000000, 20)),
27                                   # looks like the peak is around 10M, but we're
28                                   # unlikely to GC exactly on the peak.
29                                   # varies quite a lot with CLEANUP and BINDIST,
30                                   # hence 10% range.
31       if_wordsize(32,
32           compiler_stats_range_field('bytes allocated', 303930948, 5)),
33                         # expected value: 215582916 (x86/Windows)
34                         #                 221667908 (x86/OS X)
35                         #                 274932264 (x86/Linux)
36                         # 2012-10-08:     303930948 (x86/Linux, new codegen)
37                         # 2012-10-29:     298921816 (x86/Windows; increased range to 5%
38       if_wordsize(64,
39           compiler_stats_range_field('bytes allocated', 658786936, 5)),
40                         # 17/11/2009:     434,845,560 (amd64/Linux)
41                         # 08/12/2009:     459,776,680 (amd64/Linux)
42                         # 17/05/2010:     519,377,728 (amd64/Linux)
43                         # 05/08/2011:     561,382,568 (amd64/OS X)
44                         # 16/07/2012:     589,168,872 (amd64/Linux)
45                         # 20/07/2012:     595,936,240 (amd64/Linux)
46                         # 23/08/2012:     606,230,880 (amd64/Linux)
47                         # 29/08/2012:     633,334,184 (amd64/Linux)
48                         #                 (^ new codegen)
49                         # 18/09/2012:     641,959,976 (amd64/Linux)
50                         # 19/10/2012:     661,832,592 (amd64/Linux)
51                         #                 (^ -fPIC turned on)
52                         # 23/10/2012:     642,594,312 (amd64/Linux)
53                         #                 (^ -fPIC turned off again)
54                         # 12/11/2012:     658,786,936 (amd64/Linux)
55                         #                 ( UNKNOWN REASON )
56                         # 17/1/13:        667,160,192 (x86_64/Linux)
57                         #                 (new demand analyser)
58       only_ways(['normal']),
59
60       extra_hc_opts('-dcore-lint -static')
61           # Leave -dcore-lint on for this one test, so that we have something
62           # that will catch a regression in -dcore-lint performance.
63       ],
64      compile,
65      [''])
66
67 # This one tests for the space leak in the native code generator,
68 # where it holds onto the entire asm output until the end.  The space
69 # leak reappears from time to time, so it's a good idea to have a test
70 # for it.  The residency of this test will jump by 10MB to 40MB or so
71 # on x86-64 if the space leak appears.
72
73 # Only run this one if we have an NCG:
74 if 'optasm' in config.compile_ways:
75    conf_3294 = only_ways(['normal'])
76 else:
77    conf_3294 = skip
78
79 test('T3294',
80      [if_wordsize(32,
81           compiler_stats_range_field('max_bytes_used', 17725476, 5)),
82                                    # expected value: 17725476 (x86/OS X)
83                                    #                 14593500 (Windows)
84       if_wordsize(64,
85           compiler_stats_range_field('max_bytes_used', 44894544, 15)),
86                                    # prev:           25753192 (amd64/Linux)
87                                    # 29/08/2012:     37724352 (amd64/Linux)
88                                    #  (increase due to new codegen, see #7198)
89                                    # 13/13/2012:     44894544 (amd64/Linux)
90                                    #  (reason for increase unknown)
91       if_wordsize(32,
92           compiler_stats_range_field('bytes allocated', 1373514844, 5)),
93                                    # previous:     815479800  (x86/Linux)
94                                    # (^ increase due to new codegen, see #7198)
95                                    # 2012-10-08:   1373514844 (x86/Linux)
96       if_wordsize(64,
97           compiler_stats_range_field('bytes allocated', 2717327208, 5)),
98                                    # old:        1,357,587,088 (amd64/Linux)
99                                    # 29/08/2012: 2,961,778,696 (amd64/Linux)
100                                    # (^ increase due to new codegen, see #7198)
101                                    # 18/09/2012: 2,717,327,208 (amd64/Linux)
102       conf_3294
103       ],
104      compile,
105      [''])
106
107 test('T4801',
108      [ # expect_broken(5224),
109        # temporarily unbroken (#5227)
110       if_wordsize(32,
111           compiler_stats_range_field('peak_megabytes_allocated', 30, 20)),
112
113       if_wordsize(64,
114           compiler_stats_range_field('peak_megabytes_allocated', 49, 20)),
115                    # prev:       50 (amd64/Linux)
116                    # 19/10/2012: 64 (amd64/Linux) (REASON UNKNOWN!)
117                    # 12/11/2012: 49 (amd64/Linux) (REASON UNKNOWN!)
118
119       # expected value: 58 (amd64/OS X):
120       if_platform('x86_64-apple-darwin',
121           compiler_stats_range_field('peak_megabytes_allocated', 58, 1)),
122       # expected value: 228286660 (x86/OS X)
123       if_wordsize(32,
124           compiler_stats_range_field('bytes allocated', 185669232, 10)),
125
126       if_wordsize(64,
127           compiler_stats_range_field('bytes allocated', 392409984, 10)),
128                    # prev:       360243576 (amd64/Linux)
129                    # 19/10/2012: 447190832 (amd64/Linux) (-fPIC turned on)
130                    # 19/10/2012: 392409984 (amd64/Linux) (-fPIC turned off)
131
132       # expected value: 510938976 (amd64/OS X):
133       if_platform('x86_64-apple-darwin',
134           compiler_stats_range_field('bytes allocated', 510938976, 5)),
135
136       if_wordsize(32,
137           compiler_stats_range_field('max_bytes_used', 9651948, 5)),
138       #                    expected value: x86/OS X:  9651948
139       #                    expected value:           10290952 (windows)
140       if_wordsize(64,
141           compiler_stats_range_field('max_bytes_used', 21657520, 15)),
142                 # prev:       20486256 (amd64/OS X)
143                 # 30/08/2012: 17305600--20391920 (varies a lot)
144                 # 19/10/2012: 26882576 (-fPIC turned on)
145                 # 19/10/2012: 18619912 (-fPIC turned off)
146                 # 24/12/2012: 21657520 (perhaps gc sampling time wibbles?)
147       if_platform('x86_64-apple-darwin',
148           compiler_stats_range_field('max_bytes_used', 21657520, 5)),
149        only_ways(['normal']),
150        extra_hc_opts('-static')
151       ],
152      compile,
153      [''])
154
155 test('T3064',
156      [# expect_broken( 3064 ),
157       # expected value: 14 (x86/Linux 28-06-2012):
158       if_wordsize(32,
159           compiler_stats_range_field('peak_megabytes_allocated', 14, 1)),
160
161       if_wordsize(64,
162           compiler_stats_range_field('peak_megabytes_allocated', 26, 1)),
163                                      # (amd64/Linux):            18
164                                      # (amd64/Linux) 2012-02-07: 26
165
166       # expected value: 56380288 (x86/Linux) (28/6/2011)
167       #                 111189536 (x86/Windows) (30/10/12)
168       if_wordsize(32,
169           compiler_stats_range_field('bytes allocated', 111189536, 10)),
170
171
172       if_wordsize(64,
173           compiler_stats_range_field('bytes allocated', 224798696, 5)),
174                           # (amd64/Linux) (28/06/2011):  73259544
175                           # (amd64/Linux) (07/02/2013): 224798696
176
177       # expected value: 2247016 (x86/Linux) (28/6/2011):
178       if_wordsize(32,
179           compiler_stats_range_field('max_bytes_used', 5511604, 20)),
180
181       if_wordsize(64,
182           compiler_stats_range_field('max_bytes_used',  9819288, 5)),
183                  # (amd64/Linux, intree) (28/06/2011):  4032024
184                  # (amd64/Linux, intree) (07/02/2013):  9819288
185        only_ways(['normal'])
186       ],
187      compile,
188      [''])
189
190 test('T4007',
191      normal,
192      run_command,
193      ['$MAKE -s --no-print-directory T4007'])
194
195 test('T5030',
196      [
197       if_wordsize(32,
198           compiler_stats_range_field('bytes allocated', 259547660, 10)),
199                      # previous:    196457520
200                      # 2012-10-08:  259547660 (x86/Linux, new codegen)
201
202       if_wordsize(64,
203           compiler_stats_range_field('bytes allocated', 602993184, 10)),
204             # Previously 530000000 (+/- 10%)
205             # 17/1/13:       602,993,184  (x86_64/Linux)
206             #                (new demand analyser)
207    
208        only_ways(['normal'])
209       ],
210      compile,
211      ['-fcontext-stack=300'])
212
213 test('T5631',
214      [if_wordsize(32, # sample from x86/Linux
215           compiler_stats_range_field('bytes allocated', 392904228, 10)),
216       # expected value: 774,595,008 (amd64/Linux):
217       if_wordsize(64,
218           compiler_stats_range_field('bytes allocated', 774595008, 5)),
219        only_ways(['normal'])
220       ],
221      compile,
222      [''])
223
224 test('parsing001',
225      [# expected value: ?
226       if_wordsize(32,
227           compiler_stats_range_field('bytes allocated', 274000576, 10)),
228       # expected value: 587079016 (amd64/Linux):
229       if_wordsize(64,
230           compiler_stats_range_field('bytes allocated', 587079016, 5)),
231        only_ways(['normal']),
232       ],
233      compile_fail, [''])
234
235
236 test('T783',
237      [ only_ways(['normal']),  # no optimisation for this one
238       # expected value: 175,569,928 (x86/Linux)
239       if_wordsize(32,
240           compiler_stats_range_field('bytes allocated', 226907420, 10)),
241                            # 2012-10-08: 226907420 (x86/Linux)
242       if_wordsize(64,
243           compiler_stats_range_field('bytes allocated', 640324528, 10)),
244                            # prev:       349,263,216 (amd64/Linux)
245                            # 07/08/2012: 384,479,856 (amd64/Linux)
246                            # 29/08/2012: 436,927,840 (amd64/Linux)
247                            # 12/11/2012: 640,324,528 (amd64/Linux)
248                            #   (OldCmm removed: not sure why this got worse, the
249                            #    other perf tests remained about the same)
250       extra_hc_opts('-static')
251       ],
252       compile,[''])
253
254 test('T5321Fun',
255      [ only_ways(['normal']),  # no optimisation for this one
256       # sample from x86/Linux
257       if_wordsize(32,
258           compiler_stats_range_field('bytes allocated', 344416344, 10)),
259                                          # prev:       300000000
260                                          # 2012-10-08: 344416344
261                                          #  (increase due to new codegen)
262       if_wordsize(64,
263           compiler_stats_range_field('bytes allocated', 713385808, 10))
264                                          # prev:       585,521,080
265                                          # 29/08/2012: 713,385,808
266                                          #  (increase due to new codegen)
267       ],
268       compile,[''])
269
270 test('T5321FD',
271      [ only_ways(['normal']),  # no optimisation for this one
272       if_wordsize(32,
273           compiler_stats_range_field('bytes allocated', 240302920, 10)),
274                                          # prev:       213380256
275                                          # 2012-10-08: 240302920 (x86/Linux)
276                                          #  (increase due to new codegen)
277       if_wordsize(64,
278           compiler_stats_range_field('bytes allocated', 492905640, 10))
279                                          # prev:       418,306,336
280                                          # 29/08/2012: 492,905,640
281                                          #  (increase due to new codegen)
282       ],
283       compile,[''])
284
285 test('T5642',
286      [ only_ways(['normal']),
287       if_wordsize(32, # sample from x86/Linux
288           compiler_stats_range_field('bytes allocated',  650000000, 10)),
289       if_wordsize(64,
290           compiler_stats_range_field('bytes allocated', 1300000000, 10))
291       ],
292       compile,['-O'])
293
294 test('T5837',
295      [ only_ways(['normal']),
296       if_wordsize(32, # sample from x86/Linux
297           compiler_stats_range_field('bytes allocated', 40000000, 10)),
298
299       # sample: 3926235424 (amd64/Linux, 15/2/2012)
300       if_wordsize(64,
301           compiler_stats_range_field('bytes allocated', 81879216, 10))
302                                            # 2012-10-02 81879216
303                                            # 2012-09-20 87254264 amd64/Linux
304       ],
305       compile_fail,['-fcontext-stack=50'])
306
307 test('T6048',
308      [ only_ways(['optasm']),
309       if_wordsize(32, # sample from x86/Linux
310           compiler_stats_range_field('bytes allocated', 48887164, 10)),
311                                            # prev:       38000000
312                                            # 2012-10-08: 48887164 (x86/Linux)
313       if_wordsize(64,
314           compiler_stats_range_field('bytes allocated', 97247032, 10))
315                                            # 18/09/2012 97247032 amd64/Linux
316       ],
317       compile,[''])