Ticket #3800: ghc_StgArrWords.dpatch

File ghc_StgArrWords.dpatch, 65.9 KB (added by AntoineLatter, 5 years ago)

patch for rts

Line 
1Fri Jan  1 12:33:46 CST 2010  Antoine Latter <aslatter@gmail.com>
2  * FIX #38000 Store StgArrWords payload size in bytes
3
4New patches:
5
6[FIX #38000 Store StgArrWords payload size in bytes
7Antoine Latter <aslatter@gmail.com>**20100101183346
8 Ignore-this: 7bf3ab4fc080c46311fc10b179361bb6
9] {
10hunk ./compiler/codeGen/CgPrimOp.hs 146
11                 CmmMayReturn
12 
13 --  #define sizzeofByteArrayzh(r,a) \
14---     r = (((StgArrWords *)(a))->words * sizeof(W_))
15+--     r = ((StgArrWords *)(a))->bytes
16 emitPrimOp [res] SizeofByteArrayOp [arg] _
17    = stmtC $
18hunk ./compiler/codeGen/CgPrimOp.hs 149
19-       CmmAssign (CmmLocal res) (CmmMachOp mo_wordMul [
20-                         cmmLoadIndexW arg fixedHdrSize bWord,
21-                         CmmLit (mkIntCLit wORD_SIZE)
22-                       ])
23+       CmmAssign (CmmLocal res) (cmmLoadIndexW arg fixedHdrSize bWord)
24 
25 --  #define sizzeofMutableByteArrayzh(r,a) \
26hunk ./compiler/codeGen/CgPrimOp.hs 152
27---      r = (((StgArrWords *)(a))->words * sizeof(W_))
28+--      r = ((StgArrWords *)(a))->bytes
29 emitPrimOp [res] SizeofMutableByteArrayOp [arg] live
30    = emitPrimOp [res] SizeofByteArrayOp [arg] live
31 
32hunk ./compiler/codeGen/StgCmmPrim.hs 220
33                [(CmmReg (CmmGlobal BaseReg), AddrHint), (mutv,AddrHint)]
34 
35 --  #define sizzeofByteArrayzh(r,a) \
36---     r = (((StgArrWords *)(a))->words * sizeof(W_))
37+--     r = ((StgArrWords *)(a))->bytes
38 emitPrimOp [res] SizeofByteArrayOp [arg]
39    = emit $
40hunk ./compiler/codeGen/StgCmmPrim.hs 223
41-       mkAssign (CmmLocal res) (CmmMachOp mo_wordMul [
42-                         cmmLoadIndexW arg fixedHdrSize bWord,
43-                         CmmLit (mkIntCLit wORD_SIZE)
44-                       ])
45+       mkAssign (CmmLocal res) (cmmLoadIndexW arg fixedHdrSize bWord)
46 
47 --  #define sizzeofMutableByteArrayzh(r,a) \
48hunk ./compiler/codeGen/StgCmmPrim.hs 226
49---      r = (((StgArrWords *)(a))->words * sizeof(W_))
50+--      r = ((StgArrWords *)(a))->bytes
51 emitPrimOp [res] SizeofMutableByteArrayOp [arg]
52    = emitPrimOp [res] SizeofByteArrayOp [arg]
53 
54hunk ./includes/Cmm.h 418
55 /* The offset of the payload of an array */
56 #define BYTE_ARR_CTS(arr)  ((arr) + SIZEOF_StgArrWords)
57 
58+/* The number of words allocated in an array payload */
59+#define BYTE_ARR_WDS(arr) ROUNDUP_BYTES_TO_WDS(StgArrWords_bytes(arr))
60+
61 /* Getting/setting the info pointer of a closure */
62 #define SET_INFO(p,info) StgHeader_info(p) = info
63 #define GET_INFO(p) StgHeader_info(p)
64hunk ./includes/mkDerivedConstants.c 285
65     closure_field(StgMutArrPtrs, size);
66 
67     closure_size(StgArrWords);
68-    closure_field(StgArrWords, words);
69+    closure_field(StgArrWords, bytes);
70     closure_payload(StgArrWords, payload);
71 
72     closure_field(StgTSO, _link);
73hunk ./includes/rts/storage/ClosureMacros.h 130
74 
75 #define SET_ARR_HDR(c,info,costCentreStack,n_words)    \
76    SET_HDR(c,info,costCentreStack);                    \
77-   (c)->words = n_words;
78+   (c)->bytes = n_words*sizeof(W_);
79 
80 /* -----------------------------------------------------------------------------
81    How to get hold of the static link field for a static closure.
82hunk ./includes/rts/storage/ClosureMacros.h 277
83 INLINE_HEADER StgOffset pap_sizeW( StgPAP* x )
84 { return PAP_sizeW(x->n_args); }
85 
86+INLINE_HEADER StgWord arr_words_words( StgArrWords* x)
87+{ return ROUNDUP_BYTES_TO_WDS(x->bytes); }
88+
89 INLINE_HEADER StgOffset arr_words_sizeW( StgArrWords* x )
90hunk ./includes/rts/storage/ClosureMacros.h 281
91-{ return sizeofW(StgArrWords) + x->words; }
92+{ return sizeofW(StgArrWords) + arr_words_words(x); }
93 
94 INLINE_HEADER StgOffset mut_arr_ptrs_sizeW( StgMutArrPtrs* x )
95 { return sizeofW(StgMutArrPtrs) + x->size; }
96hunk ./includes/rts/storage/Closures.h 132
97 
98 typedef struct {
99     StgHeader  header;
100-    StgWord    words;
101+    StgWord    bytes;
102     StgWord    payload[FLEXIBLE_ARRAY];
103 } StgArrWords;
104 
105hunk ./rts/PrimOps.cmm 64
106     ("ptr" p) = foreign "C" allocate(MyCapability() "ptr",words) [];
107     TICK_ALLOC_PRIM(SIZEOF_StgArrWords,WDS(payload_words),0);
108     SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
109-    StgArrWords_words(p) = payload_words;
110+    StgArrWords_bytes(p) = n;
111     RET_P(p);
112 }
113 
114hunk ./rts/PrimOps.cmm 73
115 
116 stg_newPinnedByteArrayzh
117 {
118-    W_ words, bytes, payload_words, p;
119+    W_ words, n, bytes, payload_words, p;
120 
121     MAYBE_GC(NO_PTRS,stg_newPinnedByteArrayzh);
122hunk ./rts/PrimOps.cmm 76
123-    bytes = R1;
124+    n = R1;
125+    bytes = n;
126     /* payload_words is what we will tell the profiler we had to allocate */
127     payload_words = ROUNDUP_BYTES_TO_WDS(bytes);
128     /* When we actually allocate memory, we need to allow space for the
129hunk ./rts/PrimOps.cmm 97
130     p = p + ((-p - SIZEOF_StgArrWords) & BA_MASK);
131 
132     SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
133-    StgArrWords_words(p) = payload_words;
134+    StgArrWords_bytes(p) = n;
135     RET_P(p);
136 }
137 
138hunk ./rts/PrimOps.cmm 103
139 stg_newAlignedPinnedByteArrayzh
140 {
141-    W_ words, bytes, payload_words, p, alignment;
142+    W_ words, n, bytes, payload_words, p, alignment;
143 
144     MAYBE_GC(NO_PTRS,stg_newAlignedPinnedByteArrayzh);
145hunk ./rts/PrimOps.cmm 106
146-    bytes = R1;
147+    n = R1;
148     alignment = R2;
149 
150hunk ./rts/PrimOps.cmm 109
151+    bytes = n;
152+
153     /* payload_words is what we will tell the profiler we had to allocate */
154     payload_words = ROUNDUP_BYTES_TO_WDS(bytes);
155 
156hunk ./rts/PrimOps.cmm 132
157     p = p + ((-p - SIZEOF_StgArrWords) & (alignment - 1));
158 
159     SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
160-    StgArrWords_words(p) = payload_words;
161+    StgArrWords_bytes(p) = n;
162     RET_P(p);
163 }
164 
165hunk ./rts/PrimOps.cmm 381
166   TICK_ALLOC_PRIM(SIZEOF_StgArrWords,WDS(payload_words),0);
167   SET_HDR(p, stg_ARR_WORDS_info, W_[CCCS]);
168 
169-  StgArrWords_words(p)     = payload_words;
170+  StgArrWords_bytes(p)     = WDS(payload_words);
171   StgArrWords_payload(p,0) = fptr;
172   StgArrWords_payload(p,1) = ptr;
173   StgArrWords_payload(p,2) = eptr;
174hunk ./rts/PrimOps.cmm 1517
175     
176     bitmap_arr = R5;
177 
178-    words = BYTES_TO_WDS(SIZEOF_StgBCO) + StgArrWords_words(bitmap_arr);
179+    words = BYTES_TO_WDS(SIZEOF_StgBCO) + BYTE_ARR_WDS(bitmap_arr);
180     bytes = WDS(words);
181 
182     ALLOC_PRIM( bytes, R1_PTR&R2_PTR&R3_PTR&R5_PTR, stg_newBCOzh );
183hunk ./rts/PrimOps.cmm 1535
184     W_ i;
185     i = 0;
186 for:
187-    if (i < StgArrWords_words(bitmap_arr)) {
188+    if (i < BYTE_ARR_WDS(bitmap_arr)) {
189        StgBCO_bitmap(bco,i) = StgArrWords_payload(bitmap_arr,i);
190        i = i + 1;
191        goto for;
192hunk ./rts/PrimOps.cmm 1629
193        is promoted. */
194     
195     SET_HDR(nptrs_arr, stg_ARR_WORDS_info, W_[CCCS]);
196-    StgArrWords_words(nptrs_arr) = nptrs;
197+    StgArrWords_bytes(nptrs_arr) = WDS(nptrs);
198     p = 0;
199 for2:
200     if(p < nptrs) {
201hunk ./rts/Printer.c 309
202             for (i = 0; arrWordsGetChar(obj,i); ++i) {
203                 putchar(arrWordsGetChar(obj,i));
204                } */
205-           for (i=0; i<((StgArrWords *)obj)->words; i++)
206+           for (i=0; i<arr_words_words((StgArrWords *)obj); i++)
207              debugBelch("%lu", (lnat)((StgArrWords *)obj)->payload[i]);
208             debugBelch("\")\n");
209             break;
210hunk ./rts/parallel/Pack.c 1281
211   ASSERT(info->type == ARR_WORDS || info->type == MUT_ARR_PTRS ||
212         info->type == MUT_ARR_PTRS_FROZEN || info->type == MUT_VAR);
213 
214-  n = ((StgArrWords *)closure)->words;
215+  n = arr_words_words(((StgArrWords *)closure));
216   // this includes the header!: arr_words_sizeW(stgCast(StgArrWords*,q));
217 
218   IF_PAR_DEBUG(pack,
219hunk ./rts/parallel/Pack.c 1302
220   if (RtsFlags.ParFlags.ParStats.Global &&
221       RtsFlags.GcFlags.giveStats > NO_GC_STATS) {
222     globalParStats.tot_arrs++;
223-    globalParStats.tot_arr_size += ((StgArrWords *)closure)->words;
224+    globalParStats.tot_arr_size += arr_words_words(((StgArrWords *)closure));
225   }
226 
227   /* record offset of the closure and allocate a GA */
228hunk ./rts/parallel/Pack.c 1316
229 
230   /* Pack the header (2 words: info ptr and the number of words to follow) */
231   Pack((StgWord)*(StgPtr)closure);
232-  Pack(((StgArrWords *)closure)->words);
233+  Pack(arr_words_words(((StgArrWords *)closure)));
234 
235   /* pack the payload of the closure (all non-ptrs) */
236   for (i=0; i<n; i++)
237hunk ./rts/parallel/Pack.c 2820
238           ASSERT(info->type == ARR_WORDS || info->type == MUT_ARR_PTRS ||
239                  info->type == MUT_ARR_PTRS_FROZEN || info->type == MUT_VAR));
240 
241-  n = ((StgArrWords *)bufptr)->words;
242+  n = arr_words_words(((StgArrWords *)bufptr));
243   // this includes the header!: arr_words_sizeW(stgCast(StgArrWords*,q));
244 
245   IF_PAR_DEBUG(pack,
246hunk ./rts/parallel/Pack.c 2837
247 
248   /* Unpack the header (2 words: info ptr and the number of words to follow) */
249   ((StgArrWords *)graph)->header.info = (StgInfoTable*)*bufptr++;  // assumes _HS==1; yuck!
250-  ((StgArrWords *)graph)->words = (StgWord)*bufptr++;
251+  ((StgArrWords *)graph)->bytes = ((StgWord)*bufptr++) * sizeof(StgWord);
252 
253   /* unpack the payload of the closure (all non-ptrs) */
254   for (i=0; i<n; i++)
255hunk ./rts/parallel/Pack.c 3931
256       /* ToDo: check whether this is really needed */
257       if (ip->type == ARR_WORDS) {
258        ptrs = vhs = 0;
259-       nonptrs = ((StgArrWords *)bufptr)->words;
260+       nonptrs = arr_words_words(((StgArrWords *)bufptr));
261        size = arr_words_sizeW((StgArrWords *)bufptr);
262       }
263 
264hunk ./rts/parallel/Pack.c 4090
265       /* ToDo: check whether this is really needed */
266       if (ip->type == ARR_WORDS) {
267        ptrs = vhs = 0;
268-       nonptrs = ((StgArrWords *)bufptr)->words+1; // payload+words
269+       nonptrs = arr_words_words(((StgArrWords *)bufptr))+1; // payload+words
270        size = arr_words_sizeW((StgArrWords *)bufptr);
271        ASSERT(size==_HS+vhs+nonptrs);
272       }
273hunk ./rts/parallel/Parallel.c 1048
274     /* ToDo: check whether this can be merged with the default case */
275     *size = arr_words_sizeW((StgArrWords *)node);
276     *ptrs = 0;
277-    *nonptrs = ((StgArrWords *)node)->words;
278+    *nonptrs = arr_words_words(((StgArrWords *)node));
279     *vhs = *size - *ptrs - *nonptrs - sizeofW(StgHeader);
280     return info;
281 
282hunk ./rts/parallel/ParallelDebug.c 1272
283   case ARR_WORDS:
284     /* an array of (non-mutable) words */
285     fprintf(stderr, "ARR_WORDS (%p) of %d non-ptrs (maybe a string?)\n",
286-           p, ((StgArrWords *)q)->words);
287+           p, arr_words_words((StgArrWords *)q));
288     break;
289 
290   case MUT_ARR_PTRS:
291hunk ./rts/parallel/ParallelDebug.c 1629
292   case ARR_WORDS:
293     {
294        char str[6];
295-       sprintf(str,"%d",((StgArrWords*)p)->words);
296+       sprintf(str,"%d",arr_words_words((StgArrWords*)p));
297        strcat(finger_print,str);
298     }
299     break;
300}
301
302Context:
303
304[take newCAF() out from sm_mutex; use the capability-local mut list instead
305Simon Marlow <marlowsd@gmail.com>**20091231160223
306 Ignore-this: 81a9a0a1e279dea805a4ffd9cf124c90
307]
308[Use local mut lists in UPD_IND(), also clean up Updates.h
309Simon Marlow <marlowsd@gmail.com>**20091231113435
310 Ignore-this: a4659d4d24f8c6626fa8403314c6a2e4
311]
312[use local mut lists rather than global mut lists in sequential GC
313Simon Marlow <marlowsd@gmail.com>**20091231113118
314 Ignore-this: 782239ddca2a0ec5c928c310b1fad4e9
315]
316[Allow throwTo() to be called without a source thread
317Simon Marlow <marlowsd@gmail.com>**20091218163200
318 Ignore-this: cb7265bc6c1c75f0dd49501c1bb74f64
319 Returns false if the exception could not be thrown becuase the tartget
320 thread was running.  Not used yet, but might come in handy later.
321]
322[If ACTIVITY_INACTIVE is set, wait for GC before resetting it
323Simon Marlow <marlowsd@gmail.com>**20091213201246
324 Ignore-this: a3cd1a3aacbd68789ccc191e3b8d7778
325 I don't think this fixes any real bugs, but there's a small
326 possibility that when the RTS is woken up for an idle-time GC, the IO
327 manager thread might be pre-empted which would prevent the idle GC
328 from happening; this change ensures that the idle GC happens anyway.
329]
330[Fix rules/build-dependencies.mk on OS X
331Ian Lynagh <igloo@earth.li>**20091230185239
332 Also more comments on why we have the sed rules that we do.
333]
334[Copying Simon M's fix for 650 to the new codegen
335dias@cs.tufts.edu**20091222222017
336 Ignore-this: 4bd46e6ef23debc39c7c10aea3dfdf5c
337]
338[Better error checking and code cleanup
339dias@cs.tufts.edu**20091222221946
340 Ignore-this: 16e89f4115cb392ebbb0899c081157ed
341]
342[Add comments to darcs-all
343simonpj@microsoft.com**20091221160511
344 Ignore-this: 5a369a030785aec6ef0169e36757bba4
345 
346 The comments explain how darcs-all decides what repo to use
347]
348[Fix Trac #3772: dict funs for single-field classes
349simonpj@microsoft.com**20091221160431
350 Ignore-this: 808f1a0633c600689653ab4763dc8628
351 
352 This patch fixes a bug that meant that INLINE pragamas on
353 a method of a single-field class didn't work properly.
354 
355 See Note [Single-method classes] in TcInstDcls, and Trac #3772
356]
357[Comments only (about implementing SPECIALISE pragmas)
358simonpj@microsoft.com**20091221155745
359 Ignore-this: c8c98b061c162a4585ff1141b65ea91a
360]
361[A bit of refactoring, plus a sanity check
362simonpj@microsoft.com**20091221155632
363 Ignore-this: ba3efed78ce0b752f26891179d6b3987
364 
365 Check that a bottoming rhs does indeed get exposed with bottoming strictness
366 Almost all the changed lines reflect some refactoring of tidyTopIdInfo.
367]
368[Fix Trac #3776
369simonpj@microsoft.com**20091221155509
370 Ignore-this: 69607bdc7208775a305a5f39a575f0e2
371 
372 An easy fix.  See Note [Usage for sub-bndrs] in RnEnv.
373]
374[Move all the CoreToDo stuff into CoreMonad
375simonpj@microsoft.com**20091218164521
376 Ignore-this: 57b3f63c1faa82f7246ca46e4c9a4412
377 
378 This patch moves a lot of code around, but has zero functionality change.
379 The idea is that the types
380 
381     CoreToDo
382     SimplifierSwitch   
383     SimplifierMode
384     FloatOutSwitches
385 
386 and
387 
388     the main core-to-core pipeline construction
389 
390 belong in simplCore/, and *not* in DynFlags.
391]
392[Always expose the unfolding of something with an InlineRule
393simonpj@microsoft.com**20091218164316
394 Ignore-this: 4f952f423848b8840fab69d63ee81d8f
395 
396 Previously a bottoming function with a strictness wrapper
397 had a hidden inlining, and that was Very Bad, because in
398     f x = if ... then bot_fun x else x+1
399 we really want to pass the *unboxed* x to bot_fun. This
400 happens quite a bit in error handling code, eg for array
401 indexing.
402]
403[Comments only
404simonpj@microsoft.com**20091218164119
405 Ignore-this: b4731841b036e614385cadbdfeda70b0
406]
407[Move loop-breaker info from original function to worker in work/wrap
408simonpj@microsoft.com**20091218164107
409 Ignore-this: cc5c062f02577834baa5031e25497c57
410 
411 When doing a w/w split, if the original function is a loop breaker
412 then the worker (not the wrapper) becomes one instead.
413 
414 This isn't very important, because loop breaker information is
415 recalculated afresh by the occurrence analyser, but it seems more
416 kosher.  And Lint was bleating piteously about things with InlineRules
417 that were loop breakers.
418]
419[Make -ddump-inlinings and -ddump-rule-firings less noisy
420simonpj@microsoft.com**20091218163742
421 Ignore-this: aea0634c569afd5486de9c6e7dad2ae2
422 
423 By default, these two now print *one line* per inlining or rule-firing.
424 
425 If you want the previous (voluminous) behaviour, use -dverbose-core2core.
426]
427[Make warning printing a bit less noisy
428simonpj@microsoft.com**20091218163549
429 Ignore-this: 86bc5d020b077b6c9d666d3e4d93bd1e
430 
431 Use -dppr-debug to make it noisy again
432]
433[Set fixity (left-assoc) for setIdOccInfo
434simonpj@microsoft.com**20091218163513
435 Ignore-this: 6de9c34824e7713d120c889fc019a72a
436]
437[Comments only
438simonpj@microsoft.com**20091218105434
439 Ignore-this: 48a8ed9e9703b412a7dd3201f22cf92d
440]
441[Add an extra heading in the output for count_lines
442simonpj@microsoft.com**20091218105403
443 Ignore-this: 9e4e91930aba49ad6a247aa1d38297cd
444]
445[Fixes to account for the new layout of MUT_ARR_PTRS (see #650)
446Simon Marlow <marlowsd@gmail.com>**20091221115249
447 Ignore-this: ca4a58628707b362dccedb74e81ef052
448]
449[Partial support for Haiku (#3727)
450Simon Marlow <marlowsd@gmail.com>**20091221110250
451 Ignore-this: 5d4a3104c1bd50b7eae64780cb73071d
452]
453[Fix #3751, also fix some lexical error SrcLocs
454Simon Marlow <marlowsd@gmail.com>**20091217132658
455 Ignore-this: 63e11a7a64bb0c98e793e4cc883f051d
456]
457[kill some old GRAN/PARALLEL_HASKELL code
458Simon Marlow <marlowsd@gmail.com>**20091217103816
459 Ignore-this: 9bcfe3e62c556074a6f9396385ba1cf4
460]
461[improve panic messages for srcLocLine, srcLocCol
462Simon Marlow <marlowsd@gmail.com>**20091217103801
463 Ignore-this: f58623a39bcc65201f150ce9560739d1
464]
465[Tweak the build-dependencies rule, and add comments for it
466Ian Lynagh <igloo@earth.li>**20091219145808]
467[When removing $(TOP) with sed, do so case insensitively
468Ian Lynagh <igloo@earth.li>**20091219135339
469 This avoids problems on Windows, where drive letters may not be the
470 case we expect.
471]
472[Fix a braino in a comment
473Ian Lynagh <igloo@earth.li>**20091218213541]
474[Avoid a failing shell command when cleaning
475Ian Lynagh <igloo@earth.li>**20091218201146
476 It wasn't fatal, but better to avoid it anyway
477]
478[Fix another sed problem on Solaris
479Ian Lynagh <igloo@earth.li>**20091217000421]
480[unused named variables
481dias@cs.tufts.edu**20091218195430
482 Ignore-this: c2d56a21a039bb73023c54883a8c1fa3
483]
484[missed a case in a previous fix
485dias@cs.tufts.edu**20091217210443
486 Ignore-this: ff40b8516a3de3fc36a55534620e4f50
487 
488 Here's the obscure problem:
489 -- However, we also want to allow an assignment to be generated
490 -- in the case when the types are compatible, because this allows
491 -- some slightly-dodgy but occasionally-useful casts to be used,
492 -- such as in RtClosureInspect where we cast an HValue to a MutVar#
493 -- so we can print out the contents of the MutVar#.  If we generate
494 -- code that enters the HValue, then we'll get a runtime panic, because
495 -- the HValue really is a MutVar#.  The types are compatible though,
496 -- so we can just generate an assignment.
497 
498]
499[Fix #650: use a card table to mark dirty sections of mutable arrays
500Simon Marlow <marlowsd@gmail.com>**20091217224228
501 Ignore-this: 75c354682c9ad1b71b68b5bc4cedd6de
502 The card table is an array of bytes, placed directly following the
503 actual array data.  This means that array reading is unaffected, but
504 array writing needs to read the array size from the header in order to
505 find the card table.
506 
507 We use a bytemap rather than a bitmap, because updating the card table
508 must be multi-thread safe.  Each byte refers to 128 entries of the
509 array, but this is tunable by changing the constant
510 MUT_ARR_PTRS_CARD_BITS in includes/Constants.h.
511]
512[Fix build with Solaris sed
513Ian Lynagh <igloo@earth.li>**20091216204354
514 Rather than trying to handle tabs with sed portably, we just use tr to
515 remove them before we start.
516]
517[Build and install inplace the count_lines and compareSizes utils
518Ian Lynagh <igloo@earth.li>**20091216165608]
519[Adjust Activations for specialise and work/wrap, and better simplify in InlineRules
520simonpj@microsoft.com**20091216145205
521 Ignore-this: 2606cf9b00f2172097332b8b25b0553c
522 
523 This patch does two main things:
524 
525 1. Adjusts the way we set the Activation for
526 
527    a) The wrappers generated by the strictness analyser
528       See Note [Wrapper activation] in WorkWrap
529 
530    b) The RULEs generated by Specialise and SpecConstr
531       See Note [Auto-specialisation and RULES] in Specialise
532           Note [Transfer activation] in SpecConstr
533 
534 2. Refines how we set the phase when simplifying the right
535    hand side of an InlineRule.  See
536    Note [Simplifying inside InlineRules] in SimplUtils.
537 
538 Most of the extra lines are comments! 
539 
540 The merit of (2) is that a bit more stuff happens inside InlineRules,
541 and that in turn allows better dead-code elimination.
542]
543[Comments only
544simonpj@microsoft.com**20091216144908
545 Ignore-this: 3dae7793802ded696b01f891a77aaf8
546]
547[fix up libm detection and use (#3724)
548Simon Marlow <marlowsd@gmail.com>**20091216113652
549 Ignore-this: 6bbdd7302b262ac3b8ddc5c852dc538
550]
551[configure.ac: fix libm checks (Trac #3730)
552Sergei Trofimovich <slyfox@inbox.ru>**20091204214012
553 Ignore-this: f3372535a68f3833247f679b023745c8
554 
555 libbfd pulled libm as dependency and broke LIBM= detection.
556 
557 Patch moves libm in library tests as early as possible.
558 Thanks to asuffield for suggesting such a simple fix.
559 Thanks to Roie Kerstein and Renato Gallo for finding
560 and tracking down the issue.
561]
562[#include <sys/select.h> if we have it (#3760)
563Simon Marlow <marlowsd@gmail.com>**20091216095501
564 Ignore-this: 7c00991a67ae6715e16c6458bf0b78af
565]
566[add a couple of assertions
567Simon Marlow <marlowsd@gmail.com>**20091123101918
568 Ignore-this: e631da990055fd28156a6c887e1468ca
569]
570[Add comments
571simonpj@microsoft.com**20091216090344
572 Ignore-this: 6468afc939ab795d5a0eb9fd5dc08a48
573]
574[Refactor to combine two eqExpr functions
575simonpj@microsoft.com**20091216085033
576 Ignore-this: 925dec0fc9af1e0a9359226359627ae7
577 
578 I'd forgotten that Rules.lhs already has an eqExpr function.  This
579 patch combines Rules.eqExpr with the (recent) CoreUtils.eqExpr.
580 
581 I also did a little refactoring by defining CoreSyn.expandUnfolding_maybe
582 (see Note [Expanding variables] in Rules.lhs), and using it in
583      a) CoreUnfold.exprIsConApp_maybe
584      b) Rule matching
585]
586[Two improvements to optCoercion
587simonpj@microsoft.com**20091216084706
588 Ignore-this: 699d2deb1b1bf0c7bd7afb809bee26d2
589 
590 * Fix a bug that meant that
591      (right (inst (forall tv.co) ty))
592   wasn't getting optimised.  This showed up in the
593   compiled code for ByteCodeItbls
594 
595 * Add a substitution to optCoercion, so that it simultaneously
596   substitutes and optimises.  Both call sites wanted this, and
597   optCoercion itself can use it, so it seems a win all round.
598]
599[Comments only
600simonpj@microsoft.com**20091216084558
601 Ignore-this: e5fc7949893dbbdc756d0616647a999b
602]
603[Make setInlineActivation left-associative
604simonpj@microsoft.com**20091216084536
605 Ignore-this: 4d166f158c79c819ac73a0368e52473c
606]
607[Fix a long-standing infelicity in the type pretty printer
608simonpj@microsoft.com**20091216084513
609 Ignore-this: 2d99f8733f6642671fcb88f2179e91e9
610 
611 We weren't parenthesising
612    List (C Int)
613 correctly, when (C Int) is a PredTy
614]
615[Deal with warnings in Coercion.lhs
616simonpj@microsoft.com**20091216084053
617 Ignore-this: 8f5a0537c76ed366003253e1f550d4f5
618]
619[Fix a bug in the in-scope set that led to some lookupIdSubst errors
620simonpj@microsoft.com**20091215160216
621 Ignore-this: ed89f1bf6ece2c1e1cd135f11b130786
622]
623[Fix Trac #3717: exprOkForSpeculation should look through case expressions
624simonpj@microsoft.com**20091215160124
625 Ignore-this: 1b848137f7fb81b2c1f72cc903f1c008
626 
627 See Note [exprOkForSpeculation: case expressions] in CoreUtils
628]
629[Add a size-comparison util
630Ian Lynagh <igloo@earth.li>**20091215202636]
631[Just make C dependencies once, rather than each way
632Ian Lynagh <igloo@earth.li>**20091215135350
633 This makes generating C dependencies for the RTS take 3 seconds, rather
634 than 30.
635]
636[Make addCFileDeps quieter
637Ian Lynagh <igloo@earth.li>**20091215134033
638 Move a comment out of the definition, so it doesn't get printed as
639 a shell command every time we call the definition
640]
641[Don't make C deps for compiler/parser/cutils.c in stage1
642Ian Lynagh <igloo@earth.li>**20091215123757
643 CPP finds the Rts.h, RtsFlags.h etc from the tree, rather than the
644 bootstrapping compiler, and then fails because it doesn't think
645 RtsFlags.h should be used any more.
646]
647[Tidy up computation of result discounts in CoreUnfold
648simonpj@microsoft.com**20091214134647
649 Ignore-this: 351076027f8e9cb8aa44db6d60798c47
650 
651 Mostly this patch is a tidy-up, but it did reveal one inconsistency
652 that I fixed.  When computing result discounts for case expressions,
653 we were *adding* result-discounts for cases on non-arguments, but
654 *picking the one for the max-size branch* for arguments. I think you
655 could argue the toss, but it seems neater (and the code is nicer)
656 to be consistent (ie always add).  See Note [addAltSize result discounts].
657 
658 The nofib results seem fine
659 
660         Program           Size    Allocs   Runtime   Elapsed
661 --------------------------------------------------------------------------------
662           boyer          -0.8%     -4.8%      0.06      0.07
663          sphere          -0.7%     -2.5%      0.15      0.16
664 --------------------------------------------------------------------------------
665             Min          -0.8%     -4.8%    -19.1%    -24.8%
666             Max          -0.5%     +0.0%     +3.4%   +127.1%
667  Geometric Mean          -0.7%     -0.1%     -4.3%     -1.3%
668 
669 The +127% elapsed is a timing error; I re-ran the same binary and it's
670 unchanged from the baseline.
671]
672[Use full equality for CSE
673simonpj@microsoft.com**20091211173920
674 Ignore-this: c6d73febf652aa34dc1197a49e599ee
675 
676 In CSE we were getting lots of apprarently-unequal expressions with
677 the same hash code.  In fact they were perfectly equal -- but we were
678 using a cheap-and-cheerful equality tests for CoreExpr that said False
679 for any lambda expression!
680 
681 This patch adds a proper equality test for Core, with alpha-renaming.
682 It's easy to do, and will avoid silly cases of CSE failing to fire.
683 
684 We should get less of this:
685   WARNING: file compiler/simplCore/CSE.lhs line 326
686   extendCSEnv: long list, length 18
687 from a compiler built with -DDEBUG
688]
689[Improve strictness analysis for bottoming functions
690simonpj@microsoft.com**20091211162324
691 Ignore-this: dd5ef03a1b4728c25a2333f59024dc9c
692 
693 I found the following results from strictness analyis:
694   f x = error (fst x)      -- Strictness U(SA)b
695   g x = error ('y':fst x)  -- Strictness Tb
696 
697 Surely 'g' is no less strict on 'x' than 'f' is!  The fix turned out
698 be to very nice and simple.  See Note [Bottom demands] in DmdAnal.
699]
700[Bottom extraction: float out bottoming expressions to top level
701simonpj@microsoft.com**20091211161928
702 Ignore-this: a1a96b36dc982d83f5c01a4259518b
703   
704 The idea is to float out bottoming expressions to top level,
705 abstracting them over any variables they mention, if necessary.  This
706 is good because it makes functions smaller (and more likely to
707 inline), by keeping error code out of line.
708 
709 See Note [Bottoming floats] in SetLevels.
710 
711 On the way, this fixes the HPC failures for cg059 and friends.
712 
713 I've been meaning to do this for some time.  See Maessen's paper 1999
714 "Bottom extraction: factoring error handling out of functional
715 programs" (unpublished I think).
716 
717 Here are the nofib results:
718 
719 
720         Program           Size    Allocs   Runtime   Elapsed
721 --------------------------------------------------------------------------------
722             Min          +0.1%     -7.8%    -14.4%    -32.5%
723             Max          +0.5%     +0.2%     +1.6%    +13.8%
724  Geometric Mean          +0.4%     -0.2%     -4.9%     -6.7%
725 
726 Module sizes
727         -1 s.d.                -----           -2.6%
728         +1 s.d.                -----           +2.3%
729         Average                -----           -0.2%
730 
731 Compile times:
732         -1 s.d.                -----          -11.4%
733         +1 s.d.                -----           +4.3%
734         Average                -----           -3.8%
735 
736 I'm think program sizes have crept up because the base library
737 is bigger -- module sizes in nofib decrease very slightly.  In turn
738 I think that may be because the floating generates a call where
739 there was no call before.  Anyway I think it's acceptable.
740 
741 
742 The main changes are:
743 
744 * SetLevels floats out things that exprBotStrictness_maybe
745   identifies as bottom.  Make sure to pin on the right
746   strictness info to the newly created Ids, so that the
747   info ends up in interface files.
748 
749   Since FloatOut is run twice, we have to be careful that we
750   don't treat the function created by the first float-out as
751   a candidate for the second; this is what worthFloating does.
752 
753   See SetLevels Note [Bottoming floats]
754                 Note [Bottoming floats: eta expansion]
755 
756 * Be careful not to inline top-level bottoming functions; this
757   would just undo what the floating transformation achieves.
758   See CoreUnfold Note [Do not inline top-level bottoming functions
759 
760   Ensuring this requires a bit of extra plumbing, but nothing drastic..
761 
762 * Similarly pre/postInlineUnconditionally should be
763   careful not to re-inline top-level bottoming things!
764   See SimplUtils Note [Top-level botomming Ids]
765                  Note [Top level and postInlineUnconditionally]
766]
767[Expose all EventLog events as DTrace probes
768Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20091212100809
769 Ignore-this: 2c5ef30b1ff7fb2ea5fba8cf0a187d45
770 - Defines a DTrace provider, called 'HaskellEvent', that provides a probe
771   for every event of the eventlog framework.
772 - In contrast to the original eventlog, the DTrace probes are available in
773   all flavours of the runtime system (DTrace probes have virtually no
774   overhead if not enabled); when -DTRACING is defined both the regular
775   event log as well as DTrace probes can be used.
776 - Currently, Mac OS X only.  User-space DTrace probes are implemented
777   differently on Mac OS X than in the original DTrace implementation.
778   Nevertheless, it shouldn't be too hard to enable these probes on other
779   platforms, too.
780 - Documentation is at http://hackage.haskell.org/trac/ghc/wiki/DTrace
781]
782[Fix two related bugs in u_tys
783simonpj@microsoft.com**20091211120122
784 Ignore-this: 25e826e0915c6f6267cadff96f1d7ca6
785 
786 When we normalise a type family application we must recursively call
787 uTys, *not* 'go', because the latter loop is only there to look
788 through type synonyms.  This bug made the type checker generate
789 ill-typed coercions, which were rejected by Core Lint.
790 
791 A related bug only affects the size of coercions.  If faced with
792   (m a) ~ (F b c)
793 where F has arity 1, we want to decompose to
794    m ~ F Int,  a ~ c
795 rather than deferring.  The application decomposition was being
796 tried last, so we were missing this opportunity.
797 
798 Thanks to Roman for an example that showed all this up.
799]
800[Fix spelling in comment
801simonpj@microsoft.com**20091211115744
802 Ignore-this: bd02fc0eb67efc7404536f1ee96d4d1f
803]
804[Make -ddump-simpl-stats a bit more informative by default
805simonpj@microsoft.com**20091208175445
806 Ignore-this: 1bbe3f4c4b727a3b1580236c1f9c2583
807 
808 This mades -ddump-simpl-stats print out per-rule and per-id
809 information by default, rather than requiring -dppr-debug.
810 On the whole that is what you want.  The -dppr-debug flag
811 now just controls printing of the log.
812]
813[Improve dumping for rules, and documentation of same
814simonpj@microsoft.com**20091208105556
815 Ignore-this: 4b09e56f953d130d5cb2807cf9da7303
816 
817 Inspired by Trac #3703
818]
819[Fix #3741, simplifying things in the process
820Simon Marlow <marlowsd@gmail.com>**20091210160909
821 Ignore-this: 8a668af4eb9e1aa71b4764b84f148dac
822 The problem in #3741 was that we had confused column numbers with byte
823 offsets, which fails in the case of UTF-8 (amongst other things).
824 Fortunately we're tracking correct column offsets now, so we didn't
825 have to make a calculation based on a byte offset.  I got rid of two
826 fields from the PState (last_line_len and last_offs).and one field
827 from the AI (alex input) constructor.
828]
829[Allow spaces at either end of the C import spec (#3742)
830Simon Marlow <marlowsd@gmail.com>**20091210124537
831 Ignore-this: 840424ea49d5e81ab8f8ce3209d5eedf
832]
833[Put README and INSTALL into bindists
834Ian Lynagh <igloo@earth.li>**20091209174305
835 Also tidied up the way configure.ac gets into bindists
836]
837[Fix typo
838Ian Lynagh <igloo@earth.li>**20091209152223]
839[Fix the stage1 version number munging
840Ian Lynagh <igloo@earth.li>**20091209151715
841 It was munging 6.12.1 into 62
842]
843[Add a comment about why $(CPP) is defined the way it is in config.mk.in
844Ian Lynagh <igloo@earth.li>**20091209131917]
845[add a missing unlockTSO()
846Simon Marlow <marlowsd@gmail.com>**20091209124113
847 Ignore-this: 9ff0aedcb6d62e5b4bd2fab30bfce105
848]
849[Eliminate mkdependC
850Ian Lynagh <igloo@earth.li>**20091209123929
851 We now just call gcc to get the dependencies directly
852]
853[Change some HC_OPTS to CC_OPTS, so they are used when making dependencies
854Ian Lynagh <igloo@earth.li>**20091208200315]
855[Add -Iincludes to hp2ps's CC_OPTS
856Ian Lynagh <igloo@earth.li>**20091208175718
857 Making C deps for hp2ps always failed, but we used to carry on regardless
858]
859[add locking in mkWeakForeignEnv#
860Simon Marlow <marlowsd@gmail.com>**20091208101229
861 Ignore-this: 3902631687fc252c0e6794d58641371b
862]
863[declare g0 (fixes compilation failure with -fvia-C)
864Simon Marlow <marlowsd@gmail.com>**20091208100925]
865[simplify weak pointer processing
866Simon Marlow <marlowsd@gmail.com>**20091208094822
867 Ignore-this: d88091b23860eeba6cd971282b05c2e6
868]
869[simplification/optimisation: update tso->bound->tso when scavenging the TSO
870Simon Marlow <marlowsd@gmail.com>**20091208085739
871 Ignore-this: 401e2c67e42de9671191ba9d18c3fcf7
872]
873[threadStackUnderflow: fix recently introduced bug (conc068(threaded1) failure)
874Simon Marlow <marlowsd@gmail.com>**20091207170127
875 Ignore-this: cab7b66b3b1478d44ad5272eeec84004
876 
877 bug introduced by "threadStackUnderflow: put the new TSO on the mut
878 list if necessary"
879]
880[need locking around use of weak_ptr_list in mkWeak#
881Simon Marlow <marlowsd@gmail.com>**20091207145213
882 Ignore-this: 9c7d506c30652de4dd5c47d1989022c1
883]
884[remove global 'total_allocated', seems to be the same as 'GC_tot_alloc'
885Simon Marlow <marlowsd@gmail.com>**20091207115359
886 Ignore-this: d174f167a2be6864bbab672f3d5b7c5
887]
888[Add some explanation about overlapping instances
889simonpj@microsoft.com**20091207153915
890 Ignore-this: 627db39187f0ed8a10fe46e667a849a
891 
892 Trac #3734 suggested addding some extra guidance about
893 incoherence and overlap; now done
894]
895[Tidy up deriving error messages
896simonpj@microsoft.com**20091207130850
897 Ignore-this: 4e134f6b62814ea6f361df7525c25a2d
898 
899 I did this in response to a suggestion in Trac #3702
900]
901[Fix profiling build
902Simon Marlow <marlowsd@gmail.com>**20091207092314
903 Ignore-this: eb397ec713cb7a8f6e56f409e0663ffe
904]
905[Minor refactoring to remove redundant code
906simonpj@microsoft.com**20091207083312
907 Ignore-this: 3203447fa823823ae27565f53d39bd10
908]
909[Fix a nasty (and long-standing) FloatOut performance bug
910simonpj@microsoft.com**20091207083246
911 Ignore-this: a64b98992fa4ced434d1edf0b89842ec
912 
913 The effect was that, in deeply-nested applications, FloatOut would
914 take quadratic time.  A good example was compiling
915     programs/barton-mangler-bug/Expected.hs
916 in which FloatOut had a visible pause of a couple of seconds!
917 Profiling showed that 40% of the entire compile time was being
918 consumbed by the single function partitionByMajorLevel.
919 
920 The bug was that the floating bindings (type FloatBinds) was kept
921 as a list, which was partitioned at each binding site.  In programs
922 with deeply nested lists, such as
923        e1 : e2 : e3 : .... : e5000 : []
924 this led to quadratic behaviour.
925 
926 The solution is to use a proper finite-map representation;
927 see the new definition of FloatBinds near the bottom of FloatOut.
928]
929[Add a new to-do to cmm-notes
930simonpj@microsoft.com**20091207081130
931 Ignore-this: fc835da15dd8a206c2c1bdc6c7053c5b
932]
933[Comments only, principally about IfaceDeclExtras
934simonpj@microsoft.com**20091207081108
935 Ignore-this: 1004303ab0df7802295d67c613c4ab24
936]
937[Comments only, about RULE plumbing
938simonpj@microsoft.com**20091207080442
939 Ignore-this: 1a559744f6ad75e151afbfb2281bceb4
940]
941[Add splitUFM to UniqFM (used in a forthcoming patch)
942simonpj@microsoft.com**20091204160820
943 Ignore-this: 332aa029f25ec3f22e4f195ecd44b40b
944 
945 splitUFM :: Uniquable key => UniqFM elt -> key -> (UniqFM elt, Maybe elt, UniqFM elt)
946    -- Splits a UFM into things less than, equal to, and greater than the key
947]
948[Add lengthBag to Bag (using in forthcoming patch)
949simonpj@microsoft.com**20091204155055
950 Ignore-this: 5af0f45d6b51bc77e54c5cb0e2b1e607
951]
952[Use addToUFM_Acc where appropriate
953simonpj@microsoft.com**20091204155036
954 Ignore-this: 38e768c4a9f00d7870a631a9472e6edc
955 
956 This way of extending a UniqFM has existed for some time, but
957 we weren't really using it.
958 
959 addToUFM_Acc   :: Uniquable key =>
960                              (elt -> elts -> elts)     -- Add to existing
961                           -> (elt -> elts)             -- New element
962                           -> UniqFM elts               -- old
963                           -> key -> elt                -- new
964                           -> UniqFM elts               -- result
965]
966[Add comments to "OPTIONS_GHC -fno-warn-orphans" pragmas
967Ian Lynagh <igloo@earth.li>**20091205165721]
968[Add some missing exports back for GHC package users; fixes trac #3715
969Ian Lynagh <igloo@earth.li>**20091205153532]
970[Add some comments on the alternative layout rule state
971Ian Lynagh <igloo@earth.li>**20091205152039]
972[Tweak layout for alternative layout rule
973Ian Lynagh <igloo@earth.li>**20091203164424]
974[Link all dynamic libraries with the correct install_name on Mac OS/X.
975Ian Lynagh <igloo@earth.li>**20091204143614
976 This is a rerecord of
977     Stephen Blackheath <oversensitive.pastors.stephen@blacksapphire.com>**20090930222855
978 to avoid conflicts.
979]
980[Document the new -dylib-install-name option in the user's guide.
981Stephen Blackheath <oversensitive.pastors.stephen@blacksapphire.com>**20091001051637
982 Ignore-this: 568f6ad423f737ccda3a79f2d8efdb97
983]
984[Add -dylib-install-name option to GHC so the install name can be set for dynamic libs on Mac OS/X.
985Stephen Blackheath <oversensitive.pastors.stephen@blacksapphire.com>**20090930223708
986 Ignore-this: 2323929595c0dc03a2e2ea802477a930
987]
988[Force -fPIC when linking against dynamic libraries on Mac OS/X.
989Stephen Blackheath <oversensitive.pastors.stephen@blacksapphire.com>**20090928203800
990 Ignore-this: 465433af2349779b510f500dc79768f3
991 Otherwise you get
992 /tmp/ghc7602_0/ghc7602_0.s:207:0:
993    non-relocatable subtraction expression, "___stginit_Lib_dyn" minus "L1x2;4"
994 /tmp/ghc7602_0/ghc7602_0.s:207:0:
995    symbol: "___stginit_Lib_dyn" can't be undefined in a subtraction expression
996]
997[evaluate_large: evaluate large objects to bd->dest rather than gen->to
998Simon Marlow <marlowsd@gmail.com>**20091204111037
999 Ignore-this: 6c77407750d4a6178851aeb79ded20d1
1000 This fixes aging of large objects in the new scheme.  Bug found by
1001 perf/space_leaks/space_leak_001.  Yay perf regressions tests.
1002]
1003[Correction to the allocation stats following earlier refactoring
1004Simon Marlow <marlowsd@gmail.com>**20091204110839
1005 Ignore-this: 7ac497c67706bedd29c79091c100d22f
1006]
1007[export g0
1008Simon Marlow <marlowsd@gmail.com>**20091203165209
1009 Ignore-this: 69b5445beb91ac99bb018b9806de90a
1010]
1011[GC refactoring, remove "steps"
1012Simon Marlow <marlowsd@gmail.com>**20091203150728
1013 Ignore-this: 5360b8bf30c6847ccb7ffa8c431e81ff
1014 
1015 The GC had a two-level structure, G generations each of T steps.
1016 Steps are for aging within a generation, mostly to avoid premature
1017 promotion. 
1018 
1019 Measurements show that more than 2 steps is almost never worthwhile,
1020 and 1 step is usually worse than 2.  In theory fractional steps are
1021 possible, so the ideal number of steps is somewhere between 1 and 3.
1022 GHC's default has always been 2.
1023 
1024 We can implement 2 steps quite straightforwardly by having each block
1025 point to the generation to which objects in that block should be
1026 promoted, so blocks in the nursery point to generation 0, and blocks
1027 in gen 0 point to gen 1, and so on.
1028 
1029 This commit removes the explicit step structures, merging generations
1030 with steps, thus simplifying a lot of code.  Performance is
1031 unaffected.  The tunable number of steps is now gone, although it may
1032 be replaced in the future by a way to tune the aging in generation 0.
1033]
1034[fix error message on Windows (fixes rtsflags001)
1035Simon Marlow <marlowsd@gmail.com>**20091202141135
1036 Ignore-this: 239fed52f7f5358b034acd6512d26ef4
1037]
1038[Fix loading of annotations
1039Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091204024259
1040 Ignore-this: 5750856feecbf9c6aeebfec012b1a1fd
1041 
1042 The problem was that we collected all annotations we knew about once when the
1043 simplifier started and threaded them through the CoreM monad. If new interface
1044 files were loaded during simplification, their annotations would not be
1045 visible to the simplifier.
1046 
1047 Now, we rebuild the annotation list at the start of every simplifier pass that
1048 needs it (which is only SpecConstr at the moment). This ensures that we see
1049 all annotations that have been loaded so far. This is somewhat similar to how
1050 RULES are handled.
1051]
1052[Add new ForceSpecConstr annotation
1053Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091203065455
1054 Ignore-this: ca5327f85d9d40c78d95e8bfe3e7fab1
1055 
1056 Annotating a type with {-# ANN type T ForceSpecConstr #-} makes SpecConstr
1057 ignore -fspec-constr-threshold and -fspec-constr-count for recursive functions
1058 that have arguments of type T. Such functions will be specialised regardless
1059 of their size and there is no upper bound on the number of specialisations
1060 that can be generated. This also works if T is embedded in other types such as
1061 Maybe T (but not T -> T).
1062 
1063 T should not be a product type because it could be eliminated by the
1064 worker/wrapper transformation. For instance, in
1065 
1066 data T = T Int Int
1067 
1068 foo :: T -> Int
1069 foo (T m n) = ... foo (T m' n') ...
1070 
1071 SpecConstr will never see the T because w/w will get rid of it. I'm still
1072 thinking about whether fixing this is worthwhile.
1073]
1074[Generate INLINE pragmas for PA methods
1075Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091203031452
1076 Ignore-this: 3435044aec2737ba58d269aeff915fbd
1077]
1078[Add a GHC layout extension to the alternative layout rule
1079Ian Lynagh <igloo@earth.li>**20091203155708]
1080[Fix HPC column numbers, following the column number changes in GHC
1081Ian Lynagh <igloo@earth.li>**20091203135520]
1082[Whitespace only
1083Ian Lynagh <igloo@earth.li>**20091203132259]
1084[Fix column numbers used when highlighting :list output
1085Ian Lynagh <igloo@earth.li>**20091203130328]
1086[add a missing lock around allocGroup()
1087Simon Marlow <marlowsd@gmail.com>**20091203110209
1088 Ignore-this: 5898b3de4010e16789b628b004aa77db
1089]
1090[remove unused cap->in_gc flag
1091Simon Marlow <marlowsd@gmail.com>**20091202154240
1092 Ignore-this: db2ef6c957c8d32233bbcc344e3c06b6
1093]
1094[Refactoring only
1095Simon Marlow <marlowsd@gmail.com>**20091202123806
1096 Ignore-this: 95a93f6e330f2c609c197194412cac75
1097]
1098[move sanity checking code from Storage.c to Sanity.c
1099Simon Marlow <marlowsd@gmail.com>**20091202121141
1100 Ignore-this: 216d434c3c3d2250effac22b37bc2b4d
1101]
1102[stg_ap_0_fast: sanity-check only the topmost frame, not the whole stack
1103Simon Marlow <marlowsd@gmail.com>**20091202115109
1104 Ignore-this: ad45e07c26aa961913d367d7c53efb75
1105 Sanity checking was getting too slow in some cases, this returns it to
1106 a constant-factor overhead.
1107]
1108[Fix profiling build
1109Simon Marlow <marlowsd@gmail.com>**20091203085930
1110 Ignore-this: ff3de527cbf7703e8bac4a48933cd8ba
1111]
1112[More work on the simplifier's inlining strategies
1113simonpj@microsoft.com**20091202174256
1114 Ignore-this: 5840392a95d9a47f37c3074f7394f2c2
1115 
1116 This patch collects a small raft of related changes
1117 
1118 * Arrange that during
1119      (a) rule matching and
1120      (b) uses of exprIsConApp_maybe
1121   we "look through" unfoldings only if they are active
1122   in the phase. Doing this for (a) required a bit of
1123   extra plumbing in the rule matching code, but I think
1124   it's worth it.
1125 
1126   One wrinkle is that even if inlining is off (in the 'gentle'
1127   phase of simplification) during rule matching we want to
1128   "look through" things with inlinings. 
1129    See SimplUtils.activeUnfInRule.
1130 
1131   This fixes a long-standing bug, where things that were
1132   supposed to be (say) NOINLINE, could still be poked into
1133   via exprIsConApp_maybe.
1134 
1135 * In the above cases, also check for (non-rule) loop breakers;
1136   we never look through these.  This fixes a bug that could make
1137   the simplifier diverge (and did for Roman). 
1138   Test = simplCore/should_compile/dfun-loop
1139 
1140 * Try harder not to choose a DFun as a loop breaker. This is
1141   just a small adjustment in the OccurAnal scoring function
1142 
1143 * In the scoring function in OccurAnal, look at the InlineRule
1144   unfolding (if there is one) not the actual RHS, beause the
1145   former is what'll be inlined. 
1146 
1147 * Make the application of any function to dictionary arguments
1148   CONLIKE.  Thus (f d1 d2) is CONLIKE. 
1149   Encapsulated in CoreUtils.isExpandableApp
1150   Reason: see Note [Expandable overloadings] in CoreUtils
1151 
1152 * Make case expressions seem slightly smaller in CoreUnfold.
1153   This reverses an unexpected consequences of charging for
1154   alternatives.
1155 
1156 Refactorings
1157 ~~~~~~~~~~~~
1158 * Signficantly refactor the data type for Unfolding (again).
1159   The result is much nicer. 
1160 
1161 * Add type synonym BasicTypes.CompilerPhase = Int
1162   and use it
1163 
1164 Many of the files touched by this patch are simply knock-on
1165 consequences of these two refactorings.
1166]
1167[Fix Trac #3100: reifyType
1168simonpj@microsoft.com**20091130175204
1169 Ignore-this: ad1578c3d2e3da6128cd5052c8b64dc
1170 
1171 A type without any leading foralls may still have constraints
1172    eg:  ?x::Int => Int -> Int
1173 
1174 But reifyType was failing in this case.
1175 
1176 Merge to 6.12.
1177]
1178[Fix Trac #3102: pre-matching polytypes
1179simonpj@microsoft.com**20091130174441
1180 Ignore-this: 3e3fa97e0de28b005a1aabe9e5542b32
1181 
1182 When *pre-matching* two types
1183      forall a. C1 => t1  ~  forall a. C2 => t2
1184 we were matching t1~t2, but totally ignoring C1,C2
1185 That's utterly wrong when pre-matching
1186        (?p::Int) => String  ~  a
1187 because we emerge with a:=String!
1188 
1189 All this is part of the impredicative story, which is about
1190 to go away, but still.
1191 
1192 Worth merging this to 6.12
1193]
1194[threadStackUnderflow: put the new TSO on the mut list if necessary
1195Simon Marlow <marlowsd@gmail.com>**20091202144549
1196 Ignore-this: 839e7ad7893b3d7ea6481030ce7c6fe6
1197]
1198[don't sanity check the whole stack when switching interp<->compiled
1199Simon Marlow <marlowsd@gmail.com>**20091202134121
1200 Ignore-this: 999b44d4dd096eceda81dda65f65a2df
1201]
1202[fix to sanity checking for ThreadRelocated TSOs
1203Simon Marlow <marlowsd@gmail.com>**20091202134041
1204 Ignore-this: 52364f29041e6909b550956087649220
1205]
1206[sanity check the top stack frame, not the whole stack
1207Simon Marlow <marlowsd@gmail.com>**20091202134020
1208 Ignore-this: c4c9b58c13299eecf7ec8cb79e34dc1f
1209]
1210[Make allocatePinned use local storage, and other refactorings
1211Simon Marlow <marlowsd@gmail.com>**20091201160321
1212 Ignore-this: ec1334a9a5ec0de2567aa81d74b715ba
1213 
1214 This is a batch of refactoring to remove some of the GC's global
1215 state, as we move towards CPU-local GC. 
1216 
1217   - allocateLocal() now allocates large objects into the local
1218     nursery, rather than taking a global lock and allocating
1219     then in gen 0 step 0.
1220 
1221   - allocatePinned() was still allocating from global storage and
1222     taking a lock each time, now it uses local storage.
1223     (mallocForeignPtrBytes should be faster with -threaded).
1224     
1225   - We had a gen 0 step 0, distinct from the nurseries, which are
1226     stored in a separate nurseries[] array.  This is slightly strange.
1227     I removed the g0s0 global that pointed to gen 0 step 0, and
1228     removed all uses of it.  I think now we don't use gen 0 step 0 at
1229     all, except possibly when there is only one generation.  Possibly
1230     more tidying up is needed here.
1231 
1232   - I removed the global allocate() function, and renamed
1233     allocateLocal() to allocate().
1234 
1235   - the alloc_blocks global is gone.  MAYBE_GC() and
1236     doYouWantToGC() now check the local nursery only.
1237]
1238[Free full_prog_argv at exit, closing a memory leak
1239Simon Marlow <marlowsd@gmail.com>**20091201122801
1240 Ignore-this: 8fdb41e09bfc318821c427d2f22af737
1241]
1242[free cap->saved_mut_lists too
1243Simon Marlow <marlowsd@gmail.com>**20091201113448
1244 Ignore-this: 973e1de140e104c126fe4a213791ba86
1245 fixes some memory leakage at shutdown
1246]
1247[exitScheduler: move boundTaskExiting call outside #ifdef THREADED_RTS
1248Simon Marlow <marlowsd@gmail.com>**20091201113352
1249 Ignore-this: d913df43b14054f73c0fa06d0205952c
1250 Fixes a little leaked memory at shutdown in non-threaded RTS
1251]
1252[Use dlltool from the in-tree mingw installation
1253Ian Lynagh <igloo@earth.li>**20091201190544
1254 We only use dlltool on Windows, and this way we don't require that
1255 the user has it installed.
1256]
1257[Fix Commentary link in the HACKING file; trac #3706
1258Ian Lynagh <igloo@earth.li>**20091201150149]
1259[Add an entry fo the ghci command :run to the user guide
1260Ian Lynagh <igloo@earth.li>**20091201173339]
1261[Fix typo in docs
1262Ian Lynagh <igloo@earth.li>**20091201170550]
1263[Delay expansion of some makefile variables until they are available
1264Ian Lynagh <igloo@earth.li>**20091201133609]
1265[Call $(SED) rather than sed
1266Ian Lynagh <igloo@earth.li>**20091201131123]
1267[Look for sed as gsed first
1268Ian Lynagh <igloo@earth.li>**20091201130741
1269 Solaris's sed apparently doesn't understand [:space:]
1270]
1271[Avoid running empty for loops; fixes trac #3683
1272Ian Lynagh <igloo@earth.li>**20091201125927
1273 Solaris's sh gives
1274     /bin/sh: syntax error at line 1: `;' unexpected
1275 when faced with something like
1276     for x in ; do ...; done
1277 Patch from Christian Maeder.
1278]
1279[Fix PS file generation
1280Simon Marlow <marlowsd@gmail.com>**20091201154254
1281 Ignore-this: 7b7122208e845b029a8b7215149fd203
1282 (the image doesn't work, but at least db2latex doesn't fall over)
1283]
1284[Implement a new heap-tuning option: -H
1285Simon Marlow <marlowsd@gmail.com>**20091130151836
1286 Ignore-this: 2089b9dfaf6c095dc0460cef39e9d586
1287 
1288 -H alone causes the RTS to use a larger nursery, but without exceeding
1289 the amount of memory that the application is already using.  It trades
1290 off GC time against locality: the default setting is to use a
1291 fixed-size 512k nursery, but this is sometimes worse than using a very
1292 large nursery despite the worse locality.
1293 
1294 Not all programs get faster, but some programs that use large heaps do
1295 much better with -H.  e.g. this helps a lot with #3061 (binary-trees),
1296 though not as much as specifying -H<large>.  Typically using -H<large>
1297 is better than plain -H, because the runtime doesn't know ahead of
1298 time how much memory you want to use.
1299 
1300 Should -H be on by default?  I'm not sure, it makes some programs go
1301 slower, but others go faster.
1302]
1303[Store a destination step in the block descriptor
1304Simon Marlow <marlowsd@gmail.com>**20091129164251
1305 Ignore-this: c406550acfe10141fcc38d3949d67490
1306 At the moment, this just saves a memory reference in the GC inner loop
1307 (worth a percent or two of GC time).  Later, it will hopefully let me
1308 experiment with partial steps, and simplifying the generation/step
1309 infrastructure.
1310]
1311[Fix the prof_scc.png image in the profiling section (#3694)
1312Simon Marlow <marlowsd@gmail.com>**20091130132703
1313 Ignore-this: 9774bad70187274e3dd283d66703004
1314]
1315[document 'recache' command in the help output (#3684)
1316Simon Marlow <marlowsd@gmail.com>**20091130122040
1317 Ignore-this: 95a51f76e66055af27cdfc7b5ad7deb3
1318]
1319[Check whether the main function is actually exported (#414)
1320Simon Marlow <marlowsd@gmail.com>**20091130112327
1321 Ignore-this: 1afaa18d8c0c9e1d029531ac9d4865bb
1322]
1323[Avoid using non-standard GNU tar option --force-local
1324Simon Marlow <marlowsd@gmail.com>**20091130112605
1325 Ignore-this: ac066722b15eb93e752d4f63391c9e3c
1326]
1327[Reorder ALL_RTS_LIBS
1328Matthias Kilian <kili@outback.escape.de>**20091115175405
1329 Ignore-this: 795cfd5215ec73eea729aa2b3097817e
1330 
1331 ALL_RTS_LIBS is (ab)used for linking ghc when BootingFromHc=Yes,
1332 which needs libHSrtsmain.a before libHSrts.a.
1333 
1334]
1335[Update dependencies
1336Ian Lynagh <igloo@earth.li>**20091129165534]
1337[Follow Cabal changes
1338Ian Lynagh <igloo@earth.li>**20091129165141]
1339[Tweak layout to work with alternative layout rule
1340Ian Lynagh <igloo@earth.li>**20091129163044]
1341[Tweak the alternative layout rule: {} contains commas
1342Ian Lynagh <igloo@earth.li>**20091129155454]
1343[Correct the advanceSrcLoc calculation for tabs
1344Ian Lynagh <igloo@earth.li>**20091129153933
1345 It was off-by-one
1346]
1347[Tweak alternative layout rule
1348Ian Lynagh <igloo@earth.li>**20091129152323]
1349[Make the alternative layout rule cope with file pragmas
1350Ian Lynagh <igloo@earth.li>**20091129145840]
1351[Give more informative error messages
1352Ian Lynagh <igloo@earth.li>**20091129031029
1353 We used to just get
1354     ghc: panic! (the 'impossible' happened)
1355       (GHC version 6.13.20091128 for x86_64-unknown-linux):
1356         too few bytes. Failed reading at byte position 32753
1357 with no indication of what was being parsed.
1358]
1359[Teach advanceSrcLoc about tab characters
1360Ian Lynagh <igloo@earth.li>**20091128151204]
1361[Whitespace only
1362Ian Lynagh <igloo@earth.li>**20091128150731]
1363[Columns now start at 1, as lines already did
1364Ian Lynagh <igloo@earth.li>**20091127224050
1365 Also corrected a couple of line 0's to line 1
1366]
1367[Remove configure tests on tarballs that no longer exist
1368Ian Lynagh <igloo@earth.li>**20091127150101]
1369[Implement non-decreasing do indentation in the alternative layout rule
1370Ian Lynagh <igloo@earth.li>**20091127011932]
1371[add docs for Unicode entities in #2978
1372Simon Marlow <marlowsd@gmail.com>**20091125153649
1373 Ignore-this: f3d1561ef8f55606d9022ab7243e3800
1374]
1375[Apply patch from #2978: add more Unicode syntax
1376Simon Marlow <marlowsd@gmail.com>**20090918130333
1377 Ignore-this: 1393009fdf2383ca43046ba0767a51e0
1378]
1379[Use UTF-8 explicitly for InstalledPackageInfo
1380Simon Marlow <marlowsd@gmail.com>**20091125141730
1381 Ignore-this: 45be1506dd5c3339fb229a44aa958235
1382 So ghc-pkg register/update takes input in UTF-8, and ghc-pkg dump
1383 outputs in UTF-8.  Textual package config files in the package DB are
1384 assumed to be in UTF-8.
1385]
1386[Comments only, esp about RecStmts
1387simonpj@microsoft.com**20091126163241
1388 Ignore-this: 6fb05bd70b1d0cbb55fb01cf1f17ea77
1389]
1390[Fix a bug in alternative layout rule
1391Ian Lynagh <igloo@earth.li>**20091125231901]
1392[Fix a bug in alternative layout
1393Ian Lynagh <igloo@earth.li>**20091125230616
1394 And make the code simpler in the process!
1395]
1396[Bug fix for alternative layout rule
1397Ian Lynagh <igloo@earth.li>**20091125205809]
1398[Tweak alternative layout rule
1399Ian Lynagh <igloo@earth.li>**20091125193854]
1400[Add unboxed parentheses to the alternative layout rule
1401Ian Lynagh <igloo@earth.li>**20091125182421]
1402[Tweak the warning suppression flags used in Lexer
1403Ian Lynagh <igloo@earth.li>**20091125171815]
1404[Implement the alternative layout rule
1405Ian Lynagh <igloo@earth.li>**20091125171656
1406 Caution: Largely untested
1407]
1408[Fix some warning in Lexer
1409Ian Lynagh <igloo@earth.li>**20091124233726]
1410[threadStackOverflow: check whether stack squeezing released some stack (#3677)
1411Simon Marlow <marlowsd@gmail.com>**20091125125917
1412 Ignore-this: d35089eb93f5b367b7d1c445bda79232
1413 
1414 In a stack overflow situation, stack squeezing may reduce the stack
1415 size, but we don't know whether it has been reduced enough for the
1416 stack check to succeed if we try again.  Fortunately stack squeezing
1417 is idempotent, so all we need to do is record whether *any* squeezing
1418 happened.  If we are at the stack's absolute -K limit, and stack
1419 squeezing happened, then we try running the thread again.
1420 
1421 We also want to avoid enlarging the stack if squeezing has already
1422 released some of it.  However, we don't want to get into a
1423 pathalogical situation where a thread has a nearly full stack (near
1424 its current limit, but not near the absolute -K limit), keeps
1425 allocating a little bit, squeezing removes a little bit, and then it
1426 runs again.  So to avoid this, if we squeezed *and* there is still
1427 less than BLOCK_SIZE_W words free, then we enlarge the stack anyway.
1428]
1429[add a comment to TSO_MARKED
1430Simon Marlow <marlowsd@gmail.com>**20091125104954
1431 Ignore-this: 7111281a443533dc453dbf9481dba519
1432]
1433[Pass --no-user-package-conf to ghc-pkg in bindisttest
1434Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091125115953]
1435[Add a note saying what Haddock relies on about Instance.is_dfun
1436David Waern <david.waern@gmail.com>**20091124210308]
1437[Treat () as an enumeration tycon
1438Ian Lynagh <igloo@earth.li>**20091124011313
1439 This fixes deriving Ord (), which previously failed with
1440   ghc-stage1: panic! (the 'impossible' happened)
1441     (GHC version 6.13.20091123 for x86_64-unknown-linux):
1442           TcGenDeriv:mk_FunBind
1443]
1444[Whitespace only
1445Ian Lynagh <igloo@earth.li>**20091124003221]
1446[inline has moved to GHC.Magic
1447Ian Lynagh <igloo@earth.li>**20091123200308]
1448[Use the ghc-perl tarball on Windows, instead of the msys one
1449Ian Lynagh <igloo@earth.li>**20091120153953]
1450[Install perl on Windows
1451Ian Lynagh <igloo@earth.li>**20091120223830]
1452[Remove cprAnalysis directory from hs-source-dirs
1453simonpj@microsoft.com**20091120161911
1454 Ignore-this: e7d3707794979e45b43136137c939af1
1455]
1456[Remove -fasm from mk/validate-settings.mk
1457Ian Lynagh <igloo@earth.li>**20091120125656
1458 Makes it easier to do unregisterised validate runs
1459]
1460[Fix some dependencies in bindists
1461Ian Lynagh <igloo@earth.li>**20091120125342
1462 We can't depend on sources in a bindist, because we don't have the sources.
1463]
1464[Add a rule to allow us to sdist libraries easily
1465Ian Lynagh <igloo@earth.li>**20091119160527]
1466[Check upper/lower bounds on various RTS flags (#3633)
1467Simon Marlow <marlowsd@gmail.com>**20091119142422
1468 Ignore-this: 8cbbb3f0f2c46711967491d5c028a410
1469 
1470 Also, make K mean 1024 rather than 1000, in RTS flags (similarly for M
1471 and G).  The main reason I want to change it is that otherwise this
1472 might be confusing:
1473   
1474 exp3_8: error in RTS option -H4k: size outside allowed range (4096 - 18446744073709551615)
1475 
1476 And I think the original reason for using 1000 instead of 1024,
1477 worries about direct-mapped caches, is not an issue in this context
1478 (even if you can find a direct-mapped cache these days).
1479]
1480[define HS_WORD_MAX
1481Simon Marlow <marlowsd@gmail.com>**20091119140143
1482 Ignore-this: ed27e7c7ac0bd03cddcd745ae7053a74
1483]
1484[Print the prog name in errorBelch() even if prog_argv is not set yet
1485Simon Marlow <marlowsd@gmail.com>**20091119135230
1486 Ignore-this: ec42e7a4f344ebc34befddfc3d74a946
1487 This means we get the prog name in error messages from the flag parser
1488]
1489[Remove dead code
1490Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091112070455
1491 Ignore-this: d30b668cb3c396fe21e5e4cd9b8be151
1492]
1493[Remove the (very) old strictness analyser
1494simonpj@microsoft.com**20091119154347
1495 Ignore-this: 5d49f66b0baad989ca66c53fde8f2d23
1496 
1497 I finally got tired of the #ifdef OLD_STRICTNESS stuff.  I had been
1498 keeping it around in the hope of doing old-to-new comparisions, but
1499 have failed to do so for many years, so I don't think it's going to
1500 happen.  This patch deletes the clutter.
1501]
1502[Make INLINE warning more precise
1503simonpj@microsoft.com**20091119132711
1504 Ignore-this: f1494494f37c5e618e639912ff82a7f5
1505]
1506[Implement -fexpose-all-unfoldings, and fix a non-termination bug
1507simonpj@microsoft.com**20091119125711
1508 Ignore-this: 54d029014659959151d1681842210cde
1509 
1510 The -fexpose-all-unfoldings flag arranges to put unfoldings for *everything*
1511 in the interface file.  Of course,  this makes the file a lot bigger, but
1512 it also makes it complete, and that's great for supercompilation; or indeed
1513 any whole-program work.
1514 
1515 Consequences:
1516   * Interface files need to record loop-breaker-hood.  (Previously,
1517     loop breakers were never exposed, so that info wasn't necessary.)
1518     Hence a small interface file format change.
1519 
1520   * When inlining, must check loop-breaker-hood. (Previously, loop
1521     breakers didn't have an unfolding at all, so no need to check.)
1522 
1523   * Ditto in exprIsConApp_maybe.  Roman actually tripped this bug,
1524     because a DFun, which had an unfolding, was also a loop breaker
1525 
1526   * TidyPgm.tidyIdInfo must be careful to preserve loop-breaker-hood
1527 
1528 So Id.idUnfolding checks for loop-breaker-hood and returns NoUnfolding
1529 if so. When you want the unfolding regardless of loop-breaker-hood,
1530 use Id.realIdUnfolding.
1531 
1532 I have not documented the flag yet, because it's experimental.  Nor
1533 have I tested it thoroughly.  But with the flag off (the normal case)
1534 everything should work.
1535]
1536[Re-implement the binder-swap stuff in OccurAnal
1537simonpj@microsoft.com**20091119124524
1538 Ignore-this: 662ed559e161be958b1eff1a49d750a3
1539 
1540 This is a pretty big patch, but it has a very local effect.
1541 It affects only the binder-swap mechanism in OccurAnal, which
1542 was not working well becuase it's more subtle than I'd realised
1543 (See Note [getProxies is subtle]).  I think this does a much
1544 better job.
1545]
1546[Try harder not to make DFuns into loop breakers
1547simonpj@microsoft.com**20091119124127
1548 Ignore-this: 922d9a2b3406a3dbbfc5a42d1a286e2a
1549 
1550 See Note [DFuns should not be loop breakers]
1551]
1552[Extend the GHCi FAQ slightly
1553simonpj@microsoft.com**20091117132308
1554 Ignore-this: 8257aaf06ff32904a91121a0734d1c4
1555]
1556[Add gnutar to the list of names we use when looking for GNU tar
1557Ian Lynagh <igloo@earth.li>**20091119144927]
1558[Add support for the man page to the new build system
1559Ian Lynagh <igloo@earth.li>**20091119140811]
1560[Refactor case-merging and identical-alternative optimisations
1561simonpj@microsoft.com**20091119123704
1562 Ignore-this: db12d31395ed99c2341cc4d7d5dca1e
1563 
1564 These two optimisations were originally done by SimplUtils.mkCase
1565 *after* all the pieces have been simplified.  Some while ago I
1566 moved them *before*, so they were done by SimplUtils.prepareAlts.
1567 It think the reason was that I couldn't rely on the dead-binder
1568 information on OutIds, and that info is useful in these optimisations.
1569 
1570 However,
1571  (a) Other changes (notably moving case-binder-swap to OccurAnal)
1572      have meant that dead-binder information is accurate in
1573      OutIds
1574 
1575  (b) When there is a cascade of case-merges, they happen in
1576      one sweep if you do it after, but in many sweeps if you
1577      do it before.  Reason: doing it after means you are looking
1578      at nice simplified Core.
1579]
1580[Fix a nasty infelicity in the size computation of CoreUnfold
1581simonpj@microsoft.com**20091119115736
1582 Ignore-this: ecff5289ab14c0df572135bf0b5179d6
1583 
1584 The size computation was treating gigantic case expressions as
1585 practically free, which they really aren't.  It was exacerbated by
1586 recent decisions to charge 0 for naked variables and constructors, so
1587 the RHS of the case might look free too.  A good example was
1588 Foreign.C.Error.errnoToIOError, which hsa lots of join points
1589 that were getting inlined way to vigorously, so we had:
1590 
1591   *** Simplifier Phase 2 [main]:
1592       Result size = 2983
1593   *** Core Linted result of Simplifier mode 2 [main], iteration 1 out of 4:
1594       Result size = 640327
1595   *** Core Linted result of Simplifier mode 2 [main], iteration 2 out of 4:
1596       Result size = 1659
1597 
1598 Notice that gigantic intermediate!
1599 
1600 This patch adds a small charge for each *alternative*.  Of course,
1601 that'll also mean that there's a bit less inling of things involving
1602 case expressions.
1603]
1604[Comments and white space only
1605simonpj@microsoft.com**20091119115122
1606 Ignore-this: dc8f9a72d6d57378d83154877b1d1126
1607]
1608[Fix splitAppTys
1609Roman Leshchinskiy <rl@cse.unsw.edu.au>**20091119102639
1610 Ignore-this: e669950c7d151c8a67910cd4bbac9cd6
1611]
1612[Windows DLLs: Slurp across the actually static version of libffi
1613Ben.Lippmeier@anu.edu.au**20091119000239]
1614[Windows DLLs: Don't rely on stg/DLL.h being included in RtsAPI.h
1615Ben.Lippmeier@anu.edu.au**20091118110548
1616 Ignore-this: 7dce0ede283974d7834fe12af3f71bd5
1617]
1618[Fix warnings about unused imports
1619Ben.Lippmeier@anu.edu.au**20091118110525
1620 Ignore-this: 93841770eadabf5bd3b9f859ca2de7eb
1621]
1622[Windows DLLs: stifle more warnings about auto imported symbols
1623Ben.Lippmeier@anu.edu.au**20091118090105]
1624[Windows DLLs: stifle warnings about symbols being auto imported from DLLs
1625Ben.Lippmeier@anu.edu.au**20091118051526]
1626[Windows DLLs: add #ifdefery to turn off DLL import of libffi when building statically.
1627Ben.Lippmeier@anu.edu.au**20091118043901]
1628[Windows DLLs: disable extra shutdownHaskell() when unloading the RTS DLL
1629Ben.Lippmeier@anu.edu.au**20091117050648]
1630[Windows DLLs: remove dup symbol from def file
1631Ben.Lippmeier@anu.edu.au**20091117043851]
1632[Use opt_PIC not #defined __PIC__ in compiler source.
1633Ben.Lippmeier@anu.edu.au**20091117043716]
1634[Windows DLLs: CHARLIKE_closure and INTLIKE_closure aren't defined in this way.
1635Ben.Lippmeier@anu.edu.au**20091114063240]
1636[If a comment says "Is this correct?", it's not.
1637Ben.Lippmeier@anu.edu.au**20091114063157]
1638[Windows DLLs: gmp is in the integer-gmp package now.
1639Ben.Lippmeier@anu.edu.au**20091114063046]
1640[Use DLL aware runIO_closure instead of base_GHCziTopHandler_runIO_closure directly
1641Ben.Lippmeier@anu.edu.au**20091114061559]
1642[RTS also uses runSparks_closure from base
1643Ben.Lippmeier@anu.edu.au**20091114061445]
1644[Provide extralibs when linking Windows DLLs
1645Ben.Lippmeier@anu.edu.au**20091114061109]
1646[Don't share low valued Int and Char closures with Windows DLLs
1647Ben.Lippmeier@anu.edu.au**20091114060455]
1648[Windows DLLs: use one import lib for each DLL the RTS needs.
1649Ben.Lippmeier@anu.edu.au**20091111014821]
1650[Add autoconf code to locate dlltool on Windows
1651Ben.Lippmeier@anu.edu.au**20091110051257]
1652[Break recursive imports between the RTS and base library on Windows.
1653Ben.Lippmeier@anu.edu.au**20091106062732
1654 
1655 The file rts/win32/libHSbase.def contains a list of all the
1656 symbols from the base library that the RTS needs.
1657 
1658 When building the RTS into a DLL on Windows, we want to link the DLL
1659 for the RTS before we link the DLL for the base library. We use
1660 libHSbase.def to make the "import library" libHSbase.so.a, which
1661 contains stubs for each of the symbols from the base library that
1662 the RTS needs.
1663]
1664[Add the msysCORE*.tar.gz tarball to the list of tarballs we unpack
1665Ian Lynagh <igloo@earth.li>**20091118195523]
1666[Put the libffi files to be installed into a dist directory
1667Ian Lynagh <igloo@earth.li>**20091118150508
1668 This meakes it easier to correctly clean libffi
1669]
1670[Add ghc-tarballs to the list of directories that go into an sdist
1671Ian Lynagh <igloo@earth.li>**20091118131047]
1672[Remove redundant libffi/tarball directory
1673Ian Lynagh <igloo@earth.li>**20091118124102
1674 We now use the tarball in the ghc-tarballs repo
1675]
1676[Fix gen_contents_index on MSYS
1677Ian Lynagh <igloo@earth.li>**20091117223556
1678 On MSYS
1679     sed 's/.*[ \t]//'
1680 wasn't matching
1681     version:<tab>1.0
1682 so I've switched to
1683     's/.*[[:space:]]//'
1684 which works on Linux, cygwin and MSYS.
1685]
1686[include the GHC package docs in a bindist
1687Simon Marlow <marlowsd@gmail.com>**20091117151133
1688 Ignore-this: c4a10221b1a2a4778494018bca7d2169
1689]
1690[exclude some haddock-related rules during BINDIST
1691Simon Marlow <marlowsd@gmail.com>**20091117151123
1692 Ignore-this: 20b4194b26766d6ab701683af520a7d4
1693]
1694[Add an install-docs target that emits a helpful diagnostic (#3662)
1695Simon Marlow <marlowsd@gmail.com>**20091116120137
1696 Ignore-this: 1c5414730614b205c67919f3ea363c00
1697]
1698[fix install_docs dependencies, and add a missing $(INSTALL_DIR)
1699Simon Marlow <marlowsd@gmail.com>**20091116115630
1700 Ignore-this: 21230df54e79f12f61e9c82a0ae02fad
1701]
1702[Tweak to the directory-building rule
1703Simon Marlow <marlowsd@gmail.com>**20091113125719
1704 Ignore-this: b9e1fe6bcbfd4ff56905517f32b646f7
1705 So we don't try to recreate directories just because they are older
1706 than mkdirhier, since mkdirhier won't touch them.
1707]
1708[exprIsHNF should "look through" lets
1709simonpj@microsoft.com**20091117125526
1710 Ignore-this: 3e77d029c0f314c53171f0378939b496
1711 
1712 I can't quite remember when I spotted this, but exprIsHNF (and
1713 similarly exprIsConLike) should ignore enclosing let-bindings,
1714 since they don't affect termination.
1715]
1716[Improvement to typecheck higher-rank rules better
1717simonpj@microsoft.com**20091117125417
1718 Ignore-this: c5791cbe9540376b9ff46e2a6563bcc2
1719 
1720 See Note [Typechecking rules] in TcRules. 
1721 Suggested by Roman
1722]
1723[Apply RULES to simplified arguments
1724simonpj@microsoft.com**20091117104437
1725 Ignore-this: 9a3475a9871f45ffa115dec44e376e3c
1726 
1727 See Note [RULEs apply to simplified arguments] in Simplify.lhs
1728 A knock-on effect is that rules apply *after* we try inlining
1729 (which uses un-simplified arguments), but that seems fine.
1730]
1731[Improvements to pretty-printing of Core
1732simonpj@microsoft.com**20091117103626
1733 Ignore-this: ad386865644b4dbcd98adab409d7c523
1734]
1735[Fix formatting of module deprecation/warning messages
1736Duncan Coutts <duncan@well-typed.com>**20091115155617
1737 Ignore-this: a41444bdda003aee4412eb56a0e7d052
1738 It was accidentally using list syntax. Fixes #3303 again.
1739]
1740[Wibble to comment
1741simonpj@microsoft.com**20091113145944
1742 Ignore-this: 730f7cad452ac96d59ee2e74a855c19d
1743]
1744[TAG 2009-11-15
1745Ian Lynagh <igloo@earth.li>**20091115155059]
1746Patch bundle hash:
17475957932fc762a36aee3d2f81b787371222260dfe