Generate Typeable info at definition sites
[ghc.git] / testsuite / tests / perf / should_run / all.T
1 # Tests that newArray/newArray_ is being optimised correctly
2
3 test('T10359',
4      [stats_num_field('bytes allocated',
5           [(wordsize(64), 499512, 5),
6            (wordsize(32), 374056, 5)]),
7       only_ways(['normal'])
8       ],
9      compile_and_run,
10      ['-O'])
11
12 # fortunately the values here are mostly independent of the wordsize,
13 # because the test allocates an unboxed array of doubles.
14 test('T3586',
15      [stats_num_field('peak_megabytes_allocated', (17, 1)),
16                                  # expected value: 17 (amd64/Linux)
17       stats_num_field('bytes allocated', (16102024, 5)),
18                         # prev:           16835544 (amd64/Linux)
19                         # 2014-07-17:     16102024 (amd64/Linux), general round of updates
20       only_ways(['normal']),
21
22       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
23       # Only 64-bit as we don't have a good 32-bit test environment at the moment
24       when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS'))
25       ],
26      compile_and_run,
27      ['-O'])
28
29 test('T4830',
30      [stats_num_field('bytes allocated',
31           [(wordsize(64), 98248, 4),
32            #             127000 (amd64/Linux)
33            # 2013-02-07:  99264 (amd64/Linux)
34            # 2014-01-13:  98248 (amd64/Linux) due to #8647
35            # 2015-04-03: Widen 1->4% (amd64/Windows was doing better)
36            (wordsize(32), 70646, 3)]),
37            # 2013-02-10:  69744 (x86/Windows)
38            # 2013-02-10:  71548 (x86/OSX)
39            # 2014-01-28:  Widen range 2->3
40            #                (x86/Windows - actual 69000, lower was 69233)
41       only_ways(['normal'])
42       ],
43      compile_and_run,
44      ['-O2'])
45
46 test('T3245', [when(doing_ghci(), extra_hc_opts('-fobject-code'))],
47      compile_and_run, ['-O'])
48
49 # Test that bytestring reading/writing isn't over-allocating.  We had
50 # a bug in hGetBufNonBlocking in 6.13 that triggered this.
51 #
52 test('lazy-bs-alloc',
53      [stats_num_field('peak_megabytes_allocated', (2, 1)),
54                                  # expected value: 2 (amd64/Linux)
55       stats_num_field('bytes allocated',
56           [(wordsize(64), 431500, 3),
57             #             489776 (amd64/Linux)
58             # 2013-02-07: 429744 (amd64/Linux)
59             # 2013-12-12: 425400 (amd64/Linux)
60             # 2015-04-04: Widen 1->3% (amd64/Windows was failing)
61             # 2015-08-15: 431500 (Windows not good enough. avg of Windows&Linux)
62            (wordsize(32), 411500, 2)]),
63             # 2013-02-10: 421296 (x86/Windows)
64             # 2013-02-10: 414180 (x86/OSX)
65             # 2014-01-22: 411500 (x86/Linux)
66             # 2014-01-28: Widen 1->2% (x86/Windows was at 425212)
67       only_ways(['normal']),
68       extra_run_opts('../../numeric/should_run/arith011.stdout'),
69       ignore_output,
70
71       # Use `+RTS -G1` for more stable residency measurements. Note [residency].
72       # Only 64-bit as we don't have a good 32-bit test environment at the moment
73       when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS'))
74       ],
75      # use a suitably big file, without bloating the repo with a new one:
76      compile_and_run,
77      ['-O'])
78
79 test('T876',
80      [stats_num_field('bytes allocated',
81           [(platform('x86_64-unknown-mingw32'), 71904, 5),
82               # 2015-04-03: 71904 (amd64/Windows, unknown cause)
83            (wordsize(64), 63216 , 5),
84               # 2013-02-14: 1263712 (x86_64/Linux)
85               # 2014-02-10:   63216 (x86_64/Linux), call arity analysis
86
87            (wordsize(32), 53156, 5) ]),
88               # some date:  663712  (Windows, 64-bit machine)
89               # 2014-04-04:  56820  (Windows, 64-bit machine)
90               # 2014-06-29:  53024  (x86_64/Linux)
91               # 2014-12-01:  56796  (Windows)
92               # 2015-07-11:  53156  (x86_64/Linux)
93
94       only_ways(['normal']),
95       extra_run_opts('10000')
96       ],
97      compile_and_run,
98      ['-O'])
99
100 # Get reproducible floating-point results on x86
101 if config.arch == 'i386':
102    sse2_opts = '-msse2'
103 else:
104    sse2_opts = ''
105
106 test('T4321',
107      omit_ways(['ghci']),
108      compile_and_run, ['-O ' + sse2_opts])
109
110 test('T3736',
111      extra_clean(['T3736.speed.f32']),
112      run_command,
113      ['$MAKE -s --no-print-directory T3736'])
114 test('T3738',
115      [extra_clean(['T3738a.hi', 'T3738a.o']),
116       stats_num_field('peak_megabytes_allocated', (1, 0)),
117                                  # expected value: 1 (amd64/Linux)
118       stats_num_field('bytes allocated',
119                       [(wordsize(32), 45648, 5),
120                     # expected value: 50520 (x86/Linux)
121                        (wordsize(64), 50592, 8)]),
122                     # prev:           49400 (amd64/Linux)
123                     # 2014-07-17:     50520 (amd64/Linux) general round of updates
124                     # 2014-09-10:     50592 (amd64/Linux) post-AMP-update
125                     # 2015-04-03: Widen 5->8% (amd64/Windows was doing better)
126       only_ways(['normal'])
127       ],
128      compile_and_run,
129      ['-O'])
130
131 test('MethSharing',
132      [stats_num_field('peak_megabytes_allocated', (1, 0)),
133                                  # expected value: 1 (amd64/Linux)
134       stats_num_field('bytes allocated',
135                       [(wordsize(32), 360940756, 5),
136                     # expected value: 2685858140 (x86/OS X)
137                           # expected: 360940756 (x86/Linux)
138                        (wordsize(64), 640067672, 5)]),
139                           # expected: 640067672 (amd64/Linux)
140       only_ways(['normal'])
141       ],
142      compile_and_run,
143      ['-O'])
144 test('T2902',
145      extra_clean(['T2902_A',    'T2902_B',
146                   'T2902_A.hi', 'T2902_B.hi',
147                   'T2902_A.o',  'T2902_B.o',
148                   'T2902_A_PairingSum.hi', 'T2902_B_PairingSum.hi',
149                   'T2902_A_PairingSum.o',  'T2902_B_PairingSum.o',
150                   'T2902_Sum.hi',
151                   'T2902_Sum.o']),
152      run_command,
153      ['$MAKE -s --no-print-directory T2902'])
154 test('T149',
155      [ # expect_broken(149),
156        # working (2 Jul 2013, x86-64/Linux)
157       extra_clean(['T149_A',    'T149_B',
158                    'T149_A.hi', 'T149_B.hi',
159                    'T149_A.o',  'T149_B.o'])],
160      run_command,
161      ['$MAKE -s --no-print-directory T149'])
162
163 test('T5113',
164      [stats_num_field('bytes allocated',
165                       [(wordsize(32), 4000000, 5),
166                        (wordsize(64), 8000000, 5)]),
167       only_ways(['normal'])
168       ],
169      compile_and_run,
170      ['-O'])
171
172
173 test('T4978',
174      [stats_num_field('bytes allocated',
175                       [(wordsize(32), 10000000, 5),
176                        (wordsize(64), 10137680, 5)]),
177                     # expected value: 10137680 (amd64/Linux)
178       only_ways(['normal'])
179       ],
180      compile_and_run,
181      ['-O2'])
182
183 test('T5205',
184      [stats_num_field('bytes allocated',
185                       [(wordsize(32), 47088, 5),
186                     # expected value: 47088 (x86/Darwin)
187                        (wordsize(64), 56208, 7)]),
188                     # expected value: 51320 (amd64/Linux)
189                     # 2014-07-17:     52600 (amd64/Linux) general round of updates
190                     # 2015-04-03: Widen 5->7% (amd64/Windows was doing better)
191                     # 2015-08-15: 50648 (Windows too good. avg of Windows&Linux)
192                     # 2015-10-30: 56208 (D757: Emit Typeable at definition site)
193       only_ways(['normal', 'optasm'])
194       ],
195      compile_and_run,
196      [''])
197
198 test('T5549',
199      [stats_num_field('bytes allocated',
200                       [(wordsize(32), 4096606332, 5),
201                     # expected value: 3362958676 (Windows)
202                     # 2014-12-01:     4096606332 (Windows) integer-gmp2
203
204                        (wordsize(64), 8193140752, 5)]),
205                     # expected value: 6725846120 (amd64/Linux)
206                     #                 8193140752 (amd64/Linux) integer-gmp2
207       only_ways(['normal'])
208       ],
209      compile_and_run,
210      ['-O'])
211
212 test('T4474a',
213      [stats_num_field('bytes allocated',
214                       [(wordsize(32), 2405242767, 5),
215                        (wordsize(64), 4831890304, 5)]),
216                     # expected value: 4831890304 (amd64/OSX)
217       only_ways(['normal'])
218       ],
219      compile_and_run,
220      ['-O'])
221 test('T4474b',
222      [stats_num_field('bytes allocated',
223                       [(wordsize(32), 2405242767, 5),
224                        (wordsize(64), 4831890304, 5)]),
225                     # expected value: 4831890304 (amd64/OSX)
226       only_ways(['normal'])
227       ],
228      compile_and_run,
229      ['-O'])
230 test('T4474c',
231      [stats_num_field('bytes allocated',
232                       [(wordsize(32), 2405242767, 5),
233                        (wordsize(64), 4831890304, 5)]),
234                     # expected value: 4831890304 (amd64/OSX)
235       only_ways(['normal'])
236       ],
237      compile_and_run,
238      ['-O'])
239
240 test('T5237',
241      [stats_num_field('bytes allocated',
242                         [(platform('i386-unknown-mingw32'), 73280, 5),
243                          (wordsize(32), 78328, 5),
244                       # expected value: 78328 (i386/Linux)
245                          (wordsize(64), 104176, 5)]),
246                       # expected value: 110888 (amd64/Linux)
247                       # expected value: 104176 (amd64/Linux)
248      only_ways(['normal'])
249      ],
250     compile_and_run,
251     ['-O ' + sse2_opts])
252
253 test('T5536',
254      [stats_num_field('bytes allocated',
255                       [(wordsize(32), 446260520, 1),
256                                    # 1246287228 (i386/Linux)
257                                     # 446328556 (i386/Windows)
258                                     # 446192484 (i386/OSX)
259                        (wordsize(64), 892399040, 5)]),
260                    # expected value: 2492589480 (amd64/Linux)
261                    # 17/1/13:         892399040 (x86_64/Linux)
262                    #                  (new demand analyser)
263      extra_clean(['T5536.data']),
264      ignore_output,
265      only_ways(['normal'])
266      ],
267     compile_and_run,
268     ['-O'])
269
270 test('T7257',
271      [stats_num_field('bytes allocated',
272                       [(wordsize(32), 1150000000, 10),
273                     # expected value: 1246287228 (i386/Linux)
274                        (wordsize(64), 1774893760, 5)]),
275                         # 2012-09-21: 1774893760 (amd64/Linux)
276       stats_num_field('peak_megabytes_allocated',
277                       [(wordsize(32), 217, 5),
278                         # 2012-10-08: 217 (x86/Linux)
279                        (wordsize(64), 227, 5)]),
280                         # 2012-09-21: 227 (amd64/Linux)
281
282       only_ways(['normal'])
283      ],
284     compile_and_run, ['-O'])
285
286 test('Conversions',
287      [stats_num_field('bytes allocated',
288                       [(wordsize(32), 76768, 3),
289                         # 2012-12-18: 55316 Guessed 64-bit value / 2
290                         # 2013-02-10: 77472 (x86/OSX)
291                         # 2013-02-10: 79276 (x86/Windows)
292                         # 2014-01-13: 76768 (x86/Linux) due to #8647
293                        (wordsize(64), 107544, 5)]),
294                         # 2012-12-18: 109608 (amd64/OS X)
295                         # 2014-07-17: 107544 (amd64/Linux)
296
297       only_ways(['normal'])
298      ],
299     compile_and_run, ['-O -msse2'])
300
301 test('T7507', omit_ways(['ghci']), compile_and_run, ['-O'])
302 # For 7507, stack overflow is the bad case
303
304 test('T7436',
305      [stats_num_field('max_bytes_used',
306           [(wordsize(64), 60360, 4),
307            #             127000 (amd64/Linux)
308            # 2013-02-07:  60360 (amd64/Linux)
309            # 2015-04-03: Widen 1->4% (amd64/Windows was doing better)
310            (wordsize(32), 58434, 1)]),
311             # 2013-02-10: 58032 (x86/Windows)
312             # 2013-02-10: 58836 (x86/OSX)
313       only_ways(['normal'])
314       ],
315      compile_and_run,
316      ['-O'])
317
318 test('T7797',
319       [stats_num_field('bytes allocated',
320                       [(wordsize(32), 240044984, 5),
321                           # expected value: 2685858140 (x86/OS X)
322                           # expected: 360940756 (x86/Linux)
323                           # expected: 240044984 (x86/Windows, 64bit machine)
324                        (wordsize(64), 480050944, 5)]),
325                           # expected: 480050944 (amd64/Linux)
326       extra_clean(['T7797a.hi', 'T7797a.o']),
327       only_ways(['normal'])
328       ],
329      compile_and_run,
330      ['-O'])
331
332 test('T7954',
333       [stats_num_field('bytes allocated',
334                       [(wordsize(32), 920045264, 10),
335               # some date:  1380051408    (64-bit Windows machine)
336               # 2014-04-04:  920045264    (64-bit Windows machine)
337                        (wordsize(64), 1680051336, 10)]),
338               # 2014-02-10: 1680051336 (x86_64/Linux), call arity analysis
339       only_ways(['normal'])
340       ],
341      compile_and_run,
342      ['-O'])
343
344 test('T7850',
345      [stats_num_field('peak_megabytes_allocated', 
346                       [(wordsize(32), 2, 10),
347                        (wordsize(64), 4, 10)]),
348       only_ways(['normal'])],
349      compile_and_run,
350      ['-O'])
351
352 test('T5949',
353      [stats_num_field('bytes allocated',
354                       [ (wordsize(32), 116020, 10),
355                         (wordsize(64), 201008, 10)]),
356                       # previously, it was >400000 bytes
357       only_ways(['normal'])],
358      compile_and_run,
359      ['-O'])
360
361 test('T4267',
362      [stats_num_field('bytes allocated',
363                       [ (wordsize(32), 36012, 10)
364                       # 32-bit value close to 64 bit; c.f. T7619
365                       , (wordsize(64), 40992, 10) ]),
366                       # previously, it was >170000 bytes
367                       # 2014-01-17: 130000
368                       # 2014-02-10: 40992 (x86_64/Linux), call arity analysis
369       only_ways(['normal'])],
370      compile_and_run,
371      ['-O'])
372
373 test('T7619',
374      [stats_num_field('bytes allocated',
375                       [ (wordsize(32), 36012, 10)
376                       # 32-bit close to 64-bit value; most of this very 
377                       # small number is standard start-up boilerplate I think
378                       , (wordsize(64), 40992, 10) ]),
379                       # previously, it was >400000 bytes
380       only_ways(['normal'])],
381      compile_and_run,
382      ['-O'])
383
384 test('InlineArrayAlloc',
385      [stats_num_field('bytes allocated',
386                       [ (wordsize(32), 800040960, 5)
387                       , (wordsize(64), 1600040960, 5) ]),
388       only_ways(['normal'])],
389      compile_and_run,
390      ['-O2'])
391
392 test('InlineByteArrayAlloc',
393      [stats_num_field('bytes allocated',
394                       [ (wordsize(32), 1360036012, 5)
395                       , (wordsize(64), 1440040960, 5) ]),
396          # 32 and 64 bit not so different, because 
397          # we are allocating *byte* arrays
398       only_ways(['normal'])],
399      compile_and_run,
400      ['-O2'])
401
402 test('InlineCloneArrayAlloc',
403      [stats_num_field('bytes allocated',
404                       [ (wordsize(32), 800041120, 5) 
405                       , (wordsize(64), 1600041120, 5) ]),
406       only_ways(['normal'])],
407      compile_and_run,
408      ['-O2'])
409
410 test('T9203',
411      [stats_num_field('bytes allocated',
412                       [ (wordsize(32), 50000000, 5)
413                       , (wordsize(64), 95451192, 5) ]),
414                       # was            95747304
415                       # 2019-09-10     94547280 post-AMP cleanup
416                       # 2015-10-28     95451192 emit Typeable at definition site
417       only_ways(['normal'])],
418      compile_and_run,
419      ['-O2'])
420
421 test('T9339',
422      [stats_num_field('bytes allocated',
423                       [ (wordsize(32),    40046844, 5)
424                       , (wordsize(64),    80050760, 5) ]),
425                       # w/o fusing last: 320005080
426                       # 2014-07-22:       80050760
427       only_ways(['normal'])],
428      compile_and_run,
429      ['-O2'])