summaryrefslogtreecommitdiff
path: root/compiler/vectorise/Vectorise/Monad.hs
Commit message (Collapse)AuthorAgeFilesLines
* vectorise: Put it out of its miseryBen Gamari2018-06-021-196/+0
| | | | | | | | | | | | | | | | | | | | | Poor DPH and its vectoriser have long been languishing; sadly it seems there is little chance that the effort will be rekindled. Every few years we discuss what to do with this mass of code and at least once we have agreed that it should be archived on a branch and removed from `master`. Here we do just that, eliminating heaps of dead code in the process. Here we drop the ParallelArrays extension, the vectoriser, and the `vector` and `primitive` submodules. Test Plan: Validate Reviewers: simonpj, simonmar, hvr, goldfire, alanz Reviewed By: simonmar Subscribers: goldfire, rwbarton, thomie, mpickering, carter Differential Revision: https://phabricator.haskell.org/D4761
* compiler: introduce custom "GhcPrelude" PreludeHerbert Valerio Riedel2017-09-191-0/+2
| | | | | | | | | | | | | | | | | | This switches the compiler/ component to get compiled with -XNoImplicitPrelude and a `import GhcPrelude` is inserted in all modules. This is motivated by the upcoming "Prelude" re-export of `Semigroup((<>))` which would cause lots of name clashes in every modulewhich imports also `Outputable` Reviewers: austin, goldfire, bgamari, alanz, simonmar Reviewed By: bgamari Subscribers: goldfire, rwbarton, thomie, mpickering, bgamari Differential Revision: https://phabricator.haskell.org/D3989
* Remove unused importSimon Peyton Jones2017-05-041-1/+0
|
* Desugar: Refactor initDsBen Gamari2017-03-071-8/+5
| | | | | | | | | | | | | | | As far as I can tell we were unnecessarily building a new TcgEnv when we already had one on hand. TcRnMonad now sports an initTcWithGbl function, which allows us to run a TcM monad in the context of this TcgEnv. This appears to simplify things nicely. Test Plan: Validate Reviewers: austin Subscribers: dfeuer, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D3228
* COMPLETE pragmas for enhanced pattern exhaustiveness checkingMatthew Pickering2017-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new pragma so that users can specify `COMPLETE` sets of `ConLike`s in order to sate the pattern match checker. A function which matches on all the patterns in a complete grouping will not cause the exhaustiveness checker to emit warnings. ``` pattern P :: () pattern P = () {-# COMPLETE P #-} foo P = () ``` This example would previously have caused the checker to warn that all cases were not matched even though matching on `P` is sufficient to make `foo` covering. With the addition of the pragma, the compiler will recognise that matching on `P` alone is enough and not emit any warnings. Reviewers: goldfire, gkaracha, alanz, austin, bgamari Reviewed By: alanz Subscribers: lelf, nomeata, gkaracha, thomie Differential Revision: https://phabricator.haskell.org/D2669 GHC Trac Issues: #8779
* Make vectInfoParallelVars a DVarSetBartosz Nitka2016-06-071-1/+1
| | | | | | | | | | | | | | | | We dump it in the interface file, so we need to do it in a deterministic order. I haven't seen any problems with this during my testing, but that's probably because it's unused. Test Plan: ./validate Reviewers: simonmar, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2313 GHC Trac Issues: #4012
* Add kind equalities to GHC.Richard Eisenberg2015-12-111-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the ideas originally put forward in "System FC with Explicit Kind Equality" (ICFP'13). There are several noteworthy changes with this patch: * We now have casts in types. These change the kind of a type. See new constructor `CastTy`. * All types and all constructors can be promoted. This includes GADT constructors. GADT pattern matches take place in type family equations. In Core, types can now be applied to coercions via the `CoercionTy` constructor. * Coercions can now be heterogeneous, relating types of different kinds. A coercion proving `t1 :: k1 ~ t2 :: k2` proves both that `t1` and `t2` are the same and also that `k1` and `k2` are the same. * The `Coercion` type has been significantly enhanced. The documentation in `docs/core-spec/core-spec.pdf` reflects the new reality. * The type of `*` is now `*`. No more `BOX`. * Users can write explicit kind variables in their code, anywhere they can write type variables. For backward compatibility, automatic inference of kind-variable binding is still permitted. * The new extension `TypeInType` turns on the new user-facing features. * Type families and synonyms are now promoted to kinds. This causes trouble with parsing `*`, leading to the somewhat awkward new `HsAppsTy` constructor for `HsType`. This is dispatched with in the renamer, where the kind `*` can be told apart from a type-level multiplication operator. Without `-XTypeInType` the old behavior persists. With `-XTypeInType`, you need to import `Data.Kind` to get `*`, also known as `Type`. * The kind-checking algorithms in TcHsType have been significantly rewritten to allow for enhanced kinds. * The new features are still quite experimental and may be in flux. * TODO: Several open tickets: #11195, #11196, #11197, #11198, #11203. * TODO: Update user manual. Tickets addressed: #9017, #9173, #7961, #10524, #8566, #11142. Updates Haddock submodule.
* Make -ddump-splices output to stdout (fixes #8796)Alexander Vershilov2015-02-051-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Fixes debug output so all info messages will use stdout. Fixes #8796. Make -ddump-splices output to stdout (fixes #8796) Make -dverbose-core2core use stdout (fixes #8796) Reviewers: simonpj, austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D627 GHC Trac Issues: #8796
* Filter instance visibility based on set of visible orphans, fixes #2182.ghc-instvisEdward Z. Yang2014-11-291-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Amazingly, the fix for this very old bug is quite simple: when type-checking, maintain a set of "visible orphan modules" based on the orphans list of modules which we explicitly imported. When we import an instance and it is an orphan, we check if it is in the visible modules set, and if not, ignore it. A little bit of refactoring for when orphan-hood is calculated happens so that we always know if an instance is an orphan or not. For GHCi, we preinitialize the visible modules set based on the list of interactive imports which are active. Future work: Cache the visible orphan modules set for GHCi, rather than recomputing it every type-checking round. (But it's tricky what to do when you /remove/ a module: you need a data structure a little more complicated than just a set of modules.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: new tests and validate Reviewers: simonpj, austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D488 GHC Trac Issues: #2182
* Rename some of the functions in NameSet, to make the uniform with VarSet etcSimon Peyton Jones2014-11-281-1/+1
| | | | | | | | | | | | | For ages NameSet has used different names, eg. addOneToNameSet rather than extendNameSet nameSetToList rather than nameSetElems etc. Other set-like modules use uniform naming conventions. This patch makes NameSet follow suit. No change in behaviour; this is just renaming. I'm doing this just before the fork so that merging is easier.
* Normalise the type when generating do-bind warnings (Trac #8470)Simon Peyton Jones2013-10-231-1/+2
| | | | | This was easy to do, except that the desugar monad needs a FamInstEnv init. Straightforward, routine, albeit a bit clunky.
* Vectoriser: merge fixManuel M T Chakravarty2013-02-061-1/+1
|
* Remove '-favoid-vect' and add '-fvectorisation-avoidance'Manuel M T Chakravarty2013-02-051-1/+2
| | | | | * By default '-fvectorisation-avoidance' is enabled at all optimisation levels (but it only matters in combination with '-fvectorise'). * The new vectoriser always uses vectorisation avoidance, but with '-fno-vectorisation-avoidance' it restricts it to simple scalar applications (and dictionary computations)
* Rewrote vectorisation avoidance (based on the HS paper)Manuel M T Chakravarty2012-12-051-13/+13
| | | | | | | * Vectorisation avoidance is now the default * Types and values from unvectorised modules are permitted in scalar code * Simplified the VECTORISE pragmas (see http://hackage.haskell.org/trac/ghc/wiki/DataParallel/VectPragma for the spec) * Vectorisation information is now included in the annotated Core AST
* Pass DynFlags down to showSDocIan Lynagh2012-06-121-5/+7
|
* Remove more uses of stdout and stderrIan Lynagh2012-05-291-4/+4
|
* Fix vectorisation of classesManuel M T Chakravarty2012-01-161-3/+3
| | | | | | - Make sure that we have no implicit names in ifaces - Any vectorisation info makes a module an orphan module - Allow 'Show' in vectorised code without vectorising it for the moment
* Move vectorisation of (->) & [::] into the libraryManuel M T Chakravarty2011-11-271-2/+0
| | | | | - (->), [::], & PArray are now vectorised via pragmas (and related clean up) - Repeatedly vectorising a variable or type constructor now raises an error
* Fix newtype wrapper for 'PData[s] (Wrap a)' and fix VECTORISE type and ↵Manuel M T Chakravarty2011-11-251-4/+16
| | | | | | | | instance pragmas * Correct usage of new type wrappers from MkId * 'VECTORISE [SCALAR] type T = S' didn't work correctly across module boundaries * Clean up 'VECTORISE SCALAR instance'
* Special case dictionary abstraction and application during vectorisationManuel M T Chakravarty2011-11-171-18/+15
|
* Improve vectorisation warnings and errorsManuel M T Chakravarty2011-11-141-2/+1
|
* New kind-polymorphic coreJose Pedro Magalhaes2011-11-111-1/+1
| | | | | | | | | This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds
* Clean up and complete the vectorisation of type classesManuel M T Chakravarty2011-11-041-5/+5
|
* Vectoriser gets all DPH library identifiers from Data.Array.Parallel.PrimManuel M T Chakravarty2011-10-251-39/+38
| | | | | | * No more use of hardcoded original names * Initialisation of the desugarer monad loads 'Data.Array.Parallel.Prim' if -fdph-* given * Initialisation of the vectoriser gets all built-in names from there
* Fully implement for VECTORISE type pragmas (non-SCALAR).Manuel M T Chakravarty2011-10-101-2/+0
|
* Add support for all top-level declarations to GHCiSimon Marlow2011-09-211-2/+6
| | | | | | | | | | | | | | | | This is work mostly done by Daniel Winograd-Cort during his internship at MSR Cambridge, with some further refactoring by me. This commit adds support to GHCi for most top-level declarations that can be used in Haskell source files. Class, data, newtype, type, instance are all supported, as are Type Family-related declarations. The current set of declarations are shown by :show bindings. As with variable bindings, entities bound by newer declarations shadow earlier ones. Tests are in testsuite/tests/ghci/scripts/ghci039--ghci054. Documentation to follow.
* Report bindings that cannot be vectorisedManuel M T Chakravarty2011-09-101-1/+7
| | | | | | - Toplevel bindings that cannot be vectorised are reported as a warning - '-ddump-vt-trace' has even more information about unvectorised code - Fixed some documentation
* Fixed reading and generating VectInfo as well as naming of vectorised ↵Manuel M T Chakravarty2011-08-241-10/+27
| | | | versions of imported identifiers
* Improve import and export of vectorisation informationManuel M T Chakravarty2011-08-191-4/+2
|
* Eliminate hardcoded names of D.A.PManuel M T Chakravarty2011-06-161-4/+1
|
* Added a pragma {-# NOVECTORISE f #-} that suppresses vectorisation of ↵Manuel M T Chakravarty2011-06-131-1/+2
| | | | toplevel variable 'f'.
* Propagate scalar variables and tycons for vectorisation through ↵Manuel M T Chakravarty2011-06-031-36/+30
| | | | 'HscTypes.VectInfo'.
* Added a VECTORISE pragmaManuel M T Chakravarty2011-02-201-52/+62
| | | | | | | | | | | | | | | - Added a pragma {-# VECTORISE var = exp #-} that prevents the vectoriser from vectorising the definition of 'var'. Instead it uses the binding '$v_var = exp' to vectorise 'var'. The vectoriser checks that the Core type of 'exp' matches the vectorised Core type of 'var'. (It would be quite complicated to perform that check in the type checker as the vectorisation of a type needs the state of the VM monad.) - Added parts of a related VECTORISE SCALAR pragma - Documented -ddump-vect - Added -ddump-vt-trace - Some clean up
* Handling of recursive scalar functions in isScalarLamkeller@cse.unsw.edu.au2011-02-141-1/+7
|
* Added handling of non-recursive module global functions to isScalar checkkeller@cse.unsw.edu.au2011-02-091-1/+9
|
* Refactoring and tidyup of HscMain and related things (also fix #1666)Simon Marlow2010-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to fix #1666 (-Werror aborts too early) I decided to some tidyup in GHC/DriverPipeline/HscMain. - The GhcMonad overloading is gone from DriverPipeline and HscMain now. GhcMonad is now defined in a module of its own, and only used in the top-level GHC layer. DriverPipeline and HscMain use the plain IO monad and take HscEnv as an argument. - WarnLogMonad is gone. printExceptionAndWarnings is now called printException (the old name is deprecated). Session no longer contains warnings. - HscMain has its own little monad that collects warnings, and also plumbs HscEnv around. The idea here is that warnings are collected while we're in HscMain, but on exit from HscMain (any function) we check for warnings and either print them (via log_action, so IDEs can still override the printing), or turn them into an error if -Werror is on. - GhcApiCallbacks is gone, along with GHC.loadWithLogger. Thomas Schilling told me he wasn't using these, and I don't see a good reason to have them. - there's a new pure API to the parser (suggestion from Neil Mitchell): parser :: String -> DynFlags -> FilePath -> Either ErrorMessages (WarningMessages, Located (HsModule RdrName))
* Finish breaking up VectBuiltIn and VectMonad, and add commentsbenl@ouroborus.net2010-08-311-0/+146