summaryrefslogtreecommitdiff
path: root/compiler/vectorise/Vectorise/Exp.hs
Commit message (Collapse)AuthorAgeFilesLines
* Make Applicative a superclass of MonadAustin Seipp2014-09-091-12/+12
| | | | | | | | | | | | | | | | | | | | | Summary: This includes pretty much all the changes needed to make `Applicative` a superclass of `Monad` finally. There's mostly reshuffling in the interests of avoid orphans and boot files, but luckily we can resolve all of them, pretty much. The only catch was that Alternative/MonadPlus also had to go into Prelude to avoid this. As a result, we must update the hsc2hs and haddock submodules. Signed-off-by: Austin Seipp <austin@well-typed.com> Test Plan: Build things, they might not explode horribly. Reviewers: hvr, simonmar Subscribers: simonmar Differential Revision: https://phabricator.haskell.org/D13
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-1/+1
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* DPH: free top-level variables don't prevent encapsulationManuel M T Chakravarty2013-02-191-3/+8
|
* Warning policeManuel M T Chakravarty2013-02-061-3/+0
|
* Merge branch 'refs/heads/vect-avoid' into vect-avoid-mergeManuel M T Chakravarty2013-02-061-556/+681
|\ | | | | | | | | | | | | | | | | Conflicts: compiler/rename/RnSource.lhs compiler/simplCore/OccurAnal.lhs compiler/vectorise/Vectorise/Exp.hs NB: Merging instead of rebasing for a change. During rebase Git got confused due to the lack of the submodules in my quite old fork.
| * Remove '-favoid-vect' and add '-fvectorisation-avoidance'Manuel M T Chakravarty2013-02-051-12/+37
| | | | | | | | | | * 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)
| * Vectoriser: avoid producing (\v -> v) v in liftSimpleManuel M T Chakravarty2013-02-041-8/+12
| |
| * Vectoriser: abstract arguments to scalar functions in the right orderManuel M T Chakravarty2013-02-041-1/+1
| |
| * Vectoriser: binders of encapsulated lambdas need to be scalarManuel M T Chakravarty2013-02-041-3/+9
| |
| * Fix tidying of vectorised codeManuel M T Chakravarty2013-02-041-3/+8
| | | | | | | | | | * We need to keep the vectorised version of a variable alive while the original is alive. * This implies that the vectorised version needs to get into the iface if the original appears in an unfolding.
| * Vectoriser: don't pack free *scalar* variablesManuel M T Chakravarty2012-12-151-83/+114
| |
| * Vectoriser: improve top-level check and vectFnExprManuel M T Chakravarty2012-12-121-3/+8
| |
| * Vectoriser: enable encapsulation of scalar functional expression of ↵Manuel M T Chakravarty2012-12-101-22/+20
| | | | | | | | arbitrary form
| * Vectoriser: distinguish vectorised from parallel types and functionsManuel M T Chakravarty2012-12-091-14/+35
| | | | | | | | - We sometimes need to vectorise types and functions because they might be needed in a vectorised context, not because they do directly introduce parallelism.
| * Vectoriser: fix vectorisation avoidance for case expressionsManuel M T Chakravarty2012-12-051-12/+9
| |
| * Rewrote vectorisation avoidance (based on the HS paper)Manuel M T Chakravarty2012-12-051-509/+539
| | | | | | | | | | | | | | * 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
* | Introduce CPR for sum types (Trac #5075)Simon Peyton Jones2013-01-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main payload of this patch is to extend CPR so that it detects when a function always returns a result constructed with the *same* constructor, even if the constructor comes from a sum type. This doesn't matter very often, but it does improve some things (results below). Binary sizes increase a little bit, I think because there are more wrappers. This with -split-objs. Without split-ojbs binary sizes increased by 6% even for HelloWorld.hs. It's hard to see exactly why, but I think it was because System.Posix.Types.o got included in the linked binary, whereas it didn't before. Program Size Allocs Runtime Elapsed TotalMem fluid +1.8% -0.3% 0.01 0.01 +0.0% tak +2.2% -0.2% 0.02 0.02 +0.0% ansi +1.7% -0.3% 0.00 0.00 +0.0% cacheprof +1.6% -0.3% +0.6% +0.5% +1.4% parstof +1.4% -4.4% 0.00 0.00 +0.0% reptile +2.0% +0.3% 0.02 0.02 +0.0% ---------------------------------------------------------------------- Min +1.1% -4.4% -4.7% -4.7% -15.0% Max +2.3% +0.3% +8.3% +9.4% +50.0% Geometric Mean +1.9% -0.1% +0.6% +0.7% +0.3% Other things in this commit ~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Got rid of the Lattice class in Demand * Refactored the way that products and newtypes are decomposed (no change in functionality)
* | Some alpha renamingIan Lynagh2012-10-161-2/+2
| | | | | | | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* | Move tARGET_* out of HaskellConstantsIan Lynagh2012-09-171-3/+5
|/
* Pass DynFlags down to showSDocIan Lynagh2012-06-121-4/+7
|
* Change how macros like ASSERT are definedIan Lynagh2012-06-051-0/+1
| | | | | By using Haskell's debugIsOn rather than CPP's "#ifdef DEBUG", we don't need to kludge things to keep the warning checker happy etc.
* Fix #6080 & house keeping in Vectorise.ExpManuel M T Chakravarty2012-05-081-462/+335
|
* removed superfluous flag for vectScalarFunGabriele Keller2012-04-251-23/+12
|
* Replaced tabsGabriele Keller2012-04-251-14/+14
|
* Vectorisation AvoidanceGabriele Keller2012-04-241-182/+327
| | | | Switched off by default. Use -favoid-vect to activate
* Partial VectoriasationGabriele Keller2012-04-241-23/+346
|
* Fix scalar vectorisation of superclasses and recursive dfunsManuel M T Chakravarty2011-12-181-3/+23
|
* Be more careful when deciding which functions are scalarManuel M T Chakravarty2011-12-141-10/+23
| | | | Although scalar functions can use any scalar data type, their arguments and functions may only involve primitive types at the moment.
* Fix and clean up 'PData' and 'Wrap' usage of the vectoriserManuel M T Chakravarty2011-11-231-4/+2
|
* Fix the vectorisation of workers of data constructorsManuel M T Chakravarty2011-11-181-1/+2
|
* Special case dictionary abstraction and application during vectorisationManuel M T Chakravarty2011-11-171-92/+228
|
* Fix type of vectorised class data constructors and add dfuns into 'VectInfo'Manuel M T Chakravarty2011-11-141-10/+0
|
* First cut at scalar vectorisation of class instancesManuel M T Chakravarty2011-11-091-12/+120
|
* Overhaul of infrastructure for profiling, coverage (HPC) and breakpointsSimon Marlow2011-11-021-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User visible changes ==================== Profilng -------- Flags renamed (the old ones are still accepted for now): OLD NEW --------- ------------ -auto-all -fprof-auto -auto -fprof-exported -caf-all -fprof-cafs New flags: -fprof-auto Annotates all bindings (not just top-level ones) with SCCs -fprof-top Annotates just top-level bindings with SCCs -fprof-exported Annotates just exported bindings with SCCs -fprof-no-count-entries Do not maintain entry counts when profiling (can make profiled code go faster; useful with heap profiling where entry counts are not used) Cost-centre stacks have a new semantics, which should in most cases result in more useful and intuitive profiles. If you find this not to be the case, please let me know. This is the area where I have been experimenting most, and the current solution is probably not the final version, however it does address all the outstanding bugs and seems to be better than GHC 7.2. Stack traces ------------ +RTS -xc now gives more information. If the exception originates from a CAF (as is common, because GHC tends to lift exceptions out to the top-level), then the RTS walks up the stack and reports the stack in the enclosing update frame(s). Result: +RTS -xc is much more useful now - but you still have to compile for profiling to get it. I've played around a little with adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem quite accurately. I plan to add more facilities for stack tracing (e.g. in GHCi) in the future. Coverage (HPC) -------------- * derived instances are now coloured yellow if they weren't used * likewise record field names * entry counts are more accurate (hpc --fun-entry-count) * tab width is now correct (markup was previously off in source with tabs) Internal changes ================ In Core, the Note constructor has been replaced by Tick (Tickish b) (Expr b) which is used to represent all the kinds of source annotation we support: profiling SCCs, HPC ticks, and GHCi breakpoints. Depending on the properties of the Tickish, different transformations apply to Tick. See CoreUtils.mkTick for details. Tickets ======= This commit closes the following tickets, test cases to follow: - Close #2552: not a bug, but the behaviour is now more intuitive (test is T2552) - Close #680 (test is T680) - Close #1531 (test is result001) - Close #949 (test is T949) - Close #2466: test case has bitrotted (doesn't compile against current version of vector-space package)
* Report bindings that cannot be vectorisedManuel M T Chakravarty2011-09-101-4/+12
| | | | | | - Toplevel bindings that cannot be vectorised are reported as a warning - '-ddump-vt-trace' has even more information about unvectorised code - Fixed some documentation
* Add VECTORISE [SCALAR] type pragmaManuel M T Chakravarty2011-08-191-42/+46
| | | | | | | | | - Pragma to determine how a given type is vectorised - At this stage only the VECTORISE SCALAR variant is used by the vectoriser. - '{-# VECTORISE SCALAR type t #-}' implies that 't' cannot contain parallel arrays and may be used in vectorised code. However, its constructors can only be used in scalar code. We use this, e.g., for 'Int'. - May be used on imported types See also http://hackage.haskell.org/trac/ghc/wiki/DataParallel/VectPragma
* Change loop breaker terminologySimon Peyton Jones2011-07-211-2/+2
| | | | | | | We used to have "loop breaker" and "non-rule loop breaker", but the unqualified version in particualr was pretty confusing. So now we have "strong loop breaker" and "weak loop breaker"; comments in BasicTypes and OccurAnal.
* Special case 'patError' in the vectoriserManuel M T Chakravarty2011-06-191-1/+13
|
* This BIG PATCH contains most of the work for the New Coercion RepresentationSimon Peyton Jones2011-04-191-1/+2
| | | | | | | | | | | | | | See the paper "Practical aspects of evidence based compilation in System FC" * Coercion becomes a data type, distinct from Type * Coercions become value-level things, rather than type-level things, (although the value is zero bits wide, like the State token) A consequence is that a coerion abstraction increases the arity by 1 (just like a dictionary abstraction) * There is a new constructor in CoreExpr, namely Coercion, to inject coercions into terms
* Completed the implementation of VECTORISE SCALARManuel M T Chakravarty2011-03-051-109/+125
| | | | | | | | | - The pragma {-# VECTORISE SCALAR foo #-} marks 'foo' as a scalar function for for vectorisation and generates a vectorised version by applying 'scalar_map' and friends. - The set of scalar functions is not yet emitted into interface files. This will be added in a subsequent patch via 'VectInfo'.
* Added a VECTORISE pragmaManuel M T Chakravarty2011-02-201-17/+12
| | | | | | | | | | | | | | | - 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
* Cleaned up Expr and Vectorisekeller@.cse.unsw.edu.au2011-02-151-23/+10
|
* Fixed two syntax errorskeller@.cse.unsw.edu.au2011-02-141-2/+2
|
* Handling of recursive scalar functions in isScalarLamkeller@cse.unsw.edu.au2011-02-141-18/+25
|
* Added handling of non-recursive module global functions to isScalar checkkeller@cse.unsw.edu.au2011-02-091-20/+26
|
* keller@cse.unsw.edu.au2011-02-021-2/+2
|
* Removed minor bugkeller@cse.unsw.edu.au2011-02-021-1/+1
|
* added handling of data constructors to vectLamkeller@cse.unsw.edu.au2011-02-011-17/+48
|
* Fixed some 'unused vars' warningskeller@cse.unsw.edu.au2010-11-301-5/+5
|
* vectScalarLam handles int, float, and double nowkeller@cse.unsw.edu.au2010-11-291-2/+6
|