summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* Per-thread allocation counters and limitsSimon Marlow2014-05-022-75/+202
| | | | | | | | | | | | | | | | | | | | | | | This tracks the amount of memory allocation by each thread in a counter stored in the TSO. Optionally, when the counter drops below zero (it counts down), the thread can be sent an asynchronous exception: AllocationLimitExceeded. When this happens, given a small additional limit so that it can handle the exception. See documentation in GHC.Conc for more details. Allocation limits are similar to timeouts, but - timeouts use real time, not CPU time. Allocation limits do not count anything while the thread is blocked or in foreign code. - timeouts don't re-trigger if the thread catches the exception, allocation limits do. - timeouts can catch non-allocating loops, if you use -fno-omit-yields. This doesn't work for allocation limits. I couldn't measure any impact on benchmarks with these changes, even for nofib/smp.
* Don't inline non-register GlobalRegsSimon Marlow2014-04-291-12/+100
|
* Add Note [Role twiddling functions] to Coercion.Richard Eisenberg2014-04-292-54/+100
| | | | | This commit also makes better names for several of these functions, and removes one that went unused.
* Typo in commentsGabor Greif2014-04-291-1/+1
|
* Improve implementation of unSubCo_maybe.Richard Eisenberg2014-04-281-5/+15
| | | | | | | | | | | | | | | | This is the result of an email conversation (off list) with Conal Elliott, who needed a stronger unSubCo_maybe. This commit adds cases to upgrade the role of a coercion when recursion is necessary to do say (for example, for a use of TransCo). As a side effect, more coercion optimizations are now possible. This was not done previously because unSubCo_maybe was used only during coercion optimization, and the recursive cases looked to be unlikely. However, adding them can cause no harm. unSubCo_maybe is now also exported from Coercion, for use cases like Conal's.
* Print for-alls more often (Trac #9018)Simon Peyton Jones2014-04-283-18/+36
| | | | | | | | We now display the foralls of a type if any of the type variables is polykinded. This put kind polymorphism "in your face" a bit more often, but eliminates a lot of head scratching. The user manual reflects the new behaviour.
* Fix annotation reification for home package modulesGergely Risko2014-04-281-6/+7
| | | | | | | | | | | | The reifyAnnotation method of the Q monad correctly gathered annotations from TCG and EPS. Unfortunately it didn't look into the Home Package Table. This resulted in annotations not being found if they are in the same package as the splice that is reifying and ghc --make is used for compilation management. Fix this by using the already existing prepareAnnotations method from HscTypes.lhs that correctly searches in HPT and EPS both. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Do type-class defaulting even if there are insoluble constraintsSimon Peyton Jones2014-04-281-4/+30
| | | | | | | | | | | | | | The argument in Trac #9033 is very compelling: we should not report 20 errors, fix one, and have the other 19 disappear. They were spurious in the first place. The fix was easy; do type-class defaulting uncondionally, rather than only if there are no insoluble constraints. See Note [When to do type-class defaulting] in TcSimplify. Error messages generally improve, especially tc211 which actually had an example of precisely this phenomenon.
* Some typos in commentsGabor Greif2014-04-242-2/+2
|
* Don't eta-expand PAPs (fixes Trac #9020)Simon Peyton Jones2014-04-242-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See Note [Do not eta-expand PAPs] in SimplUtils. This has a tremendously good effect on compile times for some simple benchmarks. The test is now where it belongs, in perf/compiler/T9020 (instead of simpl015). I did a nofib run and got essentially zero change except for cacheprof which gets 4% more allocation. I investigated. Turns out that we have instance PP Reg where pp ppm ST_0 = "%st" pp ppm ST_1 = "%st(1)" pp ppm ST_2 = "%st(2)" pp ppm ST_3 = "%st(3)" pp ppm ST_4 = "%st(4)" pp ppm ST_5 = "%st(5)" pp ppm ST_6 = "%st(6)" pp ppm ST_7 = "%st(7)" pp ppm r = "%" ++ map toLower (show r) That (map toLower (show r) does a lot of map/toLowers. But if we inline show we get something like pp ppm ST_0 = "%st" pp ppm ST_1 = "%st(1)" pp ppm ST_2 = "%st(2)" pp ppm ST_3 = "%st(3)" pp ppm ST_4 = "%st(4)" pp ppm ST_5 = "%st(5)" pp ppm ST_6 = "%st(6)" pp ppm ST_7 = "%st(7)" pp ppm EAX = map toLower (show EAX) pp ppm EBX = map toLower (show EBX) ...etc... and all those map/toLower calls can now be floated to top level. This gives a 4% decrease in allocation. But it depends on inlining a pretty big 'show' function. With this new patch we get slightly better eta-expansion, which makes a function look slightly bigger, which just stops it being inlined. The previous behaviour was luck, so I'm not going to worry about losing it. I've added some notes to nofib/Simon-nofib-notes
* Be less verbose when printing Names when we don't know what's in scopeSimon Peyton Jones2014-04-242-14/+13
| | | | | | | | Previously we always printed qualified names, but that makes a lot of debug or warning output very verbose. So now we only print qualified names with -dppr-debug. Civilised output (from pukka error messages, with the environment available) is unaffected
* ghc: initial AArch64 patchesColin Watson2014-04-216-0/+13
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* ghc & docs: kill unused flagsAustin Seipp2014-04-211-10/+0
| | | | | | | | | | | | This removes the following, now defunct flags, which will not be recognized by GHC 7.10: -fwarn-lazy-unlifted-bindings -pgmm and -optm (used for the Mangler, long dead) -keep-raw-s-file & -keep-raw-s-files -monly[432]-reg-only Signed-off-by: Austin Seipp <austin@well-typed.com>
* Kill whitespace after cpp's `-I` flagHerbert Valerio Riedel2014-04-211-1/+1
| | | | | | This clean-up is in a similiar spirit as 574ef4293b8676. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* ghc: Do not add a space in '-U __PIC__'Austin Seipp2014-04-211-4/+4
| | | | | | | | | | | | | | | | GHC previously introduced a space here. However, this can in some cases be interpreted as "-U __PIC__" - note that in shell, the -U would still be recognized with an argument, but the argument would be " __PIC__", with a space in front, as opposed to the single string '__PIC__'. In practice most tools seem to handle this OK. But the Coverity Scan analysis tool does not: it errors on the fact that ' __PIC__' is an invalid CPP name to undefine. With this, it seems the Coverity analysis tool can easily analyze the entire GHC build. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Deprecate the AMP warnings.Austin Seipp2014-04-202-216/+3
| | | | | | | | Now that we're in development mode, Applicative will soon be a superclass of Monad in HEAD. So let's go ahead and deprecate the -fno-warn-amp flag, remove the checks, and tweak a few tests Signed-off-by: Austin Seipp <austin@well-typed.com>
* Normalize GHC Trac URLsHerbert Valerio Riedel2014-04-191-1/+1
| | | | | | | | | | | | | | Update several old http://hackage.haskell.org/trac/ghc URLs references to the current http://ghc.haskell.org/trac/ghc URLs. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Validate inferred theta. Fixes #8883Jan Stolarek2014-04-195-0/+9
| | | | | | | This checks that all the required extensions are enabled for the inferred type signature. Updates binary and vector submodules.
* Take account of the AvailTC invariant when importingSimon Peyton Jones2014-04-181-32/+48
| | | | | | In the rather gnarly filterImports code, someone had forgotten the AvailTC invariant: in AvailTC n [n,s1,s2], the 'n' is itself included in the list of names.
* Make qReport force its error message before printing itSimon Peyton Jones2014-04-171-2/+10
| | | | | | Fixes Trac #8987. See Note [Exceptions in TH] Thanks to Yuras Shumovich for doing this.
* Honour the untouchability of kind variablesSimon Peyton Jones2014-04-142-63/+88
| | | | | | | | | | | | | | | | Trac #8985 showed up a major shortcoming in the kind unifier: it was ignoring untoucability. This has unpredictably-bad consequences; notably, the skolem-escape check can fail. There were two things wrong * TcRnMonad.isTouchableTcM was returning a constant value for kind variables (wrong), and even worse the constant was back-to-front (it was always False). * We weren't even calling isTouchableTcM in TcType.unifyKindX. I'm not sure how this ever worked. Merge to 7.8.3 in due course.
* A bit more trace information in an ASSERT failureSimon Peyton Jones2014-04-141-10/+10
|
* Tidy up trace messageSimon Peyton Jones2014-04-141-1/+1
|
* Better layout for coercion error messageSimon Peyton Jones2014-04-142-8/+9
|
* Typos in commentsGabor Greif2014-04-132-2/+2
|
* Instead of tracking Origin in LHsBindsLR, track it in MatchGroupDr. ERDI Gergo2014-04-1328-199/+185
|
* Remove unused variable binding to fix validateDr. ERDI Gergo2014-04-121-2/+2
|
* Fix #8641, creating directories when we have stubs.Edward Z. Yang2014-04-101-0/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Split off pattern synonym definition checking from pattern inversionDr. ERDI Gergo2014-04-101-42/+68
|
* Fix egregious blunder in the type flattenerSimon Peyton Jones2014-04-101-5/+20
| | | | | | | | | | | In tidying up the flattener I introduced an error that no regression test caught, giving rise to Trac #8978, #8979. It shows up if you have a type synonym whose RHS mentions type functions, such sas type family F a type T a = (F a, a) -- This synonym isn't properly flattened The fix is easy, but sadly the bug is in the released GHC 7.8.1
* Improve error reporting for untouchable type variablesSimon Peyton Jones2014-04-081-23/+54
| | | | | | | | | | | This change adds a suggestion Possible fix: add a type signature for ‘f’ when we have a GADT-style definition with a type we can't figure out. See Note [Suggest adding a type signature] in TcErrors. This initially came up in the discussion of Trac #8968.
* Refactor in worker/wrapper generationSimon Peyton Jones2014-04-081-39/+31
| | | | | | | I don't think there should be any change in behaviour, but the code is clearer now. Function checkSize is elimiated in favour of doing those checks before (rather than after) splitFun/splitThunk.
* Allow a longer demand signature than aritySimon Peyton Jones2014-04-083-15/+25
| | | | | | | | | | See Note [Demand analysis for trivial right-hand sides] in DmdAnal. This allows a function with arity 2 to have a DmdSig with 3 args; which in turn had a knock-on effect, which showed up in the test for Trac #8963. In fact it seems entirely reasonable, so this patch removes the WARN and CoreLint checks that were complaining.
* Don't preprocess .s filesSimon Marlow2014-04-082-22/+26
| | | | | | | | | One important reason is that gcc 4.8.1 sometimes crashes: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60436 Another reason is that preprocessing assembly files unnecessarily slows down compilation.
* Add comments & notes explaining the typing of pattern synonym definitionsDr. ERDI Gergo2014-04-081-6/+94
|
* Zonk the existential type variables in tcPatSynDeclSimon Peyton Jones2014-04-081-15/+15
| | | | This was just an omission, which showed up as Trac #8966
* Improve tracing slightlySimon Peyton Jones2014-04-081-2/+3
|
* Derive Typable for promoted data constructors (Trac #8950)Simon Peyton Jones2014-04-071-125/+132
| | | | | | | | | I got sucked into a significant refactoring of the way that Typeable instances are derived. This makes it simpler and more uniform. I also improved the documentation in the user manual. Typeable really is different to other classes, and now gets its own subsection.
* Small issue with signatures in a TH splice (fixes Trac #8932)Simon Peyton Jones2014-04-071-2/+10
|
* Require PatternSynonyms language flag when encountering a use of pattern synonymDr. ERDI Gergo2014-04-061-5/+3
| | | | (#8961)
* Fix #8958.Richard Eisenberg2014-04-052-2/+5
| | | | | We now do role inference on stupid datatype contexts, allowing a lightweight role annotation syntax.
* windows: Fix #8870Austin Seipp2014-04-041-2/+43
| | | | | | | | | | This bumps the amount of default reserved and committed stack for GHC executables to 8mb, to work around #8870. A proper fix should happen in 7.8.2 See note [Windows stack usage] in SysTools for the details. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Revert "Revert ad15c2, which causes Windows seg-faults (Trac #8834)"Austin Seipp2014-04-041-21/+64
| | | | This reverts commit a79613a75c7da0d3d225850382f0f578a07113b5.
* Simplify and tidy up the handling of tuple namesSimon Peyton Jones2014-04-045-135/+150
| | | | | | | | | | | | | This fixes Trac #8954. There were actually three places where tuple occ-names were parsed: - IfaceEnv.lookupOrigNameCache - Convert.isBuiltInOcc - OccName.isTupleOcc_maybe I combined all three into TysWiredIn.isBuiltInOcc_maybe Much nicer.
* With AutoDeriveTypeable, derive for promoted constructors, too.Richard Eisenberg2014-04-041-34/+38
| | | | | | This addresses #8950. However, the problem isn't completely solved, because the Prelude types' Typeable instances are not created by AutoDeriveTypeable.
* Parse the variables in a type signature in the order given (Trac #8945)Simon Peyton Jones2014-04-031-2/+2
| | | | | | | | | | This is just making the parser behave more sensibly, and return the list [x,y,z] from the signature x,y,z :: Int rathe than [x,z,y] as now. Turns out that the other use of sig_vars *did* do the right thing already.
* Fix desguaring of bang patterns (Trac #8952)Simon Peyton Jones2014-04-031-5/+5
| | | | A palpable bug, although one that will rarely bite
* Make sure that polykinded Typeable is defaultable (Trac #8931)Simon Peyton Jones2014-04-031-4/+10
|
* Add inline versions of copy ops for small arraysJohan Tibell2014-03-301-0/+63
| | | | | If the number of elements being copied is known statically this might lead to the copy loop being unrolled in the backend.
* Add SmallArray# and SmallMutableArray# typesJohan Tibell2014-03-2913-58/+383
| | | | | | | | | | | | | | | These array types are smaller than Array# and MutableArray# and are faster when the array size is small, as they don't have the overhead of a card table. Having no card table reduces the closure size with 2 words in the typical small array case and leads to less work when updating or GC:ing the array. Reduces both the runtime and memory allocation by 8.8% on my insert benchmark for the HashMap type in the unordered-containers package, which makes use of lots of small arrays. With tuned GC settings (i.e. `+RTS -A6M`) the runtime reduction is 15%. Fixes #8923.