summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/backpack/RnModIface.hs1
-rw-r--r--compiler/basicTypes/MkId.hs34
-rw-r--r--compiler/basicTypes/Module.hs11
-rw-r--r--compiler/basicTypes/Name.hs13
-rw-r--r--compiler/basicTypes/OccName.hs31
-rw-r--r--compiler/basicTypes/Unique.hs6
-rw-r--r--compiler/coreSyn/CoreFVs.hs12
-rw-r--r--compiler/coreSyn/CoreLint.hs1
-rw-r--r--compiler/coreSyn/CoreOpt.hs23
-rw-r--r--compiler/coreSyn/CoreSyn.hs21
-rw-r--r--compiler/coreSyn/PprCore.hs18
-rw-r--r--compiler/deSugar/Check.hs5
-rw-r--r--compiler/deSugar/Coverage.hs8
-rw-r--r--compiler/deSugar/Desugar.hs42
-rw-r--r--compiler/deSugar/DsArrows.hs1
-rw-r--r--compiler/deSugar/DsExpr.hs27
-rw-r--r--compiler/deSugar/DsListComp.hs210
-rw-r--r--compiler/deSugar/DsMeta.hs11
-rw-r--r--compiler/deSugar/DsMonad.hs166
-rw-r--r--compiler/deSugar/DsUtils.hs78
-rw-r--r--compiler/deSugar/Match.hs9
-rw-r--r--compiler/deSugar/MatchCon.hs6
-rw-r--r--compiler/deSugar/PmExpr.hs12
-rw-r--r--compiler/ghc.cabal.in30
-rw-r--r--compiler/hsSyn/HsDecls.hs153
-rw-r--r--compiler/hsSyn/HsExpr.hs56
-rw-r--r--compiler/hsSyn/HsExtension.hs39
-rw-r--r--compiler/hsSyn/HsInstances.hs10
-rw-r--r--compiler/hsSyn/HsPat.hs13
-rw-r--r--compiler/hsSyn/HsTypes.hs10
-rw-r--r--compiler/hsSyn/HsUtils.hs2
-rw-r--r--compiler/iface/IfaceType.hs1
-rw-r--r--compiler/iface/LoadIface.hs24
-rw-r--r--compiler/iface/MkIface.hs25
-rw-r--r--compiler/iface/TcIface.hs139
-rw-r--r--compiler/iface/TcIface.hs-boot4
-rw-r--r--compiler/main/DynFlags.hs30
-rw-r--r--compiler/main/HscTypes.hs148
-rw-r--r--compiler/main/Packages.hs9
-rw-r--r--compiler/main/TidyPgm.hs58
-rw-r--r--compiler/parser/Lexer.x23
-rw-r--r--compiler/parser/Parser.y68
-rw-r--r--compiler/parser/RdrHsSyn.hs5
-rw-r--r--compiler/prelude/PrelNames.hs11
-rw-r--r--compiler/prelude/TysWiredIn.hs89
-rw-r--r--compiler/rename/RnExpr.hs33
-rw-r--r--compiler/rename/RnPat.hs4
-rw-r--r--compiler/rename/RnSource.hs66
-rw-r--r--compiler/rename/RnTypes.hs9
-rw-r--r--compiler/rename/RnUtils.hs3
-rw-r--r--compiler/simplCore/CoreMonad.hs2
-rw-r--r--compiler/simplCore/OccurAnal.hs12
-rw-r--r--compiler/simplCore/SimplCore.hs64
-rw-r--r--compiler/specialise/SpecConstr.hs2
-rw-r--r--compiler/typecheck/FamInst.hs1
-rw-r--r--compiler/typecheck/TcBinds.hs76
-rw-r--r--compiler/typecheck/TcExpr.hs38
-rw-r--r--compiler/typecheck/TcHsSyn.hs47
-rw-r--r--compiler/typecheck/TcHsType.hs41
-rw-r--r--compiler/typecheck/TcMatches.hs15
-rw-r--r--compiler/typecheck/TcPat.hs8
-rw-r--r--compiler/typecheck/TcPatSyn.hs3
-rw-r--r--compiler/typecheck/TcRnDriver.hs17
-rw-r--r--compiler/typecheck/TcRnMonad.hs1
-rw-r--r--compiler/typecheck/TcRnTypes.hs31
-rw-r--r--compiler/typecheck/TcUnify.hs8
-rw-r--r--compiler/utils/Outputable.hs5
-rw-r--r--compiler/vectorise/Vectorise.hs358
-rw-r--r--compiler/vectorise/Vectorise/Builtins.hs35
-rw-r--r--compiler/vectorise/Vectorise/Builtins/Base.hs219
-rw-r--r--compiler/vectorise/Vectorise/Builtins/Initialise.hs234
-rw-r--r--compiler/vectorise/Vectorise/Convert.hs104
-rw-r--r--compiler/vectorise/Vectorise/Env.hs240
-rw-r--r--compiler/vectorise/Vectorise/Exp.hs1260
-rw-r--r--compiler/vectorise/Vectorise/Generic/Description.hs294
-rw-r--r--compiler/vectorise/Vectorise/Generic/PADict.hs128
-rw-r--r--compiler/vectorise/Vectorise/Generic/PAMethods.hs586
-rw-r--r--compiler/vectorise/Vectorise/Generic/PData.hs178
-rw-r--r--compiler/vectorise/Vectorise/Monad.hs196
-rw-r--r--compiler/vectorise/Vectorise/Monad/Base.hs245
-rw-r--r--compiler/vectorise/Vectorise/Monad/Global.hs239
-rw-r--r--compiler/vectorise/Vectorise/Monad/InstEnv.hs82
-rw-r--r--compiler/vectorise/Vectorise/Monad/Local.hs102
-rw-r--r--compiler/vectorise/Vectorise/Monad/Naming.hs132
-rw-r--r--compiler/vectorise/Vectorise/Type/Classify.hs131
-rw-r--r--compiler/vectorise/Vectorise/Type/Env.hs457
-rw-r--r--compiler/vectorise/Vectorise/Type/TyConDecl.hs223
-rw-r--r--compiler/vectorise/Vectorise/Type/Type.hs87
-rw-r--r--compiler/vectorise/Vectorise/Utils.hs167
-rw-r--r--compiler/vectorise/Vectorise/Utils/Base.hs261
-rw-r--r--compiler/vectorise/Vectorise/Utils/Closure.hs163
-rw-r--r--compiler/vectorise/Vectorise/Utils/Hoisting.hs98
-rw-r--r--compiler/vectorise/Vectorise/Utils/PADict.hs232
-rw-r--r--compiler/vectorise/Vectorise/Utils/Poly.hs74
-rw-r--r--compiler/vectorise/Vectorise/Var.hs103
-rw-r--r--compiler/vectorise/Vectorise/Vect.hs128
-rw-r--r--docs/ndp/haskell.sty496
-rw-r--r--docs/ndp/vect.tex363
-rw-r--r--docs/users_guide/debugging.rst13
-rw-r--r--docs/users_guide/extending_ghc.rst2
-rw-r--r--docs/users_guide/glasgow_exts.rst1
-rw-r--r--docs/users_guide/parallel.rst10
-rw-r--r--docs/users_guide/using-optimisation.rst52
-rw-r--r--ghc.mk21
-rw-r--r--libraries/base/GHC/PArr.hs37
-rw-r--r--libraries/base/base.cabal1
m---------libraries/dph0
m---------libraries/primitive0
m---------libraries/vector0
-rw-r--r--packages6
-rw-r--r--testsuite/tests/dph/Makefile3
-rw-r--r--testsuite/tests/dph/classes/DefsVect.hs53
-rw-r--r--testsuite/tests/dph/classes/Main.hs15
-rw-r--r--testsuite/tests/dph/classes/Makefile3
-rw-r--r--testsuite/tests/dph/classes/dph-classes-copy-fast.stdout1
-rw-r--r--testsuite/tests/dph/classes/dph-classes-vseg-fast.stdout1
-rw-r--r--testsuite/tests/dph/classes/dph-classes.T6
-rw-r--r--testsuite/tests/dph/diophantine/DiophantineVect.hs39
-rw-r--r--testsuite/tests/dph/diophantine/Main.hs42
-rw-r--r--testsuite/tests/dph/diophantine/Makefile3
-rw-r--r--testsuite/tests/dph/diophantine/dph-diophantine-copy-fast.stdout3
-rw-r--r--testsuite/tests/dph/diophantine/dph-diophantine-copy-opt.stdout3
-rw-r--r--testsuite/tests/dph/diophantine/dph-diophantine.T11
-rw-r--r--testsuite/tests/dph/dotp/DotPVect.hs15
-rw-r--r--testsuite/tests/dph/dotp/Main.hs54
-rw-r--r--testsuite/tests/dph/dotp/Makefile3
-rw-r--r--testsuite/tests/dph/dotp/dph-dotp-copy-fast.stdout2
-rw-r--r--testsuite/tests/dph/dotp/dph-dotp-copy-opt.stdout2
-rw-r--r--testsuite/tests/dph/dotp/dph-dotp-vseg-fast.stdout2
-rw-r--r--testsuite/tests/dph/dotp/dph-dotp-vseg-opt.stdout2
-rw-r--r--testsuite/tests/dph/dotp/dph-dotp.T20
-rw-r--r--testsuite/tests/dph/enumfromto/EnumFromToP.hs24
-rw-r--r--testsuite/tests/dph/enumfromto/Makefile3
-rw-r--r--testsuite/tests/dph/enumfromto/dph-enumfromto.T4
-rw-r--r--testsuite/tests/dph/modules/ExportList.hs33
-rw-r--r--testsuite/tests/dph/modules/Makefile3
-rw-r--r--testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr9
-rw-r--r--testsuite/tests/dph/modules/dph-modules.T4
-rw-r--r--testsuite/tests/dph/nbody/Body.hs85
-rw-r--r--testsuite/tests/dph/nbody/Config.hs50
-rw-r--r--testsuite/tests/dph/nbody/Dump.hs46
-rw-r--r--testsuite/tests/dph/nbody/Generate.hs98
-rw-r--r--testsuite/tests/dph/nbody/Main.hs103
-rw-r--r--testsuite/tests/dph/nbody/Makefile3
-rw-r--r--testsuite/tests/dph/nbody/Randomish.hs82
-rw-r--r--testsuite/tests/dph/nbody/Solver.hs156
-rw-r--r--testsuite/tests/dph/nbody/Types.hs52
-rw-r--r--testsuite/tests/dph/nbody/Util.hs18
-rw-r--r--testsuite/tests/dph/nbody/World.hs47
-rw-r--r--testsuite/tests/dph/nbody/dph-nbody-copy-fast.stdout100
-rw-r--r--testsuite/tests/dph/nbody/dph-nbody-copy-opt.stdout100
-rw-r--r--testsuite/tests/dph/nbody/dph-nbody-vseg-fast.stdout100
-rw-r--r--testsuite/tests/dph/nbody/dph-nbody-vseg-opt.stdout100
-rw-r--r--testsuite/tests/dph/nbody/dph-nbody.T19
-rw-r--r--testsuite/tests/dph/primespj/Main.hs30
-rw-r--r--testsuite/tests/dph/primespj/Makefile3
-rw-r--r--testsuite/tests/dph/primespj/PrimesVect.hs25
-rw-r--r--testsuite/tests/dph/primespj/dph-primespj-copy-fast.stdout3
-rw-r--r--testsuite/tests/dph/primespj/dph-primespj-copy-opt.stdout3
-rw-r--r--testsuite/tests/dph/primespj/dph-primespj-vseg-fast.stdout3
-rw-r--r--testsuite/tests/dph/primespj/dph-primespj-vseg-opt.stdout3
-rw-r--r--testsuite/tests/dph/primespj/dph-primespj.T11
-rw-r--r--testsuite/tests/dph/quickhull/Main.hs43
-rw-r--r--testsuite/tests/dph/quickhull/Makefile3
-rw-r--r--testsuite/tests/dph/quickhull/QuickHullVect.hs41
-rw-r--r--testsuite/tests/dph/quickhull/SVG.hs34
-rw-r--r--testsuite/tests/dph/quickhull/TestData.hs92
-rw-r--r--testsuite/tests/dph/quickhull/Types.hs33
-rw-r--r--testsuite/tests/dph/quickhull/dph-quickhull-copy-fast.stdout1019
-rw-r--r--testsuite/tests/dph/quickhull/dph-quickhull-copy-opt.stdout1019
-rw-r--r--testsuite/tests/dph/quickhull/dph-quickhull-vseg-fast.stdout1019
-rw-r--r--testsuite/tests/dph/quickhull/dph-quickhull-vseg-opt.stdout1019
-rw-r--r--testsuite/tests/dph/quickhull/dph-quickhull.T20
-rw-r--r--testsuite/tests/dph/smvm/Main.hs60
-rw-r--r--testsuite/tests/dph/smvm/Makefile3
-rw-r--r--testsuite/tests/dph/smvm/SMVMVect.hs17
-rw-r--r--testsuite/tests/dph/smvm/dph-smvm-copy.stdout1
-rw-r--r--testsuite/tests/dph/smvm/dph-smvm-vseg.stdout1
-rw-r--r--testsuite/tests/dph/smvm/dph-smvm.T41
-rw-r--r--testsuite/tests/dph/smvm/result-i386.txt101
-rw-r--r--testsuite/tests/dph/smvm/result-sparc.txt101
-rw-r--r--testsuite/tests/dph/smvm/result-x86_64.txt101
-rw-r--r--testsuite/tests/dph/smvm/test-i386.datbin22384 -> 0 bytes
-rw-r--r--testsuite/tests/dph/smvm/test-sparc.datbin11632 -> 0 bytes
-rw-r--r--testsuite/tests/dph/smvm/test-x86_64.datbin16416 -> 0 bytes
-rw-r--r--testsuite/tests/dph/sumnats/Main.hs21
-rw-r--r--testsuite/tests/dph/sumnats/Makefile3
-rw-r--r--testsuite/tests/dph/sumnats/SumNatsVect.hs14
-rw-r--r--testsuite/tests/dph/sumnats/dph-sumnats-copy.stdout3
-rw-r--r--testsuite/tests/dph/sumnats/dph-sumnats-vseg.stdout3
-rw-r--r--testsuite/tests/dph/sumnats/dph-sumnats.T20
-rw-r--r--testsuite/tests/dph/words/Main.hs37
-rw-r--r--testsuite/tests/dph/words/Makefile3
-rw-r--r--testsuite/tests/dph/words/WordsVect.hs125
-rw-r--r--testsuite/tests/dph/words/dph-words-copy-fast.stdout3
-rw-r--r--testsuite/tests/dph/words/dph-words-copy-opt.stdout3
-rw-r--r--testsuite/tests/dph/words/dph-words-vseg-fast.stdout3
-rw-r--r--testsuite/tests/dph/words/dph-words-vseg-opt.stdout3
-rw-r--r--testsuite/tests/dph/words/dph-words.T20
-rw-r--r--testsuite/tests/ghc-api/T9015.hs1
-rw-r--r--testsuite/tests/ghc-api/T9015.stdout4
-rw-r--r--testsuite/tests/ghci/should_run/T7253.script1
-rw-r--r--testsuite/tests/ghci/should_run/T7253.stderr2
-rw-r--r--testsuite/tests/parser/should_compile/DumpRenamedAst.stderr1
-rw-r--r--testsuite/tests/parser/should_compile/T14189.stderr1
-rw-r--r--utils/ghctags/Main.hs1
m---------utils/haddock0
-rwxr-xr-xvalidate6
208 files changed, 97 insertions, 16489 deletions
diff --git a/compiler/backpack/RnModIface.hs b/compiler/backpack/RnModIface.hs
index afdd89e92f..f807b39ce8 100644
--- a/compiler/backpack/RnModIface.hs
+++ b/compiler/backpack/RnModIface.hs
@@ -108,7 +108,6 @@ rnModIface hsc_env insts nsubst iface = do
deps <- rnDependencies (mi_deps iface)
-- TODO:
-- mi_rules
- -- mi_vect_info (LOW PRIORITY)
return iface { mi_module = mod
, mi_sig_of = sig_of
, mi_insts = insts
diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index 7e555200e6..f68a28d510 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -20,9 +20,7 @@ module MkId (
mkPrimOpId, mkFCallId,
wrapNewTypeBody, unwrapNewTypeBody,
- wrapFamInstBody, unwrapFamInstScrut,
- wrapTypeUnbranchedFamInstBody, unwrapTypeUnbranchedFamInstScrut,
-
+ wrapFamInstBody,
DataConBoxer(..), mkDataConRep, mkDataConWorkId,
-- And some particular Ids; see below for why they are wired in
@@ -54,7 +52,6 @@ import CoreUtils ( exprType, mkCast )
import CoreUnfold
import Literal
import TyCon
-import CoAxiom
import Class
import NameSet
import Name
@@ -1047,35 +1044,6 @@ wrapFamInstBody tycon args body
| otherwise
= body
--- Same as `wrapFamInstBody`, but for type family instances, which are
--- represented by a `CoAxiom`, and not a `TyCon`
-wrapTypeFamInstBody :: CoAxiom br -> Int -> [Type] -> [Coercion]
- -> CoreExpr -> CoreExpr
-wrapTypeFamInstBody axiom ind args cos body
- = mkCast body (mkSymCo (mkAxInstCo Representational axiom ind args cos))
-
-wrapTypeUnbranchedFamInstBody :: CoAxiom Unbranched -> [Type] -> [Coercion]
- -> CoreExpr -> CoreExpr
-wrapTypeUnbranchedFamInstBody axiom
- = wrapTypeFamInstBody axiom 0
-
-unwrapFamInstScrut :: TyCon -> [Type] -> CoreExpr -> CoreExpr
-unwrapFamInstScrut tycon args scrut
- | Just co_con <- tyConFamilyCoercion_maybe tycon
- = mkCast scrut (mkUnbranchedAxInstCo Representational co_con args []) -- data instances only
- | otherwise
- = scrut
-
-unwrapTypeFamInstScrut :: CoAxiom br -> Int -> [Type] -> [Coercion]
- -> CoreExpr -> CoreExpr
-unwrapTypeFamInstScrut axiom ind args cos scrut
- = mkCast scrut (mkAxInstCo Representational axiom ind args cos)
-
-unwrapTypeUnbranchedFamInstScrut :: CoAxiom Unbranched -> [Type] -> [Coercion]
- -> CoreExpr -> CoreExpr
-unwrapTypeUnbranchedFamInstScrut axiom
- = unwrapTypeFamInstScrut axiom 0
-
{-
************************************************************************
* *
diff --git a/compiler/basicTypes/Module.hs b/compiler/basicTypes/Module.hs
index e4dc1a8446..1851496af1 100644
--- a/compiler/basicTypes/Module.hs
+++ b/compiler/basicTypes/Module.hs
@@ -78,8 +78,6 @@ module Module
baseUnitId,
rtsUnitId,
thUnitId,
- dphSeqUnitId,
- dphParUnitId,
mainUnitId,
thisGhcUnitId,
isHoleModule,
@@ -1067,8 +1065,7 @@ parseModSubst = Parse.between (Parse.char '[') (Parse.char ']')
integerUnitId, primUnitId,
baseUnitId, rtsUnitId,
- thUnitId, dphSeqUnitId, dphParUnitId,
- mainUnitId, thisGhcUnitId, interactiveUnitId :: UnitId
+ thUnitId, mainUnitId, thisGhcUnitId, interactiveUnitId :: UnitId
primUnitId = fsToUnitId (fsLit "ghc-prim")
integerUnitId = fsToUnitId (fsLit n)
where
@@ -1078,8 +1075,6 @@ integerUnitId = fsToUnitId (fsLit n)
baseUnitId = fsToUnitId (fsLit "base")
rtsUnitId = fsToUnitId (fsLit "rts")
thUnitId = fsToUnitId (fsLit "template-haskell")
-dphSeqUnitId = fsToUnitId (fsLit "dph-seq")
-dphParUnitId = fsToUnitId (fsLit "dph-par")
thisGhcUnitId = fsToUnitId (fsLit "ghc")
interactiveUnitId = fsToUnitId (fsLit "interactive")
@@ -1127,9 +1122,7 @@ wiredInUnitIds = [ primUnitId,
baseUnitId,
rtsUnitId,
thUnitId,
- thisGhcUnitId,
- dphSeqUnitId,
- dphParUnitId ]
+ thisGhcUnitId ]
{-
************************************************************************
diff --git a/compiler/basicTypes/Name.hs b/compiler/basicTypes/Name.hs
index c005c03487..4e11276b6f 100644
--- a/compiler/basicTypes/Name.hs
+++ b/compiler/basicTypes/Name.hs
@@ -51,7 +51,6 @@ module Name (
setNameLoc,
tidyNameOcc,
localiseName,
- mkLocalisedOccName,
nameSrcLoc, nameSrcSpan, pprNameDefnLoc, pprDefinedAt,
@@ -414,18 +413,6 @@ tidyNameOcc name occ = name { n_occ = occ }
localiseName :: Name -> Name
localiseName n = n { n_sort = Internal }
--- |Create a localised variant of a name.
---
--- If the name is external, encode the original's module name to disambiguate.
--- SPJ says: this looks like a rather odd-looking function; but it seems to
--- be used only during vectorisation, so I'm not going to worry
-mkLocalisedOccName :: Module -> (Maybe String -> OccName -> OccName) -> Name -> OccName
-mkLocalisedOccName this_mod mk_occ name = mk_occ origin (nameOccName name)
- where
- origin
- | nameIsLocalOrFrom this_mod name = Nothing
- | otherwise = Just (moduleNameColons . moduleName . nameModule $ name)
-
{-
************************************************************************
* *
diff --git a/compiler/basicTypes/OccName.hs b/compiler/basicTypes/OccName.hs
index f6a66fd635..1af53fb3dc 100644
--- a/compiler/basicTypes/OccName.hs
+++ b/compiler/basicTypes/OccName.hs
@@ -67,11 +67,6 @@ module OccName (
mkSuperDictSelOcc, mkSuperDictAuxOcc,
mkLocalOcc, mkMethodOcc, mkInstTyTcOcc,
mkInstTyCoOcc, mkEqPredCoOcc,
- mkVectOcc, mkVectTyConOcc, mkVectDataConOcc, mkVectIsoOcc,
- mkPDataTyConOcc, mkPDataDataConOcc,
- mkPDatasTyConOcc, mkPDatasDataConOcc,
- mkPReprTyConOcc,
- mkPADFunOcc,
mkRecFldSelOcc,
mkTyConRepOcc,
@@ -655,23 +650,6 @@ mkTyConRepOcc occ = mk_simple_deriv varName prefix occ
mkGenR = mk_simple_deriv tcName "Rep_"
mkGen1R = mk_simple_deriv tcName "Rep1_"
--- Vectorisation
-mkVectOcc, mkVectTyConOcc, mkVectDataConOcc, mkVectIsoOcc,
- mkPADFunOcc, mkPReprTyConOcc,
- mkPDataTyConOcc, mkPDataDataConOcc,
- mkPDatasTyConOcc, mkPDatasDataConOcc
- :: Maybe String -> OccName -> OccName
-mkVectOcc = mk_simple_deriv_with varName "$v"
-mkVectTyConOcc = mk_simple_deriv_with tcName "V:"
-mkVectDataConOcc = mk_simple_deriv_with dataName "VD:"
-mkVectIsoOcc = mk_simple_deriv_with varName "$vi"
-mkPADFunOcc = mk_simple_deriv_with varName "$pa"
-mkPReprTyConOcc = mk_simple_deriv_with tcName "VR:"
-mkPDataTyConOcc = mk_simple_deriv_with tcName "VP:"
-mkPDatasTyConOcc = mk_simple_deriv_with tcName "VPs:"
-mkPDataDataConOcc = mk_simple_deriv_with dataName "VPD:"
-mkPDatasDataConOcc = mk_simple_deriv_with dataName "VPDs:"
-
-- Overloaded record field selectors
mkRecFldSelOcc :: String -> OccName
mkRecFldSelOcc s = mk_deriv varName "$sel" [fsLit s]
@@ -679,15 +657,6 @@ mkRecFldSelOcc s = mk_deriv varName "$sel" [fsLit s]
mk_simple_deriv :: NameSpace -> FastString -> OccName -> OccName
mk_simple_deriv sp px occ = mk_deriv sp px [occNameFS occ]
-mk_simple_deriv_with :: NameSpace -- ^ the namespace
- -> FastString -- ^ an identifying prefix
- -> Maybe String -- ^ another optional prefix
- -> OccName -- ^ the 'OccName' to derive from
- -> OccName
-mk_simple_deriv_with sp px Nothing occ = mk_deriv sp px [occNameFS occ]
-mk_simple_deriv_with sp px (Just with) occ =
- mk_deriv sp px [fsLit with, fsLit "_", occNameFS occ]
-
-- Data constructor workers are made by setting the name space
-- of the data constructor OccName (which should be a DataName)
-- to VarName
diff --git a/compiler/basicTypes/Unique.hs b/compiler/basicTypes/Unique.hs
index bd7ed3eb48..f0c98144dd 100644
--- a/compiler/basicTypes/Unique.hs
+++ b/compiler/basicTypes/Unique.hs
@@ -49,7 +49,7 @@ module Unique (
mkPrimOpIdUnique,
mkPreludeMiscIdUnique, mkPreludeDataConUnique,
mkPreludeTyConUnique, mkPreludeClassUnique,
- mkPArrDataConUnique, mkCoVarUnique,
+ mkCoVarUnique,
mkVarOccUnique, mkDataOccUnique, mkTvOccUnique, mkTcOccUnique,
mkRegSingleUnique, mkRegPairUnique, mkRegClassUnique, mkRegSubUnique,
@@ -369,7 +369,6 @@ mkPreludeTyConUnique :: Int -> Unique
mkPreludeDataConUnique :: Arity -> Unique
mkPrimOpIdUnique :: Int -> Unique
mkPreludeMiscIdUnique :: Int -> Unique
-mkPArrDataConUnique :: Int -> Unique
mkCoVarUnique :: Int -> Unique
mkAlphaTyVarUnique i = mkUnique '1' i
@@ -409,9 +408,6 @@ dataConRepNameUnique u = stepUnique u 2
mkPrimOpIdUnique op = mkUnique '9' op
mkPreludeMiscIdUnique i = mkUnique '0' i
--- No numbers left anymore, so I pick something different for the character tag
-mkPArrDataConUnique a = mkUnique ':' (2*a)
-
-- The "tyvar uniques" print specially nicely: a, b, c, etc.
-- See pprUnique for details
diff --git a/compiler/coreSyn/CoreFVs.hs b/compiler/coreSyn/CoreFVs.hs
index 4a7251659b..a7a96e2fcd 100644
--- a/compiler/coreSyn/CoreFVs.hs
+++ b/compiler/coreSyn/CoreFVs.hs
@@ -37,7 +37,6 @@ module CoreFVs (
ruleRhsFreeVars, ruleFreeVars, rulesFreeVars,
rulesFreeVarsDSet,
ruleLhsFreeIds, ruleLhsFreeIdsList,
- vectsFreeVars,
expr_fvs,
@@ -515,17 +514,6 @@ put this 'f' in a Rec block, but will mark the binding as a non-rule loop
breaker, which is perfectly inlinable.
-}
--- |Free variables of a vectorisation declaration
-vectsFreeVars :: [CoreVect] -> VarSet
-vectsFreeVars = mapUnionVarSet vectFreeVars
- where
- vectFreeVars (Vect _ rhs) = fvVarSet $ filterFV isLocalId $ expr_fvs rhs
- vectFreeVars (NoVect _) = noFVs
- vectFreeVars (VectType _ _ _) = noFVs
- vectFreeVars (VectClass _) = noFVs
- vectFreeVars (VectInst _) = noFVs
- -- this function is only concerned with values, not types
-
{-
************************************************************************
* *
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index e5db499127..d92082c7e4 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -274,7 +274,6 @@ coreDumpFlag CoreDoWorkerWrapper = Just Opt_D_dump_worker_wrapper
coreDumpFlag CoreDoSpecialising = Just Opt_D_dump_spec
coreDumpFlag CoreDoSpecConstr = Just Opt_D_dump_spec
coreDumpFlag CoreCSE = Just Opt_D_dump_cse
-coreDumpFlag CoreDoVectorisation = Just Opt_D_dump_vect
coreDumpFlag CoreDesugar = Just Opt_D_dump_ds_preopt
coreDumpFlag CoreDesugarOpt = Just Opt_D_dump_ds
coreDumpFlag CoreTidy = Just Opt_D_dump_simpl
diff --git a/compiler/coreSyn/CoreOpt.hs b/compiler/coreSyn/CoreOpt.hs
index 73bb427614..de0dd04656 100644
--- a/compiler/coreSyn/CoreOpt.hs
+++ b/compiler/coreSyn/CoreOpt.hs
@@ -127,25 +127,24 @@ simpleOptExprWith subst expr
----------------------
simpleOptPgm :: DynFlags -> Module
- -> CoreProgram -> [CoreRule] -> [CoreVect]
- -> IO (CoreProgram, [CoreRule], [CoreVect])
+ -> CoreProgram -> [CoreRule]
+ -> IO (CoreProgram, [CoreRule])
-- See Note [The simple optimiser]
-simpleOptPgm dflags this_mod binds rules vects
+simpleOptPgm dflags this_mod binds rules
= do { dumpIfSet_dyn dflags Opt_D_dump_occur_anal "Occurrence analysis"
(pprCoreBindings occ_anald_binds $$ pprRules rules );
- ; return (reverse binds', rules', vects') }
+ ; return (reverse binds', rules') }
where
occ_anald_binds = occurAnalysePgm this_mod
(\_ -> True) {- All unfoldings active -}
(\_ -> False) {- No rules active -}
- rules vects emptyVarSet binds
+ rules binds
(final_env, binds') = foldl do_one (emptyEnv, []) occ_anald_binds
final_subst = soe_subst final_env
rules' = substRulesForImportedIds final_subst rules
- vects' = substVects final_subst vects
-- We never unconditionally inline into rules,
-- hence paying just a substitution
@@ -536,18 +535,6 @@ wrapLet :: Maybe (Id,CoreExpr) -> CoreExpr -> CoreExpr
wrapLet Nothing body = body
wrapLet (Just (b,r)) body = Let (NonRec b r) body
-------------------
-substVects :: Subst -> [CoreVect] -> [CoreVect]
-substVects subst = map (substVect subst)
-
-------------------
-substVect :: Subst -> CoreVect -> CoreVect
-substVect subst (Vect v rhs) = Vect v (simpleOptExprWith subst rhs)
-substVect _subst vd@(NoVect _) = vd
-substVect _subst vd@(VectType _ _ _) = vd
-substVect _subst vd@(VectClass _) = vd
-substVect _subst vd@(VectInst _) = vd
-
{-
Note [Inline prag in simplOpt]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/compiler/coreSyn/CoreSyn.hs b/compiler/coreSyn/CoreSyn.hs
index 729825fd98..c2aeabefe6 100644
--- a/compiler/coreSyn/CoreSyn.hs
+++ b/compiler/coreSyn/CoreSyn.hs
@@ -92,9 +92,6 @@ module CoreSyn (
ruleArity, ruleName, ruleIdName, ruleActivation,
setRuleIdName, ruleModule,
isBuiltinRule, isLocalRule, isAutoRule,
-
- -- * Core vectorisation declarations data type
- CoreVect(..)
) where
#include "HsVersions.h"
@@ -112,7 +109,6 @@ import NameEnv( NameEnv, emptyNameEnv )
import Literal
import DataCon
import Module
-import TyCon
import BasicTypes
import DynFlags
import Outputable
@@ -1305,23 +1301,6 @@ setRuleIdName nm ru = ru { ru_fn = nm }
{-
************************************************************************
* *
-\subsection{Vectorisation declarations}
-* *
-************************************************************************
-
-Representation of desugared vectorisation declarations that are fed to the vectoriser (via
-'ModGuts').
--}
-
-data CoreVect = Vect Id CoreExpr
- | NoVect Id
- | VectType Bool TyCon (Maybe TyCon)
- | VectClass TyCon -- class tycon
- | VectInst Id -- instance dfun (always SCALAR) !!!FIXME: should be superfluous now
-
-{-
-************************************************************************
-* *
Unfoldings
* *
************************************************************************
diff --git a/compiler/coreSyn/PprCore.hs b/compiler/coreSyn/PprCore.hs
index ca2b8af560..f22d803cb1 100644
--- a/compiler/coreSyn/PprCore.hs
+++ b/compiler/coreSyn/PprCore.hs
@@ -612,21 +612,3 @@ instance Outputable id => Outputable (Tickish id) where
ppr (SourceNote span _) =
hcat [ text "src<", pprUserRealSpan True span, char '>']
-{-
------------------------------------------------------
--- Vectorisation declarations
------------------------------------------------------
--}
-
-instance Outputable CoreVect where
- ppr (Vect var e) = hang (text "VECTORISE" <+> ppr var <+> char '=')
- 4 (pprCoreExpr e)
- ppr (NoVect var) = text "NOVECTORISE" <+> ppr var
- ppr (VectType False var Nothing) = text "VECTORISE type" <+> ppr var
- ppr (VectType True var Nothing) = text "VECTORISE SCALAR type" <+> ppr var
- ppr (VectType False var (Just tc)) = text "VECTORISE type" <+> ppr var <+> char '=' <+>
- ppr tc
- ppr (VectType True var (Just tc)) = text "VECTORISE SCALAR type" <+> ppr var <+>
- char '=' <+> ppr tc
- ppr (VectClass tc) = text "VECTORISE class" <+> ppr tc
- ppr (VectInst var) = text "VECTORISE SCALAR instance" <+> ppr var
diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs
index 39f585394a..d5449f373a 100644
--- a/compiler/deSugar/Check.hs
+++ b/compiler/deSugar/Check.hs
@@ -841,11 +841,6 @@ translatePat fam_insts pat = case pat of
(map (LitPat noExt . HsChar src) (unpackFS s))
| otherwise -> return [mkLitPattern lit]
- PArrPat ty ps -> do
- tidy_ps <- translatePatVec fam_insts (map unLoc ps)
- let fake_con = RealDataCon (parrFakeCon (length ps))
- return [vanillaConPattern fake_con [ty] (concat tidy_ps)]
-
TuplePat tys ps boxity -> do
tidy_ps <- translatePatVec fam_insts (map unLoc ps)
let tuple_con = RealDataCon (tupleDataCon boxity (length ps))
diff --git a/compiler/deSugar/Coverage.hs b/compiler/deSugar/Coverage.hs
index 25b77f2cfe..ac02989572 100644
--- a/compiler/deSugar/Coverage.hs
+++ b/compiler/deSugar/Coverage.hs
@@ -562,10 +562,6 @@ addTickHsExpr (ExplicitList ty wit es) =
addTickWit (Just fln)
= do fln' <- addTickSyntaxExpr hpcSrcSpan fln
return (Just fln')
-addTickHsExpr (ExplicitPArr ty es) =
- liftM2 ExplicitPArr
- (return ty)
- (mapM (addTickLHsExpr) es)
addTickHsExpr (HsStatic fvs e) = HsStatic fvs <$> addTickLHsExpr e
@@ -602,10 +598,6 @@ addTickHsExpr (HsTickPragma _ _ _ _ (L pos e0)) = do
e2 <- allocTickBox (ExpBox False) False False pos $
addTickHsExpr e0
return $ unLoc e2
-addTickHsExpr (PArrSeq ty arith_seq) =
- liftM2 PArrSeq
- (return ty)
- (addTickArithSeqInfo arith_seq)
addTickHsExpr (HsSCC x src nm e) =
liftM3 (HsSCC x)
(return src)
diff --git a/compiler/deSugar/Desugar.hs b/compiler/deSugar/Desugar.hs
index ce12a5631a..2f3fead184 100644
--- a/compiler/deSugar/Desugar.hs
+++ b/compiler/deSugar/Desugar.hs
@@ -28,8 +28,6 @@ import TcRnDriver ( runTcInteractive )
import Id
import Name
import Type
-import InstEnv
-import Class
import Avail
import CoreSyn
import CoreFVs ( exprsSomeFreeVarsList )
@@ -104,7 +102,6 @@ deSugar hsc_env
tcg_th_foreign_files = th_foreign_files_var,
tcg_fords = fords,
tcg_rules = rules,
- tcg_vects = vects,
tcg_patsyns = patsyns,
tcg_tcs = tcs,
tcg_insts = insts,
@@ -134,18 +131,17 @@ deSugar hsc_env
; (spec_prs, spec_rules) <- dsImpSpecs imp_specs
; (ds_fords, foreign_prs) <- dsForeigns fords
; ds_rules <- mapMaybeM dsRule rules
- ; ds_vects <- mapM dsVect vects
; let hpc_init
| gopt Opt_Hpc dflags = hpcInitCode mod ds_hpc_info
| otherwise = empty
; return ( ds_ev_binds
, foreign_prs `appOL` core_prs `appOL` spec_prs
- , spec_rules ++ ds_rules, ds_vects
+ , spec_rules ++ ds_rules
, ds_fords `appendStubC` hpc_init) }
; case mb_res of {
Nothing -> return (msgs, Nothing) ;
- Just (ds_ev_binds, all_prs, all_rules, vects0, ds_fords) ->
+ Just (ds_ev_binds, all_prs, all_rules, ds_fords) ->
do { -- Add export flags to bindings
keep_alive <- readIORef keep_var
@@ -162,8 +158,8 @@ deSugar hsc_env
-- things into the in-scope set before simplifying; so we get no unfolding for F#!
; endPassIO hsc_env print_unqual CoreDesugar final_pgm rules_for_imps
- ; (ds_binds, ds_rules_for_imps, ds_vects)
- <- simpleOptPgm dflags mod final_pgm rules_for_imps vects0
+ ; (ds_binds, ds_rules_for_imps)
+ <- simpleOptPgm dflags mod final_pgm rules_for_imps
-- The simpleOptPgm gets rid of type
-- bindings plus any stupid dead code
@@ -211,8 +207,6 @@ deSugar hsc_env
mg_foreign_files = foreign_files,
mg_hpc_info = ds_hpc_info,
mg_modBreaks = modBreaks,
- mg_vect_decls = ds_vects,
- mg_vect_info = noVectInfo,
mg_safe_haskell = safe_mode,
mg_trust_pkg = imp_trust_own_pkg imports,
mg_complete_sigs = complete_matches
@@ -548,32 +542,4 @@ and similar, which will elicit exactly these warnings, and risk never
firing. But it's not clear what to do instead. We could make the
class method rules inactive in phase 2, but that would delay when
subsequent transformations could fire.
-
-
-************************************************************************
-* *
-* Desugaring vectorisation declarations
-* *
-************************************************************************
-}
-
-dsVect :: LVectDecl GhcTc -> DsM CoreVect
-dsVect (L loc (HsVect _ _ (L _ v) rhs))
- = putSrcSpanDs loc $
- do { rhs' <- dsLExpr rhs
- ; return $ Vect v rhs'
- }
-dsVect (L _loc (HsNoVect _ _ (L _ v)))
- = return $ NoVect v
-dsVect (L _loc (HsVectType (VectTypeTc tycon rhs_tycon) isScalar))
- = return $ VectType isScalar tycon' rhs_tycon
- where
- tycon' | Just ty <- coreView $ mkTyConTy tycon
- , (tycon', []) <- splitTyConApp ty = tycon'
- | otherwise = tycon
-dsVect (L _loc (HsVectClass cls))
- = return $ VectClass (classTyCon cls)
-dsVect (L _loc (HsVectInst inst))
- = return $ VectInst (instanceDFunId inst)
-dsVect vd@(L _ (XVectDecl {}))
- = pprPanic "Desugar.dsVect: unexpected 'XVectDecl'" (ppr vd)
diff --git a/compiler/deSugar/DsArrows.hs b/compiler/deSugar/DsArrows.hs
index 5e355f03f9..c69d7495d9 100644
--- a/compiler/deSugar/DsArrows.hs
+++ b/compiler/deSugar/DsArrows.hs
@@ -1213,7 +1213,6 @@ collectl (L _ pat) bndrs
go (ParPat _ pat) = collectl pat bndrs
go (ListPat _ pats) = foldr collectl bndrs pats
- go (PArrPat _ pats) = foldr collectl bndrs pats
go (TuplePat _ pats _) = foldr collectl bndrs pats
go (SumPat _ pat _ _) = collectl pat bndrs
diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs
index 7ee1857dfe..b6337e4d45 100644
--- a/compiler/deSugar/DsExpr.hs
+++ b/compiler/deSugar/DsExpr.hs
@@ -423,7 +423,6 @@ ds_expr _ (HsLet _ binds body) = do
-- because the interpretation of `stmts' depends on what sort of thing it is.
--
ds_expr _ (HsDo res_ty ListComp (L _ stmts)) = dsListComp stmts res_ty
-ds_expr _ (HsDo _ PArrComp (L _ stmts)) = dsPArrComp (map unLoc stmts)
ds_expr _ (HsDo _ DoExpr (L _ stmts)) = dsDo stmts
ds_expr _ (HsDo _ GhciStmtCtxt (L _ stmts)) = dsDo stmts
ds_expr _ (HsDo _ MDoExpr (L _ stmts)) = dsDo stmts
@@ -460,38 +459,12 @@ ds_expr _ (HsMultiIf res_ty alts)
ds_expr _ (ExplicitList elt_ty wit xs)
= dsExplicitList elt_ty wit xs
--- We desugar [:x1, ..., xn:] as
--- singletonP x1 +:+ ... +:+ singletonP xn
---
-ds_expr _ (ExplicitPArr ty []) = do
- emptyP <- dsDPHBuiltin emptyPVar
- return (Var emptyP `App` Type ty)
-ds_expr _ (ExplicitPArr ty xs) = do
- singletonP <- dsDPHBuiltin singletonPVar
- appP <- dsDPHBuiltin appPVar
- xs' <- mapM dsLExprNoLP xs
- let unary fn x = mkApps (Var fn) [Type ty, x]
- binary fn x y = mkApps (Var fn) [Type ty, x, y]
-
- return . foldr1 (binary appP) $ map (unary singletonP) xs'
-
ds_expr _ (ArithSeq expr witness seq)
= case witness of
Nothing -> dsArithSeq expr seq
Just fl -> do { newArithSeq <- dsArithSeq expr seq
; dsSyntaxExpr fl [newArithSeq] }
-ds_expr _ (PArrSeq expr (FromTo from to))
- = mkApps <$> dsExpr expr <*> mapM dsLExprNoLP [from, to]
-
-ds_expr _ (PArrSeq expr (FromThenTo from thn to))
- = mkApps <$> dsExpr expr <*> mapM dsLExprNoLP [from, thn, to]
-
-ds_expr _ (PArrSeq _ _)
- = panic "DsExpr.dsExpr: Infinite parallel array!"
- -- the parser shouldn't have generated it and the renamer and typechecker
- -- shouldn't have let it through
-
{-
Static Pointers
~~~~~~~~~~~~~~~
diff --git a/compiler/deSugar/DsListComp.hs b/compiler/deSugar/DsListComp.hs
index 8c9fa72e03..29b3cf42ab 100644
--- a/compiler/deSugar/DsListComp.hs
+++ b/compiler/deSugar/DsListComp.hs
@@ -9,7 +9,7 @@ Desugaring list comprehensions, monad comprehensions and array comprehensions
{-# LANGUAGE CPP, NamedFieldPuns #-}
{-# LANGUAGE TypeFamilies #-}
-module DsListComp ( dsListComp, dsPArrComp, dsMonadComp ) where
+module DsListComp ( dsListComp, dsMonadComp ) where
#include "HsVersions.h"
@@ -476,214 +476,6 @@ mkUnzipBind _ elt_tys
mkConcatExpression (list_element_ty, head, tail) = mkConsExpr list_element_ty head tail
-{-
-************************************************************************
-* *
-\subsection[DsPArrComp]{Desugaring of array comprehensions}
-* *
-************************************************************************
--}
-
--- entry point for desugaring a parallel array comprehension
---
--- [:e | qss:] = <<[:e | qss:]>> () [:():]
---
-dsPArrComp :: [ExprStmt GhcTc]
- -> DsM CoreExpr
-
--- Special case for parallel comprehension
-dsPArrComp (ParStmt _ qss _ _ : quals) = dePArrParComp qss quals
-
--- Special case for simple generators:
---
--- <<[:e' | p <- e, qs:]>> = <<[: e' | qs :]>> p e
---
--- if matching again p cannot fail, or else
---
--- <<[:e' | p <- e, qs:]>> =
--- <<[:e' | qs:]>> p (filterP (\x -> case x of {p -> True; _ -> False}) e)
---
-dsPArrComp (BindStmt _ p e _ _ : qs) = do
- filterP <- dsDPHBuiltin filterPVar
- ce <- dsLExprNoLP e
- let ety'ce = parrElemType ce
- false = Var falseDataConId
- true = Var trueDataConId
- v <- newSysLocalDs ety'ce
- pred <- matchSimply (Var v) (StmtCtxt PArrComp) p true false
- let gen | isIrrefutableHsPat p = ce
- | otherwise = mkApps (Var filterP) [Type ety'ce, mkLams [v] pred, ce]
- dePArrComp qs p gen
-
-dsPArrComp qs = do -- no ParStmt in `qs'
- sglP <- dsDPHBuiltin singletonPVar
- let unitArray = mkApps (Var sglP) [Type unitTy, mkCoreTup []]
- dePArrComp qs (noLoc $ WildPat unitTy) unitArray
-
-
-
--- the work horse
---
-dePArrComp :: [ExprStmt GhcTc]
- -> LPat GhcTc -- the current generator pattern
- -> CoreExpr -- the current generator expression
- -> DsM CoreExpr
-
-dePArrComp [] _ _ = panic "dePArrComp"
-
---
--- <<[:e' | :]>> pa ea = mapP (\pa -> e') ea
---
-dePArrComp (LastStmt _ e' _ _ : quals) pa cea
- = ASSERT( null quals )
- do { mapP <- dsDPHBuiltin mapPVar
- ; let ty = parrElemType cea
- ; (clam, ty'e') <- deLambda ty pa e'
- ; return $ mkApps (Var mapP) [Type ty, Type ty'e', clam, cea] }
---
--- <<[:e' | b, qs:]>> pa ea = <<[:e' | qs:]>> pa (filterP (\pa -> b) ea)
---
-dePArrComp (BodyStmt _ b _ _ : qs) pa cea = do
- filterP <- dsDPHBuiltin filterPVar
- let ty = parrElemType cea
- (clam,_) <- deLambda ty pa b
- dePArrComp qs pa (mkApps (Var filterP) [Type ty, clam, cea])
-
---
--- <<[:e' | p <- e, qs:]>> pa ea =
--- let ef = \pa -> e
--- in
--- <<[:e' | qs:]>> (pa, p) (crossMap ea ef)
---
--- if matching again p cannot fail, or else
---
--- <<[:e' | p <- e, qs:]>> pa ea =
--- let ef = \pa -> filterP (\x -> case x of {p -> True; _ -> False}) e
--- in
--- <<[:e' | qs:]>> (pa, p) (crossMapP ea ef)
---
-dePArrComp (BindStmt _ p e _ _ : qs) pa cea = do
- filterP <- dsDPHBuiltin filterPVar
- crossMapP <- dsDPHBuiltin crossMapPVar
- ce <- dsLExpr e
- let ety'cea = parrElemType cea
- ety'ce = parrElemType ce
- false = Var falseDataConId
- true = Var trueDataConId
- v <- newSysLocalDs ety'ce
- pred <- matchSimply (Var v) (StmtCtxt PArrComp) p true false
- let cef | isIrrefutableHsPat p = ce
- | otherwise = mkApps (Var filterP) [Type ety'ce, mkLams [v] pred, ce]
- (clam, _) <- mkLambda ety'cea pa cef
- let ety'cef = ety'ce -- filter doesn't change the element type
- pa' = mkLHsPatTup [pa, p]
-
- dePArrComp qs pa' (mkApps (Var crossMapP)
- [Type ety'cea, Type ety'cef, cea, clam])
---
--- <<[:e' | let ds, qs:]>> pa ea =
--- <<[:e' | qs:]>> (pa, (x_1, ..., x_n))
--- (mapP (\v@pa -> let ds in (v, (x_1, ..., x_n))) ea)
--- where
--- {x_1, ..., x_n} = DV (ds) -- Defined Variables
---
-dePArrComp (LetStmt _ lds@(L _ ds) : qs) pa cea = do
- mapP <- dsDPHBuiltin mapPVar
- let xs = collectLocalBinders ds
- ty'cea = parrElemType cea
- v <- newSysLocalDs ty'cea
- clet <- dsLocalBinds lds (mkCoreTup (map Var xs))
- let'v <- newSysLocalDs (exprType clet)
- let projBody = mkCoreLet (NonRec let'v clet) $
- mkCoreTup [Var v, Var let'v]
- errTy = exprType projBody
- errMsg = text "DsListComp.dePArrComp: internal error!"
- cerr <- mkErrorAppDs pAT_ERROR_ID errTy errMsg
- ccase <- matchSimply (Var v) (StmtCtxt PArrComp) pa projBody cerr
- let pa' = mkLHsPatTup [pa, mkLHsPatTup (map nlVarPat xs)]
- proj = mkLams [v] ccase
- dePArrComp qs pa' (mkApps (Var mapP)
- [Type ty'cea, Type errTy, proj, cea])
---
--- The parser guarantees that parallel comprehensions can only appear as
--- singleton qualifier lists, which we already special case in the caller.
--- So, encountering one here is a bug.
---
-dePArrComp (ParStmt {} : _) _ _ =
- panic "DsListComp.dePArrComp: malformed comprehension AST: ParStmt"
-dePArrComp (TransStmt {} : _) _ _ = panic "DsListComp.dePArrComp: TransStmt"
-dePArrComp (RecStmt {} : _) _ _ = panic "DsListComp.dePArrComp: RecStmt"
-dePArrComp (ApplicativeStmt {} : _) _ _ =
- panic "DsListComp.dePArrComp: ApplicativeStmt"
-dePArrComp (XStmtLR {} : _) _ _ =
- panic "DsListComp.dePArrComp: XStmtLR"
-
--- <<[:e' | qs | qss:]>> pa ea =
--- <<[:e' | qss:]>> (pa, (x_1, ..., x_n))
--- (zipP ea <<[:(x_1, ..., x_n) | qs:]>>)
--- where
--- {x_1, ..., x_n} = DV (qs)
---
-dePArrParComp :: [ParStmtBlock GhcTc GhcTc] -> [ExprStmt GhcTc] -> DsM CoreExpr
-dePArrParComp qss quals = do
- (pQss, ceQss) <- deParStmt qss
- dePArrComp quals pQss ceQss
- where
- deParStmt [] =
- -- empty parallel statement lists have no source representation
- panic "DsListComp.dePArrComp: Empty parallel list comprehension"
- deParStmt (ParStmtBlock _ qs xs _:qss) = do -- first statement
- let res_expr = mkLHsVarTuple xs
- cqs <- dsPArrComp (map unLoc qs ++ [mkLastStmt res_expr])
- parStmts qss (mkLHsVarPatTup xs) cqs
- deParStmt (XParStmtBlock{}:_) = panic "dePArrParComp"
- ---
- parStmts [] pa cea = return (pa, cea)
- parStmts (ParStmtBlock _ qs xs _:qss) pa cea = do
- -- subsequent statements (zip'ed)
- zipP <- dsDPHBuiltin zipPVar
- let pa' = mkLHsPatTup [pa, mkLHsVarPatTup xs]
- ty'cea = parrElemType cea
- res_expr = mkLHsVarTuple xs
- cqs <- dsPArrComp (map unLoc qs ++ [mkLastStmt res_expr])
- let ty'cqs = parrElemType cqs
- cea' = mkApps (Var zipP) [Type ty'cea, Type ty'cqs, cea, cqs]
- parStmts qss pa' cea'
- parStmts (XParStmtBlock{}:_) _ _ = panic "dePArrParComp"
-
--- generate Core corresponding to `\p -> e'
---
-deLambda :: Type -- type of the argument (not levity-polymorphic)
- -> LPat GhcTc -- argument pattern
- -> LHsExpr GhcTc -- body
- -> DsM (CoreExpr, Type)
-deLambda ty p e =
- mkLambda ty p =<< dsLExpr e
-
--- generate Core for a lambda pattern match, where the body is already in Core
---
-mkLambda :: Type -- type of the argument (not levity-polymorphic)
- -> LPat GhcTc -- argument pattern
- -> CoreExpr -- desugared body
- -> DsM (CoreExpr, Type)
-mkLambda ty p ce = do
- v <- newSysLocalDs ty
- let errMsg = text "DsListComp.deLambda: internal error!"
- ce'ty = exprType ce
- cerr <- mkErrorAppDs pAT_ERROR_ID ce'ty errMsg
- res <- matchSimply (Var v) (StmtCtxt PArrComp) p ce cerr
- return (mkLams [v] res, ce'ty)
-
--- obtain the element type of the parallel array produced by the given Core
--- expression
---
-parrElemType :: CoreExpr -> Type
-parrElemType e =
- case splitTyConApp_maybe (exprType e) of
- Just (tycon, [ty]) | tycon == parrTyCon -> ty
- _ -> panic
- "DsListComp.parrElemType: not a parallel array type"
-
-- Translation for monad comprehensions
-- Entry point for monad comprehension desugaring
diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index 6bff89774d..cc1bd3d799 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/deSugar/DsMeta.hs
@@ -121,7 +121,6 @@ repTopDs group@(HsGroup { hs_valds = valds
, hs_warnds = warnds
, hs_annds = annds
, hs_ruleds = ruleds
- , hs_vects = vects
, hs_docs = docs })
= do { let { bndrs = hsSigTvBinders valds
++ hsGroupBinders group
@@ -151,7 +150,6 @@ repTopDs group@(HsGroup { hs_valds = valds
; ann_ds <- mapM repAnnD annds
; rule_ds <- mapM repRuleD (concatMap (rds_rules . unLoc)
ruleds)
- ; _ <- mapM no_vect vects
; _ <- mapM no_doc docs
-- more needed
@@ -178,8 +176,6 @@ repTopDs group@(HsGroup { hs_valds = valds
= notHandledL loc "WARNING and DEPRECATION pragmas" $
text "Pragma for declaration of" <+> ppr thing
no_warn (L _ (XWarnDecl _)) = panic "repTopDs"
- no_vect (L loc decl)
- = notHandledL loc "Vectorisation pragmas" (ppr decl)
no_doc (L loc _)
= notHandledL loc "Haddock documentation" empty
repTopDs (XHsGroup _) = panic "repTopDs"
@@ -1114,11 +1110,6 @@ repTy (HsListTy _ t) = do
t1 <- repLTy t
tcon <- repListTyCon
repTapp tcon t1
-repTy (HsPArrTy _ t) = do
- t1 <- repLTy t
- tcon <- repTy (HsTyVar noExt NotPromoted
- (noLoc (tyConName parrTyCon)))
- repTapp tcon t1
repTy (HsTupleTy _ HsUnboxedTuple tys) = do
tys1 <- repLTys tys
tcon <- repUnboxedTupleTyCon (length tys)
@@ -1291,7 +1282,6 @@ repE e@(HsDo _ ctxt (L _ sts))
= notHandled "mdo, monad comprehension and [: :]" (ppr e)
repE (ExplicitList _ _ es) = do { xs <- repLEs es; repListExp xs }
-repE e@(ExplicitPArr _ _) = notHandled "Parallel arrays" (ppr e)
repE e@(ExplicitTuple _ es boxed)
| not (all tupArgPresent es) = notHandled "Tuple sections" (ppr e)
| isBoxed boxed = do { xs <- repLEs [e | L _ (Present _ e) <- es]; repTup xs }
@@ -1340,7 +1330,6 @@ repE (HsUnboundVar _ uv) = do
sname <- repNameS occ
repUnboundVar sname
-repE e@(PArrSeq {}) = notHandled "Parallel arrays" (ppr e)
repE e@(HsCoreAnn {}) = notHandled "Core annotations" (ppr e)
repE e@(HsSCC {}) = notHandled "Cost centres" (ppr e)
repE e@(HsTickPragma {}) = notHandled "Tick Pragma" (ppr e)
diff --git a/compiler/deSugar/DsMonad.hs b/compiler/deSugar/DsMonad.hs
index d075d0a118..c26854f479 100644
--- a/compiler/deSugar/DsMonad.hs
+++ b/compiler/deSugar/DsMonad.hs
@@ -23,13 +23,9 @@ module DsMonad (
newUnique,
UniqSupply, newUniqueSupply,
getGhcModeDs, dsGetFamInstEnvs,
- dsLookupGlobal, dsLookupGlobalId, dsDPHBuiltin, dsLookupTyCon,
+ dsLookupGlobal, dsLookupGlobalId, dsLookupTyCon,
dsLookupDataCon, dsLookupConLike,
- PArrBuiltin(..),
- dsLookupDPHRdrEnv, dsLookupDPHRdrEnv_maybe,
- dsInitPArrBuiltin,
-
DsMetaEnv, DsMetaVal(..), dsGetMetaEnv, dsLookupMetaEnv, dsExtendMetaEnv,
-- Getting and setting EvVars and term constraints in local environment
@@ -65,8 +61,6 @@ import CoreUtils ( exprType, isExprLevPoly )
import HsSyn
import TcIface
import TcMType ( checkForLevPolyX, formatLevPolyErr )
-import LoadIface
-import Finder
import PrelNames
import RdrName
import HscTypes
@@ -86,15 +80,12 @@ import NameEnv
import DynFlags
import ErrUtils
import FastString
-import Maybes
import Var (EvVar)
-import qualified GHC.LanguageExtensions as LangExt
import UniqFM ( lookupWithDefaultUFM )
import Literal ( mkMachString )
import CostCentreState
import Data.IORef
-import Control.Monad
{-
************************************************************************
@@ -166,7 +157,7 @@ initDsTc thing_inside
; msg_var <- getErrsVar
; hsc_env <- getTopEnv
; envs <- mkDsEnvsFromTcGbl hsc_env msg_var tcg_env
- ; setEnvs envs $ initDPH thing_inside
+ ; setEnvs envs thing_inside
}
-- | Run a 'DsM' action inside the 'IO' monad.
@@ -198,7 +189,7 @@ mkDsEnvsFromTcGbl hsc_env msg_var tcg_env
runDs :: HscEnv -> (DsGblEnv, DsLclEnv) -> DsM a -> IO (Messages, Maybe a)
runDs hsc_env (ds_gbl, ds_lcl) thing_inside
= do { res <- initTcRnIf 'd' hsc_env ds_gbl ds_lcl
- (initDPH $ tryM thing_inside)
+ (tryM thing_inside)
; msgs <- readIORef (ds_msgs ds_gbl)
; let final_res
| errorsFound dflags msgs = Nothing
@@ -271,8 +262,6 @@ mkDsEnvs dflags mod rdr_env type_env fam_inst_env msg_var pmvar cc_st_var
, ds_if_env = (if_genv, if_lenv)
, ds_unqual = mkPrintUnqualified dflags rdr_env
, ds_msgs = msg_var
- , ds_dph_env = emptyGlobalRdrEnv
- , ds_parr_bi = panic "DsMonad: uninitialised ds_parr_bi"
, ds_complete_matches = completeMatchMap
, ds_cc_st = cc_st_var
}
@@ -500,23 +489,6 @@ mkPrintUnqualifiedDs = ds_unqual <$> getGblEnv
instance MonadThings (IOEnv (Env DsGblEnv DsLclEnv)) where
lookupThing = dsLookupGlobal
--- | Attempt to load the given module and return its exported entities if
--- successful.
-dsLoadModule :: SDoc -> Module -> DsM GlobalRdrEnv
-dsLoadModule doc mod
- = do { env <- getGblEnv
- ; setEnvs (ds_if_env env) $ do
- { iface <- loadInterface doc mod ImportBySystem
- ; case iface of
- Failed err -> pprPanic "DsMonad.dsLoadModule: failed to load" (err $$ doc)
- Succeeded iface -> return $ mkGlobalRdrEnv . gresFromAvails prov . mi_exports $ iface
- } }
- where
- prov = Just (ImpSpec { is_decl = imp_spec, is_item = ImpAll })
- imp_spec = ImpDeclSpec { is_mod = name, is_qual = True,
- is_dloc = wiredInSrcSpan, is_as = name }
- name = moduleName mod
-
dsLookupGlobal :: Name -> DsM TyThing
-- Very like TcEnv.tcLookupGlobal
dsLookupGlobal name
@@ -609,138 +581,6 @@ dsWhenNoErrs thing_inside mk_expr
then mk_expr result
else unitExpr }
---------------------------------------------------------------------------
--- Data Parallel Haskell
---------------------------------------------------------------------------
-
--- | Run a 'DsM' with DPH things in scope if necessary.
-initDPH :: DsM a -> DsM a
-initDPH = loadDAP . initDPHBuiltins
-
--- | Extend the global environment with a 'GlobalRdrEnv' containing the exported
--- entities of,
---
--- * 'Data.Array.Parallel' iff '-XParallelArrays' specified (see also 'checkLoadDAP').
--- * 'Data.Array.Parallel.Prim' iff '-fvectorise' specified.
-loadDAP :: DsM a -> DsM a
-loadDAP thing_inside
- = do { dapEnv <- loadOneModule dATA_ARRAY_PARALLEL_NAME checkLoadDAP paErr
- ; dappEnv <- loadOneModule dATA_ARRAY_PARALLEL_PRIM_NAME (goptM Opt_Vectorise) veErr
- ; updGblEnv (\env -> env {ds_dph_env = dapEnv `plusOccEnv` dappEnv }) thing_inside
- }
- where
- loadOneModule :: ModuleName -- the module to load
- -> DsM Bool -- under which condition
- -> MsgDoc -- error message if module not found
- -> DsM GlobalRdrEnv -- empty if condition 'False'
- loadOneModule modname check err
- = do { doLoad <- check
- ; if not doLoad
- then return emptyGlobalRdrEnv
- else do {
- ; hsc_env <- getTopEnv
- ; result <- liftIO $ findImportedModule hsc_env modname Nothing
- ; case result of
- Found _ mod -> dsLoadModule err mod
- _ -> pprPgmError "Unable to use Data Parallel Haskell (DPH):" err
- } }
-
- paErr = text "To use ParallelArrays," <+> specBackend $$ hint1 $$ hint2
- veErr = text "To use -fvectorise," <+> specBackend $$ hint1 $$ hint2
- specBackend = text "you must specify a DPH backend package"
- hint1 = text "Look for packages named 'dph-lifted-*' with 'ghc-pkg'"
- hint2 = text "You may need to install them with 'cabal install dph-examples'"
-
--- | If '-XParallelArrays' given, we populate the builtin table for desugaring
--- those.
-initDPHBuiltins :: DsM a -> DsM a
-initDPHBuiltins thing_inside
- = do { doInitBuiltins <- checkLoadDAP
- ; if doInitBuiltins
- then dsInitPArrBuiltin thing_inside
- else thing_inside
- }
-
-checkLoadDAP :: DsM Bool
-checkLoadDAP
- = do { paEnabled <- xoptM LangExt.ParallelArrays
- ; mod <- getModule
- -- do not load 'Data.Array.Parallel' iff compiling 'base:GHC.PArr' or a
- -- module called 'dATA_ARRAY_PARALLEL_NAME'; see also the comments at the top
- -- of 'base:GHC.PArr' and 'Data.Array.Parallel' in the DPH libraries
- ; return $ paEnabled &&
- mod /= gHC_PARR' &&
- moduleName mod /= dATA_ARRAY_PARALLEL_NAME
- }
-
--- | Populate 'ds_parr_bi' from 'ds_dph_env'.
---
-dsInitPArrBuiltin :: DsM a -> DsM a
-dsInitPArrBuiltin thing_inside
- = do { lengthPVar <- externalVar (fsLit "lengthP")
- ; replicatePVar <- externalVar (fsLit "replicateP")
- ; singletonPVar <- externalVar (fsLit "singletonP")
- ; mapPVar <- externalVar (fsLit "mapP")
- ; filterPVar <- externalVar (fsLit "filterP")
- ; zipPVar <- externalVar (fsLit "zipP")
- ; crossMapPVar <- externalVar (fsLit "crossMapP")
- ; indexPVar <- externalVar (fsLit "!:")
- ; emptyPVar <- externalVar (fsLit "emptyP")
- ; appPVar <- externalVar (fsLit "+:+")
- -- ; enumFromToPVar <- externalVar (fsLit "enumFromToP")
- -- ; enumFromThenToPVar <- externalVar (fsLit "enumFromThenToP")
- ; enumFromToPVar <- return arithErr
- ; enumFromThenToPVar <- return arithErr
-
- ; updGblEnv (\env -> env {ds_parr_bi = PArrBuiltin
- { lengthPVar = lengthPVar
- , replicatePVar = replicatePVar
- , singletonPVar = singletonPVar
- , mapPVar = mapPVar
- , filterPVar = filterPVar
- , zipPVar = zipPVar
- , crossMapPVar = crossMapPVar
- , indexPVar = indexPVar
- , emptyPVar = emptyPVar
- , appPVar = appPVar
- , enumFromToPVar = enumFromToPVar
- , enumFromThenToPVar = enumFromThenToPVar
- } })
- thing_inside
- }
- where
- externalVar :: FastString -> DsM Var
- externalVar fs = dsLookupDPHRdrEnv (mkVarOccFS fs) >>= dsLookupGlobalId
-
- arithErr = panic "Arithmetic sequences have to wait until we support type classes"
-
--- |Get a name from "Data.Array.Parallel" for the desugarer, from the
--- 'ds_parr_bi' component of the global desugerar environment.
---
-dsDPHBuiltin :: (PArrBuiltin -> a) -> DsM a
-dsDPHBuiltin sel = (sel . ds_parr_bi) <$> getGblEnv
-
--- |Lookup a name exported by 'Data.Array.Parallel.Prim' or 'Data.Array.Parallel.Prim'.
--- Panic if there isn't one, or if it is defined multiple times.
-dsLookupDPHRdrEnv :: OccName -> DsM Name
-dsLookupDPHRdrEnv occ
- = liftM (fromMaybe (pprPanic nameNotFound (ppr occ)))
- $ dsLookupDPHRdrEnv_maybe occ
- where nameNotFound = "Name not found in 'Data.Array.Parallel' or 'Data.Array.Parallel.Prim':"
-
--- |Lookup a name exported by 'Data.Array.Parallel.Prim' or 'Data.Array.Parallel.Prim',
--- returning `Nothing` if it's not defined. Panic if it's defined multiple times.
-dsLookupDPHRdrEnv_maybe :: OccName -> DsM (Maybe Name)
-dsLookupDPHRdrEnv_maybe occ
- = do { env <- ds_dph_env <$> getGblEnv
- ; let gres = lookupGlobalRdrEnv env occ
- ; case gres of
- [] -> return $ Nothing
- [gre] -> return $ Just $ gre_name gre
- _ -> pprPanic multipleNames (ppr occ)
- }
- where multipleNames = "Multiple definitions in 'Data.Array.Parallel' and 'Data.Array.Parallel.Prim':"
-
-- | Inject a trace message into the compiled program. Whereas
-- pprTrace prints out information *while compiling*, pprRuntimeTrace
-- captures that information and causes it to be printed *at runtime*
diff --git a/compiler/deSugar/DsUtils.hs b/compiler/deSugar/DsUtils.hs
index 7bec30acdc..4c30889858 100644
--- a/compiler/deSugar/DsUtils.hs
+++ b/compiler/deSugar/DsUtils.hs
@@ -282,18 +282,15 @@ data CaseAlt a = MkCaseAlt{ alt_pat :: a,
alt_result :: MatchResult }
mkCoAlgCaseMatchResult
- :: DynFlags
- -> Id -- Scrutinee
+ :: Id -- Scrutinee
-> Type -- Type of exp
-> [CaseAlt DataCon] -- Alternatives (bndrs *include* tyvars, dicts)
-> MatchResult
-mkCoAlgCaseMatchResult dflags var ty match_alts
+mkCoAlgCaseMatchResult var ty match_alts
| isNewtype -- Newtype case; use a let
= ASSERT( null (tail match_alts) && null (tail arg_ids1) )
mkCoLetMatchResult (NonRec arg_id1 newtype_rhs) match_result1
- | isPArrFakeAlts match_alts
- = MatchResult CanFail $ mkPArrCase dflags var ty (sort_alts match_alts)
| otherwise
= mkDataConCase var ty match_alts
where
@@ -311,34 +308,6 @@ mkCoAlgCaseMatchResult dflags var ty match_alts
-- (not that splitTyConApp does, these days)
newtype_rhs = unwrapNewTypeBody tc ty_args (Var var)
- --- Stuff for parallel arrays
- --
- -- Concerning `isPArrFakeAlts':
- --
- -- * it is *not* sufficient to just check the type of the type
- -- constructor, as we have to be careful not to confuse the real
- -- representation of parallel arrays with the fake constructors;
- -- moreover, a list of alternatives must not mix fake and real
- -- constructors (this is checked earlier on)
- --
- -- FIXME: We actually go through the whole list and make sure that
- -- either all or none of the constructors are fake parallel
- -- array constructors. This is to spot equations that mix fake
- -- constructors with the real representation defined in
- -- `PrelPArr'. It would be nicer to spot this situation
- -- earlier and raise a proper error message, but it can really
- -- only happen in `PrelPArr' anyway.
- --
-
- isPArrFakeAlts :: [CaseAlt DataCon] -> Bool
- isPArrFakeAlts [alt] = isPArrFakeCon (alt_pat alt)
- isPArrFakeAlts (alt:alts) =
- case (isPArrFakeCon (alt_pat alt), isPArrFakeAlts alts) of
- (True , True ) -> True
- (False, False) -> False
- _ -> panic "DsUtils: you may not mix `[:...:]' with `PArr' patterns"
- isPArrFakeAlts [] = panic "DsUtils: unexpectedly found an empty list of PArr fake alternatives"
-
mkCoSynCaseMatchResult :: Id -> Type -> CaseAlt PatSyn -> MatchResult
mkCoSynCaseMatchResult var ty alt = MatchResult CanFail $ mkPatSynCase var ty alt
@@ -412,49 +381,6 @@ mkDataConCase var ty alts@(alt1:_) = MatchResult fail_flag mk_case
= mkUniqSet data_cons `minusUniqSet` mentioned_constructors
exhaustive_case = isEmptyUniqSet un_mentioned_constructors
---- Stuff for parallel arrays
---
--- * the following is to desugar cases over fake constructors for
--- parallel arrays, which are introduced by `tidy1' in the `PArrPat'
--- case
---
-mkPArrCase :: DynFlags -> Id -> Type -> [CaseAlt DataCon] -> CoreExpr
- -> DsM CoreExpr
-mkPArrCase dflags var ty sorted_alts fail = do
- lengthP <- dsDPHBuiltin lengthPVar
- alt <- unboxAlt
- return (mkWildCase (len lengthP) intTy ty [alt])
- where
- elemTy = case splitTyConApp (idType var) of
- (_, [elemTy]) -> elemTy
- _ -> panic panicMsg
- panicMsg = "DsUtils.mkCoAlgCaseMatchResult: not a parallel array?"
- len lengthP = mkApps (Var lengthP) [Type elemTy, Var var]
- --
- unboxAlt = do
- l <- newSysLocalDs intPrimTy
- indexP <- dsDPHBuiltin indexPVar
- alts <- mapM (mkAlt indexP) sorted_alts
- return (DataAlt intDataCon, [l], mkWildCase (Var l) intPrimTy ty (dft : alts))
- where
- dft = (DEFAULT, [], fail)
-
- --
- -- each alternative matches one array length (corresponding to one
- -- fake array constructor), so the match is on a literal; each
- -- alternative's body is extended by a local binding for each
- -- constructor argument, which are bound to array elements starting
- -- with the first
- --
- mkAlt indexP alt@MkCaseAlt{alt_result = MatchResult _ bodyFun} = do
- body <- bodyFun fail
- return (LitAlt lit, [], mkCoreLets binds body)
- where
- lit = MachInt $ toInteger (dataConSourceArity (alt_pat alt))
- binds = [NonRec arg (indexExpr i) | (i, arg) <- zip [1..] (alt_bndrs alt)]
- --
- indexExpr i = mkApps (Var indexP) [Type elemTy, Var var, mkIntExpr dflags i]
-
{-
************************************************************************
* *
diff --git a/compiler/deSugar/Match.hs b/compiler/deSugar/Match.hs
index 6b548a4f5a..fabbe2bc2f 100644
--- a/compiler/deSugar/Match.hs
+++ b/compiler/deSugar/Match.hs
@@ -448,14 +448,6 @@ tidy1 _ (ListPat (ListPatTc ty Nothing) pats )
(mkNilPat ty)
pats
--- Introduce fake parallel array constructors to be able to handle parallel
--- arrays with the existing machinery for constructor pattern
-tidy1 _ (PArrPat ty pats)
- = return (idDsWrapper, unLoc parrConPat)
- where
- arity = length pats
- parrConPat = mkPrefixConPat (parrFakeCon arity) pats [ty]
-
tidy1 _ (TuplePat tys pats boxity)
= return (idDsWrapper, unLoc tuple_ConPat)
where
@@ -498,7 +490,6 @@ tidy_bang_pat v _ p@(LitPat {}) = tidy1 v p
tidy_bang_pat v _ p@(ListPat {}) = tidy1 v p
tidy_bang_pat v _ p@(TuplePat {}) = tidy1 v p
tidy_bang_pat v _ p@(SumPat {}) = tidy1 v p
-tidy_bang_pat v _ p@(PArrPat {}) = tidy1 v p
-- Data/newtype constructors
tidy_bang_pat v l p@(ConPatOut { pat_con = L _ (RealDataCon dc)
diff --git a/compiler/deSugar/MatchCon.hs b/compiler/deSugar/MatchCon.hs
index 5bf8c066f4..49586bc972 100644
--- a/compiler/deSugar/MatchCon.hs
+++ b/compiler/deSugar/MatchCon.hs
@@ -29,7 +29,6 @@ import Id
import NameEnv
import FieldLabel ( flSelector )
import SrcLoc
-import DynFlags
import Outputable
import Control.Monad(liftM)
import Data.List (groupBy)
@@ -93,9 +92,8 @@ matchConFamily :: [Id]
-> DsM MatchResult
-- Each group of eqns is for a single constructor
matchConFamily (var:vars) ty groups
- = do dflags <- getDynFlags
- alts <- mapM (fmap toRealAlt . matchOneConLike vars ty) groups
- return (mkCoAlgCaseMatchResult dflags var ty alts)
+ = do alts <- mapM (fmap toRealAlt . matchOneConLike vars ty) groups
+ return (mkCoAlgCaseMatchResult var ty alts)
where
toRealAlt alt = case alt_pat alt of
RealDataCon dcon -> alt{ alt_pat = dcon }
diff --git a/compiler/deSugar/PmExpr.hs b/compiler/deSugar/PmExpr.hs
index f008a31d4b..56d310f618 100644
--- a/compiler/deSugar/PmExpr.hs
+++ b/compiler/deSugar/PmExpr.hs
@@ -261,10 +261,6 @@ hsExprToPmExpr e@(ExplicitList _ mb_ol elems)
cons x xs = mkPmExprData consDataCon [x,xs]
nil = mkPmExprData nilDataCon []
-hsExprToPmExpr (ExplicitPArr _ elems)
- = mkPmExprData (parrFakeCon (length elems)) (map lhsExprToPmExpr elems)
-
-
-- we want this but we would have to make everything monadic :/
-- ./compiler/deSugar/DsMonad.hs:397:dsLookupDataCon :: Name -> DsM DataCon
--
@@ -395,7 +391,7 @@ needsParens (PmExprLit l) = isNegatedPmLit l
needsParens (PmExprEq {}) = False -- will become a wildcard
needsParens (PmExprOther {}) = False -- will become a wildcard
needsParens (PmExprCon (RealDataCon c) es)
- | isTupleDataCon c || isPArrFakeCon c
+ | isTupleDataCon c
|| isConsDataCon c || null es = False
| otherwise = True
needsParens (PmExprCon (PatSynCon _) es) = not (null es)
@@ -408,12 +404,10 @@ pprPmExprWithParens expr
pprPmExprCon :: ConLike -> [PmExpr] -> PmPprM SDoc
pprPmExprCon (RealDataCon con) args
| isTupleDataCon con = mkTuple <$> mapM pprPmExpr args
- | isPArrFakeCon con = mkPArr <$> mapM pprPmExpr args
- | isConsDataCon con = pretty_list
+ | isConsDataCon con = pretty_list
where
- mkTuple, mkPArr :: [SDoc] -> SDoc
+ mkTuple :: [SDoc] -> SDoc
mkTuple = parens . fsep . punctuate comma
- mkPArr = paBrackets . fsep . punctuate comma
-- lazily, to be used in the list case only
pretty_list :: PmPprM SDoc
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 267e03b084..a6e6149f9f 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -160,7 +160,6 @@ Library
typecheck
types
utils
- vectorise
-- we use an explicit Prelude
Default-Extensions:
@@ -534,35 +533,6 @@ Library
UniqMap
UniqSet
Util
- Vectorise.Builtins.Base
- Vectorise.Builtins.Initialise
- Vectorise.Builtins
- Vectorise.Monad.Base
- Vectorise.Monad.Naming
- Vectorise.Monad.Local
- Vectorise.Monad.Global
- Vectorise.Monad.InstEnv
- Vectorise.Monad
- Vectorise.Utils.Base
- Vectorise.Utils.Closure
- Vectorise.Utils.Hoisting
- Vectorise.Utils.PADict
- Vectorise.Utils.Poly
- Vectorise.Utils
- Vectorise.Generic.Description
- Vectorise.Generic.PAMethods
- Vectorise.Generic.PADict
- Vectorise.Generic.PData
- Vectorise.Type.Env
- Vectorise.Type.Type
- Vectorise.Type.TyConDecl
- Vectorise.Type.Classify
- Vectorise.Convert
- Vectorise.Vect
- Vectorise.Var
- Vectorise.Env
- Vectorise.Exp
- Vectorise
Hoopl.Block
Hoopl.Collections
Hoopl.Dataflow
diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs
index 10f09da558..d389f61e86 100644
--- a/compiler/hsSyn/HsDecls.hs
+++ b/compiler/hsSyn/HsDecls.hs
@@ -50,9 +50,6 @@ module HsDecls (
RuleBndr(..),LRuleBndr,
collectRuleBndrSigTys,
flattenRuleDecls, pprFullRuleName,
- -- ** @VECTORISE@ declarations
- VectDecl(..), LVectDecl,VectTypePR(..),VectTypeTc(..),VectClassPR(..),
- lvectDeclName, lvectInstDecl,
-- ** @default@ declarations
DefaultDecl(..), LDefaultDecl,
-- ** Template haskell declaration splice
@@ -87,7 +84,7 @@ module HsDecls (
-- friends:
import GhcPrelude
-import {-# SOURCE #-} HsExpr( LHsExpr, HsExpr, HsSplice, pprExpr,
+import {-# SOURCE #-} HsExpr( HsExpr, HsSplice, pprExpr,
pprSpliceDecl )
-- Because Expr imports Decls via HsBracket
@@ -95,7 +92,6 @@ import HsBinds
import HsTypes
import HsDoc
import TyCon
-import Name
import BasicTypes
import Coercion
import ForeignCall
@@ -103,7 +99,6 @@ import HsExtension
import NameSet
-- others:
-import InstEnv
import Class
import Outputable
import Util
@@ -141,7 +136,6 @@ data HsDecl p
| WarningD (XWarningD p) (WarnDecls p) -- ^ Warning declaration
| AnnD (XAnnD p) (AnnDecl p) -- ^ Annotation declaration
| RuleD (XRuleD p) (RuleDecls p) -- ^ Rule declaration
- | VectD (XVectD p) (VectDecl p) -- ^ Vectorise declaration
| SpliceD (XSpliceD p) (SpliceDecl p) -- ^ Splice declaration
-- (Includes quasi-quotes)
| DocD (XDocD p) (DocDecl) -- ^ Documentation comment declaration
@@ -158,7 +152,6 @@ type instance XForD (GhcPass _) = NoExt
type instance XWarningD (GhcPass _) = NoExt
type instance XAnnD (GhcPass _) = NoExt
type instance XRuleD (GhcPass _) = NoExt
-type instance XVectD (GhcPass _) = NoExt
type instance XSpliceD (GhcPass _) = NoExt
type instance XDocD (GhcPass _) = NoExt
type instance XRoleAnnotD (GhcPass _) = NoExt
@@ -204,7 +197,6 @@ data HsGroup p
hs_warnds :: [LWarnDecls p],
hs_annds :: [LAnnDecl p],
hs_ruleds :: [LRuleDecls p],
- hs_vects :: [LVectDecl p],
hs_docs :: [LDocDecl]
}
@@ -225,7 +217,7 @@ emptyGroup = HsGroup { hs_ext = noExt,
hs_tyclds = [],
hs_derivds = [],
hs_fixds = [], hs_defds = [], hs_annds = [],
- hs_fords = [], hs_warnds = [], hs_ruleds = [], hs_vects = [],
+ hs_fords = [], hs_warnds = [], hs_ruleds = [],
hs_valds = error "emptyGroup hs_valds: Can't happen",
hs_splcds = [],
hs_docs = [] }
@@ -244,8 +236,7 @@ appendGroups
hs_fords = fords1,
hs_warnds = warnds1,
hs_ruleds = rulds1,
- hs_vects = vects1,
- hs_docs = docs1 }
+ hs_docs = docs1 }
HsGroup {
hs_valds = val_groups2,
hs_splcds = spliceds2,
@@ -257,7 +248,6 @@ appendGroups
hs_fords = fords2,
hs_warnds = warnds2,
hs_ruleds = rulds2,
- hs_vects = vects2,
hs_docs = docs2 }
=
HsGroup {
@@ -272,7 +262,6 @@ appendGroups
hs_fords = fords1 ++ fords2,
hs_warnds = warnds1 ++ warnds2,
hs_ruleds = rulds1 ++ rulds2,
- hs_vects = vects1 ++ vects2,
hs_docs = docs1 ++ docs2 }
appendGroups _ _ = panic "appendGroups"
@@ -285,7 +274,6 @@ instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (HsDecl p) where
ppr (ForD _ fd) = ppr fd
ppr (SigD _ sd) = ppr sd
ppr (RuleD _ rd) = ppr rd
- ppr (VectD _ vect) = ppr vect
ppr (WarningD _ wd) = ppr wd
ppr (AnnD _ ad) = ppr ad
ppr (SpliceD _ dd) = ppr dd
@@ -302,13 +290,11 @@ instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (HsGroup p) where
hs_annds = ann_decls,
hs_fords = foreign_decls,
hs_defds = default_decls,
- hs_ruleds = rule_decls,
- hs_vects = vect_decls })
+ hs_ruleds = rule_decls })
= vcat_mb empty
[ppr_ds fix_decls, ppr_ds default_decls,
ppr_ds deprec_decls, ppr_ds ann_decls,
ppr_ds rule_decls,
- ppr_ds vect_decls,
if isEmptyValBinds val_decls
then Nothing
else Just (ppr val_decls),
@@ -2106,137 +2092,6 @@ instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (RuleBndr p) where
{-
************************************************************************
* *
-\subsection{Vectorisation declarations}
-* *
-************************************************************************
-
-A vectorisation pragma, one of
-
- {-# VECTORISE f = closure1 g (scalar_map g) #-}
- {-# VECTORISE SCALAR f #-}
- {-# NOVECTORISE f #-}
-
- {-# VECTORISE type T = ty #-}
- {-# VECTORISE SCALAR type T #-}
--}
-
--- | Located Vectorise Declaration
-type LVectDecl pass = Located (VectDecl pass)
-
--- | Vectorise Declaration
-data VectDecl pass
- = HsVect
- (XHsVect pass)
- SourceText -- Note [Pragma source text] in BasicTypes
- (Located (IdP pass))
- (LHsExpr pass)
- -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen',
- -- 'ApiAnnotation.AnnEqual','ApiAnnotation.AnnClose'
-
- -- For details on above see note [Api annotations] in ApiAnnotation
- | HsNoVect
- (XHsNoVect pass)
- SourceText -- Note [Pragma source text] in BasicTypes
- (Located (IdP pass))
- -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen',
- -- 'ApiAnnotation.AnnClose'
-
- -- For details on above see note [Api annotations] in ApiAnnotation
- | HsVectType
- (XHsVectType pass)
- Bool -- 'TRUE' => SCALAR declaration
- | HsVectClass -- pre type-checking
- (XHsVectClass pass)
- | HsVectInst -- pre type-checking (always SCALAR)
- -- !!!FIXME: should be superfluous now
- (XHsVectInst pass)
- | XVectDecl (XXVectDecl pass)
-
--- Used for XHsVectType for parser and renamer phases
-data VectTypePR pass
- = VectTypePR
- SourceText -- Note [Pragma source text] in BasicTypes
- (Located (IdP pass))
- (Maybe (Located (IdP pass))) -- 'Nothing' => no right-hand side
-
--- Used for XHsVectType
-data VectTypeTc
- = VectTypeTc
- TyCon
- (Maybe TyCon) -- 'Nothing' => no right-hand side
- deriving Data
-
--- Used for XHsVectClass for parser and renamer phases
-data VectClassPR pass
- = VectClassPR
- SourceText -- Note [Pragma source text] in BasicTypes
- (Located (IdP pass))
-
-type instance XHsVect (GhcPass _) = NoExt
-type instance XHsNoVect (GhcPass _) = NoExt
-
-type instance XHsVectType GhcPs = VectTypePR GhcPs
-type instance XHsVectType GhcRn = VectTypePR GhcRn
-type instance XHsVectType GhcTc = VectTypeTc
-
-type instance XHsVectClass GhcPs = VectClassPR GhcPs
-type instance XHsVectClass GhcRn = VectClassPR GhcRn
-type instance XHsVectClass GhcTc = Class
-
-type instance XHsVectInst GhcPs = (LHsSigType GhcPs)
-type instance XHsVectInst GhcRn = (LHsSigType GhcRn)
-type instance XHsVectInst GhcTc = ClsInst
-
-type instance XXVectDecl (GhcPass _) = NoExt
-
-
-lvectDeclName :: LVectDecl GhcTc -> Name
-lvectDeclName (L _ (HsVect _ _ (L _ name) _)) = getName name
-lvectDeclName (L _ (HsNoVect _ _ (L _ name))) = getName name
-lvectDeclName (L _ (HsVectType (VectTypeTc tycon _) _)) = getName tycon
-lvectDeclName (L _ (HsVectClass cls)) = getName cls
-lvectDeclName (L _ (HsVectInst {}))
- = panic "HsDecls.lvectDeclName: HsVectInst"
-lvectDeclName (L _ (XVectDecl {}))
- = panic "HsDecls.lvectDeclName: XVectDecl"
-
-lvectInstDecl :: LVectDecl pass -> Bool
-lvectInstDecl (L _ (HsVectInst {})) = True
-lvectInstDecl _ = False
-
-instance (p ~ GhcPass pass, OutputableBndrId p) => Outputable (VectDecl p) where
- ppr (HsVect _ _ v rhs)
- = sep [text "{-# VECTORISE" <+> ppr v,
- nest 4 $
- pprExpr (unLoc rhs) <+> text "#-}" ]
- ppr (HsNoVect _ _ v)
- = sep [text "{-# NOVECTORISE" <+> ppr v <+> text "#-}" ]
- ppr (HsVectType x False)
- = sep [text "{-# VECTORISE type" <+> ppr x <+> text "#-}" ]
- ppr (HsVectType x True)
- = sep [text "{-# VECTORISE SCALAR type" <+> ppr x <+> text "#-}" ]
- ppr (HsVectClass c)
- = sep [text "{-# VECTORISE class" <+> ppr c <+> text "#-}" ]
- ppr (HsVectInst i)
- = sep [text "{-# VECTORISE SCALAR instance" <+> ppr i <+> text "#-}" ]
- ppr (XVectDecl x) = ppr x
-
-instance (p ~ GhcPass pass, OutputableBndrId p)
- => Outputable (VectTypePR p) where
- ppr (VectTypePR _ n Nothing) = ppr n
- ppr (VectTypePR _ n (Just t)) = sep [ppr n, text "=", ppr t]
-
-instance Outputable VectTypeTc where
- ppr (VectTypeTc n Nothing) = ppr n
- ppr (VectTypeTc n (Just t)) = sep [ppr n, text "=", ppr t]
-
-instance (p ~ GhcPass pass, OutputableBndrId p)
- => Outputable (VectClassPR p) where
- ppr (VectClassPR _ n ) = ppr n
-
-{-
-************************************************************************
-* *
\subsection[DocDecl]{Document comments}
* *
************************************************************************
diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs
index 19cb70d6f3..96d86c871b 100644
--- a/compiler/hsSyn/HsExpr.hs
+++ b/compiler/hsSyn/HsExpr.hs
@@ -460,18 +460,6 @@ data HsExpr p
-- For OverloadedLists, the fromListN witness
[LHsExpr p]
- -- | Syntactic parallel array: [:e1, ..., en:]
- --
- -- - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'[:'@,
- -- 'ApiAnnotation.AnnDotdot','ApiAnnotation.AnnComma',
- -- 'ApiAnnotation.AnnVbar'
- -- 'ApiAnnotation.AnnClose' @':]'@
-
- -- For details on above see note [Api annotations] in ApiAnnotation
- | ExplicitPArr
- (XExplicitPArr p) -- type of elements of the parallel array
- [LHsExpr p]
-
-- | Record construction
--
-- - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'{'@,
@@ -522,24 +510,6 @@ data HsExpr p
-- For OverloadedLists, the fromList witness
(ArithSeqInfo p)
- -- | Arithmetic sequence for parallel array
- --
- -- > [:e1..e2:] or [:e1, e2..e3:]
- --
- -- - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'[:'@,
- -- 'ApiAnnotation.AnnComma','ApiAnnotation.AnnDotdot',
- -- 'ApiAnnotation.AnnVbar',
- -- 'ApiAnnotation.AnnClose' @':]'@
-
- -- For details on above see note [Api annotations] in ApiAnnotation
- | PArrSeq
- (XPArrSeq p)
- (ArithSeqInfo p)
-
- -- | - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'{-\# SCC'@,
- -- 'ApiAnnotation.AnnVal' or 'ApiAnnotation.AnnValStr',
- -- 'ApiAnnotation.AnnClose' @'\#-}'@
-
-- For details on above see note [Api annotations] in ApiAnnotation
| HsSCC (XSCC p)
SourceText -- Note [Pragma source text] in BasicTypes
@@ -781,10 +751,6 @@ type instance XExplicitList GhcPs = NoExt
type instance XExplicitList GhcRn = NoExt
type instance XExplicitList GhcTc = Type
-type instance XExplicitPArr GhcPs = NoExt
-type instance XExplicitPArr GhcRn = NoExt
-type instance XExplicitPArr GhcTc = Type
-
type instance XRecordCon GhcPs = NoExt
type instance XRecordCon GhcRn = NoExt
type instance XRecordCon GhcTc = RecordConTc
@@ -801,10 +767,6 @@ type instance XArithSeq GhcPs = NoExt
type instance XArithSeq GhcRn = NoExt
type instance XArithSeq GhcTc = PostTcExpr
-type instance XPArrSeq GhcPs = NoExt
-type instance XPArrSeq GhcRn = NoExt
-type instance XPArrSeq GhcTc = PostTcExpr
-
type instance XSCC (GhcPass _) = NoExt
type instance XCoreAnn (GhcPass _) = NoExt
type instance XBracket (GhcPass _) = NoExt
@@ -1111,9 +1073,6 @@ ppr_expr (HsDo _ do_or_list_comp (L _ stmts)) = pprDo do_or_list_comp stmts
ppr_expr (ExplicitList _ _ exprs)
= brackets (pprDeeperList fsep (punctuate comma (map ppr_lexpr exprs)))
-ppr_expr (ExplicitPArr _ exprs)
- = paBrackets (pprDeeperList fsep (punctuate comma (map ppr_lexpr exprs)))
-
ppr_expr (RecordCon { rcon_con_name = con_id, rcon_flds = rbinds })
= hang (ppr con_id) 2 (ppr rbinds)
@@ -1125,7 +1084,6 @@ ppr_expr (ExprWithTySig sig expr)
4 (ppr sig)
ppr_expr (ArithSeq _ _ info) = brackets (ppr info)
-ppr_expr (PArrSeq _ info) = paBrackets (ppr info)
ppr_expr (EWildPat _) = char '_'
ppr_expr (ELazyPat _ e) = char '~' <> ppr e
@@ -1279,11 +1237,9 @@ hsExprNeedsParens p = go
| isListCompExpr sc = False
| otherwise = p > topPrec
go (ExplicitList{}) = False
- go (ExplicitPArr{}) = False
go (RecordUpd{}) = False
go (ExprWithTySig{}) = p > topPrec
go (ArithSeq{}) = False
- go (PArrSeq{}) = False
go (EWildPat{}) = False
go (ELazyPat{}) = False
go (EAsPat{}) = False
@@ -1891,14 +1847,14 @@ type GhciStmt id = Stmt id (LHsExpr id)
-- For details on above see note [Api annotations] in ApiAnnotation
data StmtLR idL idR body -- body should always be (LHs**** idR)
- = LastStmt -- Always the last Stmt in ListComp, MonadComp, PArrComp,
+ = LastStmt -- Always the last Stmt in ListComp, MonadComp,
-- and (after the renamer) DoExpr, MDoExpr
-- Not used for GhciStmtCtxt, PatGuard, which scope over other stuff
(XLastStmt idL idR body)
body
Bool -- True <=> return was stripped by ApplicativeDo
(SyntaxExpr idR) -- The return operator, used only for
- -- MonadComp For ListComp, PArrComp, we
+ -- MonadComp For ListComp we
-- use the baked-in 'return' For DoExpr,
-- MDoExpr, we don't apply a 'return' at
-- all See Note [Monad Comprehensions] |
@@ -2374,7 +2330,6 @@ pprDo GhciStmtCtxt stmts = text "do" <+> ppr_do_stmts stmts
pprDo ArrowExpr stmts = text "do" <+> ppr_do_stmts stmts
pprDo MDoExpr stmts = text "mdo" <+> ppr_do_stmts stmts
pprDo ListComp stmts = brackets $ pprComp stmts
-pprDo PArrComp stmts = paBrackets $ pprComp stmts
pprDo MonadComp stmts = brackets $ pprComp stmts
pprDo _ _ = panic "pprDo" -- PatGuard, ParStmtCxt
@@ -2778,7 +2733,6 @@ isPatSynCtxt ctxt =
data HsStmtContext id
= ListComp
| MonadComp
- | PArrComp -- ^Parallel array comprehension
| DoExpr -- ^do { ... }
| MDoExpr -- ^mdo { ... } ie recursive do-expression
@@ -2794,7 +2748,6 @@ deriving instance (Data id) => Data (HsStmtContext id)
isListCompExpr :: HsStmtContext id -> Bool
-- Uses syntax [ e | quals ]
isListCompExpr ListComp = True
-isListCompExpr PArrComp = True
isListCompExpr MonadComp = True
isListCompExpr (ParStmtCtxt c) = isListCompExpr c
isListCompExpr (TransStmtCtxt c) = isListCompExpr c
@@ -2809,7 +2762,7 @@ isMonadFailStmtContext MDoExpr = True
isMonadFailStmtContext GhciStmtCtxt = True
isMonadFailStmtContext (ParStmtCtxt ctxt) = isMonadFailStmtContext ctxt
isMonadFailStmtContext (TransStmtCtxt ctxt) = isMonadFailStmtContext ctxt
-isMonadFailStmtContext _ = False -- ListComp, PArrComp, PatGuard, ArrowExpr
+isMonadFailStmtContext _ = False -- ListComp, PatGuard, ArrowExpr
matchSeparator :: HsMatchContext id -> SDoc
matchSeparator (FunRhs {}) = text "="
@@ -2864,7 +2817,6 @@ pprAStmtContext ctxt = article <+> pprStmtContext ctxt
pp_a = text "a"
article = case ctxt of
MDoExpr -> pp_an
- PArrComp -> pp_an
GhciStmtCtxt -> pp_an
_ -> pp_a
@@ -2876,7 +2828,6 @@ pprStmtContext MDoExpr = text "'mdo' block"
pprStmtContext ArrowExpr = text "'do' block in an arrow command"
pprStmtContext ListComp = text "list comprehension"
pprStmtContext MonadComp = text "monad comprehension"
-pprStmtContext PArrComp = text "array comprehension"
pprStmtContext (PatGuard ctxt) = text "pattern guard for" $$ pprMatchContext ctxt
-- Drop the inner contexts when reporting errors, else we get
@@ -2918,7 +2869,6 @@ matchContextErrString (StmtCtxt ArrowExpr) = text "'do' block"
matchContextErrString (StmtCtxt MDoExpr) = text "'mdo' block"
matchContextErrString (StmtCtxt ListComp) = text "list comprehension"
matchContextErrString (StmtCtxt MonadComp) = text "monad comprehension"
-matchContextErrString (StmtCtxt PArrComp) = text "array comprehension"
pprMatchInCtxt :: (OutputableBndrId (GhcPass idR),
-- TODO:AZ these constraints do not make sense
diff --git a/compiler/hsSyn/HsExtension.hs b/compiler/hsSyn/HsExtension.hs
index 4545b2b0cb..4898e36e3b 100644
--- a/compiler/hsSyn/HsExtension.hs
+++ b/compiler/hsSyn/HsExtension.hs
@@ -216,7 +216,6 @@ type family XForD x
type family XWarningD x
type family XAnnD x
type family XRuleD x
-type family XVectD x
type family XSpliceD x
type family XDocD x
type family XRoleAnnotD x
@@ -233,7 +232,6 @@ type ForallXHsDecl (c :: * -> Constraint) (x :: *) =
, c (XWarningD x)
, c (XAnnD x)
, c (XRuleD x)
- , c (XVectD x)
, c (XSpliceD x)
, c (XDocD x)
, c (XRoleAnnotD x)
@@ -442,25 +440,6 @@ type ForallXRuleBndr (c :: * -> Constraint) (x :: *) =
)
-- -------------------------------------
--- RuleBndr type families
-type family XHsVect x
-type family XHsNoVect x
-type family XHsVectType x
-type family XHsVectClass x
-type family XHsVectInst x
-type family XXVectDecl x
-
-type ForallXVectDecl (c :: * -> Constraint) (x :: *) =
- ( c (XHsVect x)
- , c (XHsNoVect x)
- , c (XHsVectType x)
- , c (XHsVectClass x)
- , c (XHsVectInst x)
- , c (XXVectDecl x)
- , c (XXVectDecl x)
- )
-
--- -------------------------------------
-- WarnDecls type families
type family XWarnings x
type family XXWarnDecls x
@@ -528,12 +507,10 @@ type family XMultiIf x
type family XLet x
type family XDo x
type family XExplicitList x
-type family XExplicitPArr x
type family XRecordCon x
type family XRecordUpd x
type family XExprWithTySig x
type family XArithSeq x
-type family XPArrSeq x
type family XSCC x
type family XCoreAnn x
type family XBracket x
@@ -580,12 +557,10 @@ type ForallXExpr (c :: * -> Constraint) (x :: *) =
, c (XLet x)
, c (XDo x)
, c (XExplicitList x)
- , c (XExplicitPArr x)
, c (XRecordCon x)
, c (XRecordUpd x)
, c (XExprWithTySig x)
, c (XArithSeq x)
- , c (XPArrSeq x)
, c (XSCC x)
, c (XCoreAnn x)
, c (XBracket x)
@@ -856,7 +831,6 @@ type family XBangPat x
type family XListPat x
type family XTuplePat x
type family XSumPat x
-type family XPArrPat x
type family XConPat x
type family XViewPat x
type family XSplicePat x
@@ -878,7 +852,6 @@ type ForallXPat (c :: * -> Constraint) (x :: *) =
, c (XListPat x)
, c (XTuplePat x)
, c (XSumPat x)
- , c (XPArrPat x)
, c (XViewPat x)
, c (XSplicePat x)
, c (XLitPat x)
@@ -929,7 +902,6 @@ type family XAppsTy x
type family XAppTy x
type family XFunTy x
type family XListTy x
-type family XPArrTy x
type family XTupleTy x
type family XSumTy x
type family XOpTy x
@@ -957,7 +929,6 @@ type ForallXType (c :: * -> Constraint) (x :: *) =
, c (XAppTy x)
, c (XFunTy x)
, c (XListTy x)
- , c (XPArrTy x)
, c (XTupleTy x)
, c (XSumTy x)
, c (XOpTy x)
@@ -1129,16 +1100,6 @@ type OutputableX p = -- See Note [OutputableX]
, Outputable (XAppTypeE p)
, Outputable (XAppTypeE GhcRn)
-
- , Outputable (XHsVectType p)
- , Outputable (XHsVectType GhcRn)
-
- , Outputable (XHsVectClass p)
- , Outputable (XHsVectClass GhcRn)
-
- , Outputable (XHsVectInst p)
- , Outputable (XHsVectInst GhcRn)
-
)
-- TODO: Should OutputableX be included in OutputableBndrId?
diff --git a/compiler/hsSyn/HsInstances.hs b/compiler/hsSyn/HsInstances.hs
index 5833e17ff1..be72ec7939 100644
--- a/compiler/hsSyn/HsInstances.hs
+++ b/compiler/hsSyn/HsInstances.hs
@@ -209,16 +209,6 @@ deriving instance Data (RuleBndr GhcPs)
deriving instance Data (RuleBndr GhcRn)
deriving instance Data (RuleBndr GhcTc)
--- deriving instance (DataIdLR p p) => Data (VectDecl p)
-deriving instance Data (VectDecl GhcPs)
-deriving instance Data (VectDecl GhcRn)
-deriving instance Data (VectDecl GhcTc)
-
-deriving instance Data (VectTypePR GhcPs)
-deriving instance Data (VectTypePR GhcRn)
-deriving instance Data (VectClassPR GhcPs)
-deriving instance Data (VectClassPR GhcRn)
-
-- deriving instance (DataId p) => Data (WarnDecls p)
deriving instance Data (WarnDecls GhcPs)
deriving instance Data (WarnDecls GhcRn)
diff --git a/compiler/hsSyn/HsPat.hs b/compiler/hsSyn/HsPat.hs
index 6c092d34a7..866b0e2b3a 100644
--- a/compiler/hsSyn/HsPat.hs
+++ b/compiler/hsSyn/HsPat.hs
@@ -166,12 +166,7 @@ data Pat p
-- 'ApiAnnotation.AnnClose' @'#)'@
-- For details on above see note [Api annotations] in ApiAnnotation
- | PArrPat (XPArrPat p) -- After typechecking, the type of the elements
- [LPat p] -- Syntactic parallel array
- -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'[:'@,
- -- 'ApiAnnotation.AnnClose' @':]'@
- -- For details on above see note [Api annotations] in ApiAnnotation
------------ Constructor patterns ---------------
| ConPatIn (Located (IdP p))
(HsConPatDetails p)
@@ -309,10 +304,6 @@ type instance XSumPat GhcPs = NoExt
type instance XSumPat GhcRn = NoExt
type instance XSumPat GhcTc = [Type]
-type instance XPArrPat GhcPs = NoExt
-type instance XPArrPat GhcRn = NoExt
-type instance XPArrPat GhcTc = Type
-
type instance XViewPat GhcPs = NoExt
type instance XViewPat GhcRn = NoExt
type instance XViewPat GhcTc = Type
@@ -535,7 +526,6 @@ pprPat (CoPat _ co pat _) = pprHsWrapper co $ \parens
else pprPat pat
pprPat (SigPat ty pat) = ppr pat <+> dcolon <+> ppr ty
pprPat (ListPat _ pats) = brackets (interpp'SP pats)
-pprPat (PArrPat _ pats) = paBrackets (interpp'SP pats)
pprPat (TuplePat _ pats bx) = tupleParens (boxityTupleSort bx)
(pprWithCommas ppr pats)
pprPat (SumPat _ pat alt arity) = sumParens (pprAlternative ppr pat alt arity)
@@ -694,7 +684,6 @@ isIrrefutableHsPat pat
go1 (SumPat {}) = False
-- See Note [Unboxed sum patterns aren't irrefutable]
go1 (ListPat {}) = False
- go1 (PArrPat {}) = False -- ?
go1 (ConPatIn {}) = False -- Conservative
go1 (ConPatOut{ pat_con = L _ (RealDataCon con), pat_args = details })
@@ -758,7 +747,6 @@ patNeedsParens p = go
go (TuplePat {}) = False
go (SumPat {}) = False
go (ListPat {}) = False
- go (PArrPat {}) = False
go (LitPat _ l) = hsLitNeedsParens p l
go (NPat _ (L _ ol) _ _) = hsOverLitNeedsParens p ol
go (XPat {}) = True -- conservative default
@@ -800,7 +788,6 @@ collectEvVarsPat pat =
ListPat _ ps -> unionManyBags $ map collectEvVarsLPat ps
TuplePat _ ps _ -> unionManyBags $ map collectEvVarsLPat ps
SumPat _ p _ _ -> collectEvVarsLPat p
- PArrPat _ ps -> unionManyBags $ map collectEvVarsLPat ps
ConPatOut {pat_dicts = dicts, pat_args = args}
-> unionBags (listToBag dicts)
$ unionManyBags
diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs
index af64c2c69f..11d301d816 100644
--- a/compiler/hsSyn/HsTypes.hs
+++ b/compiler/hsSyn/HsTypes.hs
@@ -513,13 +513,6 @@ data HsType pass
-- For details on above see note [Api annotations] in ApiAnnotation
- | HsPArrTy (XPArrTy pass)
- (LHsType pass) -- Elem. type of parallel array: [:t:]
- -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnOpen' @'[:'@,
- -- 'ApiAnnotation.AnnClose' @':]'@
-
- -- For details on above see note [Api annotations] in ApiAnnotation
-
| HsTupleTy (XTupleTy pass)
HsTupleSort
[LHsType pass] -- Element types (length gives arity)
@@ -669,7 +662,6 @@ type instance XAppsTy (GhcPass _) = NoExt
type instance XAppTy (GhcPass _) = NoExt
type instance XFunTy (GhcPass _) = NoExt
type instance XListTy (GhcPass _) = NoExt
-type instance XPArrTy (GhcPass _) = NoExt
type instance XTupleTy (GhcPass _) = NoExt
type instance XSumTy (GhcPass _) = NoExt
type instance XOpTy (GhcPass _) = NoExt
@@ -1454,7 +1446,6 @@ ppr_mono_ty (HsSumTy _ tys)
ppr_mono_ty (HsKindSig _ ty kind)
= parens (ppr_mono_lty ty <+> dcolon <+> ppr kind)
ppr_mono_ty (HsListTy _ ty) = brackets (ppr_mono_lty ty)
-ppr_mono_ty (HsPArrTy _ ty) = paBrackets (ppr_mono_lty ty)
ppr_mono_ty (HsIParamTy _ n ty) = (ppr n <+> dcolon <+> ppr_mono_lty ty)
ppr_mono_ty (HsSpliceTy _ s) = pprSplice s
ppr_mono_ty (HsExplicitListTy _ Promoted tys)
@@ -1535,7 +1526,6 @@ hsTypeNeedsParens p = go
go (HsSumTy{}) = False
go (HsKindSig{}) = False
go (HsListTy{}) = False
- go (HsPArrTy{}) = False
go (HsIParamTy{}) = p > topPrec
go (HsSpliceTy{}) = False
go (HsExplicitListTy{}) = False
diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs
index fe22fb3f28..39149d00f7 100644
--- a/compiler/hsSyn/HsUtils.hs
+++ b/compiler/hsSyn/HsUtils.hs
@@ -1054,7 +1054,6 @@ collect_lpat (L _ pat) bndrs
go (ParPat _ pat) = collect_lpat pat bndrs
go (ListPat _ pats) = foldr collect_lpat bndrs pats
- go (PArrPat _ pats) = foldr collect_lpat bndrs pats
go (TuplePat _ pats _) = foldr collect_lpat bndrs pats
go (SumPat _ pat _ _) = collect_lpat pat bndrs
@@ -1345,7 +1344,6 @@ lPatImplicits = hs_lpat
hs_pat (ViewPat _ _ pat) = hs_lpat pat
hs_pat (ParPat _ pat) = hs_lpat pat
hs_pat (ListPat _ pats) = hs_lpats pats
- hs_pat (PArrPat _ pats) = hs_lpats pats
hs_pat (TuplePat _ pats _) = hs_lpats pats
hs_pat (SigPat _ pat) = hs_lpat pat
diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs
index 6f548f5b12..2524593663 100644
--- a/compiler/iface/IfaceType.hs
+++ b/compiler/iface/IfaceType.hs
@@ -1100,7 +1100,6 @@ pprIfaceCoTcApp ctxt_prec tc tys = ppr_iface_tc_app ppr_co ctxt_prec tc tys
ppr_iface_tc_app :: (PprPrec -> a -> SDoc) -> PprPrec -> IfaceTyCon -> [a] -> SDoc
ppr_iface_tc_app pp _ tc [ty]
| tc `ifaceTyConHasKey` listTyConKey = pprPromotionQuote tc <> brackets (pp topPrec ty)
- | tc `ifaceTyConHasKey` parrTyConKey = pprPromotionQuote tc <> paBrackets (pp topPrec ty)
ppr_iface_tc_app pp ctxt_prec tc tys
| tc `ifaceTyConHasKey` starKindTyConKey
diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs
index 0845208a32..02e7d50969 100644
--- a/compiler/iface/LoadIface.hs
+++ b/compiler/iface/LoadIface.hs
@@ -36,7 +36,7 @@ module LoadIface (
import GhcPrelude
import {-# SOURCE #-} TcIface( tcIfaceDecl, tcIfaceRules, tcIfaceInst,
- tcIfaceFamInst, tcIfaceVectInfo,
+ tcIfaceFamInst,
tcIfaceAnnotations, tcIfaceCompleteSigs )
import DynFlags
@@ -453,7 +453,7 @@ loadInterface doc_str mod from
--
-- The main thing is to add the ModIface to the PIT, but
-- we also take the
- -- IfaceDecls, IfaceClsInst, IfaceFamInst, IfaceRules, IfaceVectInfo
+ -- IfaceDecls, IfaceClsInst, IfaceFamInst, IfaceRules,
-- out of the ModIface and put them into the big EPS pools
-- NB: *first* we do loadDecl, so that the provenance of all the locally-defined
@@ -467,7 +467,6 @@ loadInterface doc_str mod from
; new_eps_fam_insts <- mapM tcIfaceFamInst (mi_fam_insts iface)
; new_eps_rules <- tcIfaceRules ignore_prags (mi_rules iface)
; new_eps_anns <- tcIfaceAnnotations (mi_anns iface)
- ; new_eps_vect_info <- tcIfaceVectInfo mod (mkNameEnv new_eps_decls) (mi_vect_info iface)
; new_eps_complete_sigs <- tcIfaceCompleteSigs (mi_complete_sigs iface)
; let { final_iface = iface {
@@ -495,8 +494,6 @@ loadInterface doc_str mod from
new_eps_insts,
eps_fam_inst_env = extendFamInstEnvList (eps_fam_inst_env eps)
new_eps_fam_insts,
- eps_vect_info = plusVectInfo (eps_vect_info eps)
- new_eps_vect_info,
eps_ann_env = extendAnnEnvList (eps_ann_env eps)
new_eps_anns,
eps_mod_fam_inst_env
@@ -979,7 +976,6 @@ initExternalPackageState
-- Initialise the EPS rule pool with the built-in rules
eps_mod_fam_inst_env
= emptyModuleEnv,
- eps_vect_info = noVectInfo,
eps_complete_matches = emptyUFM,
eps_ann_env = emptyAnnEnv,
eps_stats = EpsStats { n_ifaces_in = 0, n_decls_in = 0, n_decls_out = 0
@@ -1087,7 +1083,6 @@ pprModIface iface
, vcat (map ppr (mi_insts iface))
, vcat (map ppr (mi_fam_insts iface))
, vcat (map ppr (mi_rules iface))
- , pprVectInfo (mi_vect_info iface)
, ppr (mi_warns iface)
, pprTrustInfo (mi_trust iface)
, pprTrustPkg (mi_trust_pkg iface)
@@ -1161,21 +1156,6 @@ pprFixities fixes = text "fixities" <+> pprWithCommas pprFix fixes
where
pprFix (occ,fix) = ppr fix <+> ppr occ
-pprVectInfo :: IfaceVectInfo -> SDoc
-pprVectInfo (IfaceVectInfo { ifaceVectInfoVar = vars
- , ifaceVectInfoTyCon = tycons
- , ifaceVectInfoTyConReuse = tyconsReuse
- , ifaceVectInfoParallelVars = parallelVars
- , ifaceVectInfoParallelTyCons = parallelTyCons
- }) =
- vcat
- [ text "vectorised variables:" <+> hsep (map ppr vars)
- , text "vectorised tycons:" <+> hsep (map ppr tycons)
- , text "vectorised reused tycons:" <+> hsep (map ppr tyconsReuse)
- , text "parallel variables:" <+> hsep (map ppr parallelVars)
- , text "parallel tycons:" <+> hsep (map ppr parallelTyCons)
- ]
-
pprTrustInfo :: IfaceTrustInfo -> SDoc
pprTrustInfo trust = text "trusted:" <+> ppr trust
diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs
index 3375abd6e5..5c6912dca6 100644
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -86,7 +86,6 @@ import HscTypes
import Finder
import DynFlags
import VarEnv
-import VarSet
import Var
import Name
import Avail
@@ -222,7 +221,6 @@ mkIface_ hsc_env maybe_old_fingerprint
md_fam_insts = fam_insts,
md_rules = rules,
md_anns = anns,
- md_vect_info = vect_info,
md_types = type_env,
md_exports = exports,
md_complete_sigs = complete_sigs }
@@ -257,7 +255,6 @@ mkIface_ hsc_env maybe_old_fingerprint
iface_rules = map coreRuleToIfaceRule rules
iface_insts = map instanceToIfaceInst $ fixSafeInstances safe_mode insts
iface_fam_insts = map famInstToIfaceFamInst fam_insts
- iface_vect_info = flattenVectInfo vect_info
trust_info = setSafeMode safe_mode
annotations = map mkIfaceAnnotation anns
icomplete_sigs = map mkIfaceCompleteSig complete_sigs
@@ -280,8 +277,6 @@ mkIface_ hsc_env maybe_old_fingerprint
mi_fam_insts = sortBy cmp_fam_inst iface_fam_insts,
mi_rules = sortBy cmp_rule iface_rules,
- mi_vect_info = iface_vect_info,
-
mi_fixities = fixities,
mi_warns = warns,
mi_anns = annotations,
@@ -352,19 +347,6 @@ mkIface_ hsc_env maybe_old_fingerprint
ifFamInstTcName = ifFamInstFam
- flattenVectInfo (VectInfo { vectInfoVar = vVar
- , vectInfoTyCon = vTyCon
- , vectInfoParallelVars = vParallelVars
- , vectInfoParallelTyCons = vParallelTyCons
- }) =
- IfaceVectInfo
- { ifaceVectInfoVar = [Var.varName v | (v, _ ) <- dVarEnvElts vVar]
- , ifaceVectInfoTyCon = [tyConName t | (t, t_v) <- nameEnvElts vTyCon, t /= t_v]
- , ifaceVectInfoTyConReuse = [tyConName t | (t, t_v) <- nameEnvElts vTyCon, t == t_v]
- , ifaceVectInfoParallelVars = [Var.varName v | v <- dVarSetElems vParallelVars]
- , ifaceVectInfoParallelTyCons = nameSetElemsStable vParallelTyCons
- }
-
-----------------------------
writeIfaceFile :: DynFlags -> FilePath -> ModIface -> IO ()
writeIfaceFile dflags hi_file_path new_iface
@@ -686,13 +668,11 @@ addFingerprints hsc_env mb_old_fingerprint iface0 new_decls
-- - export list
-- - orphans
-- - deprecations
- -- - vect info
-- - flag abi hash
mod_hash <- computeFingerprint putNameLiterally
(map fst sorted_decls,
export_hash, -- includes orphan_hash
- mi_warns iface0,
- mi_vect_info iface0)
+ mi_warns iface0)
-- The interface hash depends on:
-- - the ABI hash, plus
@@ -722,8 +702,7 @@ addFingerprints hsc_env mb_old_fingerprint iface0 new_decls
mi_orphan = not ( all ifRuleAuto orph_rules
-- See Note [Orphans and auto-generated rules]
&& null orph_insts
- && null orph_fis
- && isNoIfaceVectInfo (mi_vect_info iface0)),
+ && null orph_fis),
mi_finsts = not . null $ mi_fam_insts iface0,
mi_decls = sorted_decls,
mi_hash_fn = lookupOccEnv local_env }
diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs
index 1d18c125d5..9d04bf2fb3 100644
--- a/compiler/iface/TcIface.hs
+++ b/compiler/iface/TcIface.hs
@@ -15,7 +15,7 @@ module TcIface (
typecheckIfacesForMerging,
typecheckIfaceForInstantiate,
tcIfaceDecl, tcIfaceInst, tcIfaceFamInst, tcIfaceRules,
- tcIfaceVectInfo, tcIfaceAnnotations, tcIfaceCompleteSigs,
+ tcIfaceAnnotations, tcIfaceCompleteSigs,
tcIfaceExpr, -- Desired by HERMIT (Trac #7683)
tcIfaceGlobal
) where
@@ -55,7 +55,6 @@ import PrelNames
import TysWiredIn
import Literal
import Var
-import VarEnv
import VarSet
import Name
import NameEnv
@@ -173,9 +172,6 @@ typecheckIface iface
; rules <- tcIfaceRules ignore_prags (mi_rules iface)
; anns <- tcIfaceAnnotations (mi_anns iface)
- -- Vectorisation information
- ; vect_info <- tcIfaceVectInfo (mi_semantic_module iface) type_env (mi_vect_info iface)
-
-- Exports
; exports <- ifaceExportNames (mi_exports iface)
@@ -193,7 +189,6 @@ typecheckIface iface
, md_fam_insts = fam_insts
, md_rules = rules
, md_anns = anns
- , md_vect_info = vect_info
, md_exports = exports
, md_complete_sigs = complete_sigs
}
@@ -393,7 +388,6 @@ typecheckIfacesForMerging mod ifaces tc_env_var =
fam_insts <- mapM tcIfaceFamInst (mi_fam_insts iface)
rules <- tcIfaceRules ignore_prags (mi_rules iface)
anns <- tcIfaceAnnotations (mi_anns iface)
- vect_info <- tcIfaceVectInfo (mi_semantic_module iface) type_env (mi_vect_info iface)
exports <- ifaceExportNames (mi_exports iface)
complete_sigs <- tcIfaceCompleteSigs (mi_complete_sigs iface)
return $ ModDetails { md_types = type_env
@@ -401,7 +395,6 @@ typecheckIfacesForMerging mod ifaces tc_env_var =
, md_fam_insts = fam_insts
, md_rules = rules
, md_anns = anns
- , md_vect_info = vect_info
, md_exports = exports
, md_complete_sigs = complete_sigs
}
@@ -434,7 +427,6 @@ typecheckIfaceForInstantiate nsubst iface =
fam_insts <- mapM tcIfaceFamInst (mi_fam_insts iface)
rules <- tcIfaceRules ignore_prags (mi_rules iface)
anns <- tcIfaceAnnotations (mi_anns iface)
- vect_info <- tcIfaceVectInfo (mi_semantic_module iface) type_env (mi_vect_info iface)
exports <- ifaceExportNames (mi_exports iface)
complete_sigs <- tcIfaceCompleteSigs (mi_complete_sigs iface)
return $ ModDetails { md_types = type_env
@@ -442,7 +434,6 @@ typecheckIfaceForInstantiate nsubst iface =
, md_fam_insts = fam_insts
, md_rules = rules
, md_anns = anns
- , md_vect_info = vect_info
, md_exports = exports
, md_complete_sigs = complete_sigs
}
@@ -1131,134 +1122,6 @@ tcIfaceCompleteSig (IfaceCompleteMatch ms t) = return (CompleteMatch ms t)
{-
************************************************************************
* *
- Vectorisation information
-* *
-************************************************************************
--}
-
--- We need access to the type environment as we need to look up information about type constructors
--- (i.e., their data constructors and whether they are class type constructors). If a vectorised
--- type constructor or class is defined in the same module as where it is vectorised, we cannot
--- look that information up from the type constructor that we obtained via a 'forkM'ed
--- 'tcIfaceTyCon' without recursively loading the interface that we are already type checking again
--- and again and again...
---
-tcIfaceVectInfo :: Module -> TypeEnv -> IfaceVectInfo -> IfL VectInfo
-tcIfaceVectInfo mod typeEnv (IfaceVectInfo
- { ifaceVectInfoVar = vars
- , ifaceVectInfoTyCon = tycons
- , ifaceVectInfoTyConReuse = tyconsReuse
- , ifaceVectInfoParallelVars = parallelVars
- , ifaceVectInfoParallelTyCons = parallelTyCons
- })
- = do { let parallelTyConsSet = mkNameSet parallelTyCons
- ; vVars <- mapM vectVarMapping vars
- ; let varsSet = mkVarSet (map fst vVars)
- ; tyConRes1 <- mapM (vectTyConVectMapping varsSet) tycons
- ; tyConRes2 <- mapM (vectTyConReuseMapping varsSet) tyconsReuse
- ; vParallelVars <- mapM vectVar parallelVars
- ; let (vTyCons, vDataCons, vScSels) = unzip3 (tyConRes1 ++ tyConRes2)
- ; return $ VectInfo
- { vectInfoVar = mkDVarEnv vVars `extendDVarEnvList` concat vScSels
- , vectInfoTyCon = mkNameEnv vTyCons
- , vectInfoDataCon = mkNameEnv (concat vDataCons)
- , vectInfoParallelVars = mkDVarSet vParallelVars
- , vectInfoParallelTyCons = parallelTyConsSet
- }
- }
- where
- vectVarMapping name
- = do { vName <- lookupIfaceTop (mkLocalisedOccName mod mkVectOcc name)
- ; var <- forkM (text "vect var" <+> ppr name) $
- tcIfaceExtId name
- ; vVar <- forkM (text "vect vVar [mod =" <+>
- ppr mod <> text "; nameModule =" <+>
- ppr (nameModule name) <> text "]" <+> ppr vName) $
- tcIfaceExtId vName
- ; return (var, (var, vVar))
- }
- -- where
- -- lookupLocalOrExternalId name
- -- = do { let mb_id = lookupTypeEnv typeEnv name
- -- ; case mb_id of
- -- -- id is local
- -- Just (AnId id) -> return id
- -- -- name is not an Id => internal inconsistency
- -- Just _ -> notAnIdErr
- -- -- Id is external
- -- Nothing -> tcIfaceExtId name
- -- }
- --
- -- notAnIdErr = pprPanic "TcIface.tcIfaceVectInfo: not an id" (ppr name)
-
- vectVar name
- = forkM (text "vect scalar var" <+> ppr name) $
- tcIfaceExtId name
-
- vectTyConVectMapping vars name
- = do { vName <- lookupIfaceTop (mkLocalisedOccName mod mkVectTyConOcc name)
- ; vectTyConMapping vars name vName
- }
-
- vectTyConReuseMapping vars name
- = vectTyConMapping vars name name
-
- vectTyConMapping vars name vName
- = do { tycon <- lookupLocalOrExternalTyCon name
- ; vTycon <- forkM (text "vTycon of" <+> ppr vName) $
- lookupLocalOrExternalTyCon vName
-
- -- Map the data constructors of the original type constructor to those of the
- -- vectorised type constructor /unless/ the type constructor was vectorised
- -- abstractly; if it was vectorised abstractly, the workers of its data constructors
- -- do not appear in the set of vectorised variables.
- --
- -- NB: This is lazy! We don't pull at the type constructors before we actually use
- -- the data constructor mapping.
- ; let isAbstract | isClassTyCon tycon = False
- | datacon:_ <- tyConDataCons tycon
- = not $ dataConWrapId datacon `elemVarSet` vars
- | otherwise = True
- vDataCons | isAbstract = []
- | otherwise = [ (dataConName datacon, (datacon, vDatacon))
- | (datacon, vDatacon) <- zip (tyConDataCons tycon)
- (tyConDataCons vTycon)
- ]
-
- -- Map the (implicit) superclass and methods selectors as they don't occur in
- -- the var map.
- vScSels | Just cls <- tyConClass_maybe tycon
- , Just vCls <- tyConClass_maybe vTycon
- = [ (sel, (sel, vSel))
- | (sel, vSel) <- zip (classAllSelIds cls) (classAllSelIds vCls)
- ]
- | otherwise
- = []
-
- ; return ( (name, (tycon, vTycon)) -- (T, T_v)
- , vDataCons -- list of (Ci, Ci_v)
- , vScSels -- list of (seli, seli_v)
- )
- }
- where
- -- we need a fully defined version of the type constructor to be able to extract
- -- its data constructors etc.
- lookupLocalOrExternalTyCon name
- = do { let mb_tycon = lookupTypeEnv typeEnv name
- ; case mb_tycon of
- -- tycon is local
- Just (ATyCon tycon) -> return tycon
- -- name is not a tycon => internal inconsistency
- Just _ -> notATyConErr
- -- tycon is external
- Nothing -> tcIfaceTyConByName name
- }
-
- notATyConErr = pprPanic "TcIface.tcIfaceVectInfo: not a tycon" (ppr name)
-
-{-
-************************************************************************
-* *
Types
* *
************************************************************************
diff --git a/compiler/iface/TcIface.hs-boot b/compiler/iface/TcIface.hs-boot
index dbc5ff14f8..f137f13305 100644
--- a/compiler/iface/TcIface.hs-boot
+++ b/compiler/iface/TcIface.hs-boot
@@ -8,13 +8,11 @@ import TcRnTypes ( IfL )
import InstEnv ( ClsInst )
import FamInstEnv ( FamInst )
import CoreSyn ( CoreRule )
-import HscTypes ( TypeEnv, VectInfo, IfaceVectInfo, CompleteMatch )
-import Module ( Module )
+import HscTypes ( CompleteMatch )
import Annotations ( Annotation )
tcIfaceDecl :: Bool -> IfaceDecl -> IfL TyThing
tcIfaceRules :: Bool -> [IfaceRule] -> IfL [CoreRule]
-tcIfaceVectInfo :: Module -> TypeEnv -> IfaceVectInfo -> IfL VectInfo
tcIfaceInst :: IfaceClsInst -> IfL ClsInst
tcIfaceFamInst :: IfaceFamInst -> IfL FamInst
tcIfaceAnnotations :: [IfaceAnnotation] -> IfL [Annotation]
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 2a96fd0966..558fa9963c 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -394,7 +394,6 @@ data DumpFlag
| Opt_D_dump_splices
| Opt_D_th_dec_file
| Opt_D_dump_BCOs
- | Opt_D_dump_vect
| Opt_D_dump_ticked
| Opt_D_dump_rtti
| Opt_D_source_stats
@@ -470,8 +469,6 @@ data GeneralFlag
| Opt_UnboxSmallStrictFields
| Opt_DictsCheap
| Opt_EnableRewriteRules -- Apply rewrite rules during simplification
- | Opt_Vectorise
- | Opt_VectorisationAvoidance
| Opt_RegsGraph -- do graph coloring register allocation
| Opt_RegsIterative -- do iterative coalescing graph coloring register allocation
| Opt_PedanticBottoms -- Be picky about how we treat bottom
@@ -667,8 +664,6 @@ optimisationFlags = EnumSet.fromList
, Opt_UnboxSmallStrictFields
, Opt_DictsCheap
, Opt_EnableRewriteRules
- , Opt_Vectorise
- , Opt_VectorisationAvoidance
, Opt_RegsGraph
, Opt_RegsIterative
, Opt_PedanticBottoms
@@ -3207,8 +3202,6 @@ dynamic_flags_deps = [
(setDumpFlag Opt_D_dump_hi)
, make_ord_flag defGhcFlag "ddump-minimal-imports"
(NoArg (setGeneralFlag Opt_D_dump_minimal_imports))
- , make_ord_flag defGhcFlag "ddump-vect"
- (setDumpFlag Opt_D_dump_vect)
, make_ord_flag defGhcFlag "ddump-hpc"
(setDumpFlag Opt_D_dump_ticked) -- back compat
, make_ord_flag defGhcFlag "ddump-ticked"
@@ -3334,7 +3327,6 @@ dynamic_flags_deps = [
------ Optimisation flags ------------------------------------------
, make_dep_flag defGhcFlag "Onot" (noArgM $ setOptLevel 0 )
"Use -O0 instead"
- , make_ord_flag defGhcFlag "Odph" (noArgM setDPHOpt)
, make_ord_flag defGhcFlag "O" (optIntSuffixM (\mb_n ->
setOptLevel (mb_n `orElse` 1)))
-- If the number is missing, use 1
@@ -3968,8 +3960,6 @@ fFlagsDeps = [
flagSpec "write-interface" Opt_WriteInterface,
flagSpec "unbox-small-strict-fields" Opt_UnboxSmallStrictFields,
flagSpec "unbox-strict-fields" Opt_UnboxStrictFields,
- flagSpec "vectorisation-avoidance" Opt_VectorisationAvoidance,
- flagSpec "vectorise" Opt_Vectorise,
flagSpec "version-macros" Opt_VersionMacros,
flagSpec "worker-wrapper" Opt_WorkerWrapper,
flagSpec "solve-constant-dicts" Opt_SolveConstantDicts,
@@ -4037,10 +4027,6 @@ fLangFlagsDeps = [
(deprecatedForExtension "ImplicitParams"),
depFlagSpec' "scoped-type-variables" LangExt.ScopedTypeVariables
(deprecatedForExtension "ScopedTypeVariables"),
- depFlagSpec' "parr" LangExt.ParallelArrays
- (deprecatedForExtension "ParallelArrays"),
- depFlagSpec' "PArr" LangExt.ParallelArrays
- (deprecatedForExtension "ParallelArrays"),
depFlagSpec' "allow-overlapping-instances" LangExt.OverlappingInstances
(deprecatedForExtension "OverlappingInstances"),
depFlagSpec' "allow-undecidable-instances" LangExt.UndecidableInstances
@@ -4380,11 +4366,6 @@ optLevelFlags -- see Note [Documenting optimisation flags]
, ([0,1,2], Opt_DoEtaReduction) -- See Note [Eta-reduction in -O0]
, ([0,1,2], Opt_DmdTxDictSel)
, ([0,1,2], Opt_LlvmTBAA)
- , ([0,1,2], Opt_VectorisationAvoidance)
- -- This one is important for a tiresome reason:
- -- we want to make sure that the bindings for data
- -- constructors are eta-expanded. This is probably
- -- a good thing anyway, but it seems fragile.
, ([0], Opt_IgnoreInterfacePragmas)
, ([0], Opt_OmitInterfacePragmas)
@@ -5129,17 +5110,6 @@ checkOptLevel n dflags
| otherwise
= Right dflags
--- -Odph is equivalent to
---
--- -O2 optimise as much as possible
--- -fmax-simplifier-iterations20 this is necessary sometimes
--- -fsimplifier-phases=3 we use an additional simplifier phase for fusion
---
-setDPHOpt :: DynFlags -> DynP DynFlags
-setDPHOpt dflags = setOptLevel 2 (dflags { maxSimplIterations = 20
- , simplPhases = 3
- })
-
setMainIs :: String -> DynP ()
setMainIs arg
| not (null main_fn) && isLower (head main_fn)
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index e17e2794b4..7cb25dfefb 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -44,7 +44,7 @@ module HscTypes (
lookupHpt, eltsHpt, filterHpt, allHpt, mapHpt, delFromHpt,
addToHpt, addListToHpt, lookupHptDirectly, listToHpt,
hptCompleteSigs,
- hptInstances, hptRules, hptVectInfo, pprHPT,
+ hptInstances, hptRules, pprHPT,
-- * State relating to known packages
ExternalPackageState(..), EpsStats(..), addEpsInStats,
@@ -123,10 +123,6 @@ module HscTypes (
-- * Breakpoints
ModBreaks (..), emptyModBreaks,
- -- * Vectorisation information
- VectInfo(..), IfaceVectInfo(..), noVectInfo, plusVectInfo,
- noIfaceVectInfo, isNoIfaceVectInfo,
-
-- * Safe Haskell information
IfaceTrustInfo, getSafeMode, setSafeMode, noIfaceTrustInfo,
trustInfoToNum, numToTrustInfo, IsSafeImport,
@@ -161,11 +157,9 @@ import Avail
import Module
import InstEnv ( InstEnv, ClsInst, identicalClsInstHead )
import FamInstEnv
-import CoreSyn ( CoreProgram, RuleBase, CoreRule, CoreVect )
+import CoreSyn ( CoreProgram, RuleBase, CoreRule )
import Name
import NameEnv
-import NameSet
-import VarEnv
import VarSet
import Var
import Id
@@ -665,13 +659,6 @@ hptInstances hsc_env want_this_module
return (md_insts details, md_fam_insts details)
in (concat insts, concat famInsts)
--- | Get the combined VectInfo of all modules in the home package table. In
--- contrast to instances and rules, we don't care whether the modules are
--- "below" us in the dependency sense. The VectInfo of those modules not "below"
--- us does not affect the compilation of the current module.
-hptVectInfo :: HscEnv -> VectInfo
-hptVectInfo = concatVectInfo . hptAllThings ((: []) . md_vect_info . hm_details)
-
-- | Get rules from modules "below" this one (in the dependency sense)
hptRules :: HscEnv -> [(ModuleName, IsBootInterface)] -> [CoreRule]
hptRules = hptSomeThingsBelowUs (md_rules . hm_details) False
@@ -934,9 +921,7 @@ data ModIface
mi_fam_insts :: [IfaceFamInst], -- ^ Sorted family instances
mi_rules :: [IfaceRule], -- ^ Sorted rules
mi_orphan_hash :: !Fingerprint, -- ^ Hash for orphan rules, class and family
- -- instances, and vectorise pragmas combined
-
- mi_vect_info :: !IfaceVectInfo, -- ^ Vectorisation information
+ -- instances combined
-- Cached environments for easy lookup
-- These are computed (lazily) from other fields
@@ -1040,7 +1025,6 @@ instance Binary ModIface where
mi_fam_insts = fam_insts,
mi_rules = rules,
mi_orphan_hash = orphan_hash,
- mi_vect_info = vect_info,
mi_hpc = hpc_info,
mi_trust = trust,
mi_trust_pkg = trust_pkg,
@@ -1069,7 +1053,6 @@ instance Binary ModIface where
put_ bh fam_insts
lazyPut bh rules
put_ bh orphan_hash
- put_ bh vect_info
put_ bh hpc_info
put_ bh trust
put_ bh trust_pkg
@@ -1100,7 +1083,6 @@ instance Binary ModIface where
fam_insts <- {-# SCC "bin_fam_insts" #-} get bh
rules <- {-# SCC "bin_rules" #-} lazyGet bh
orphan_hash <- get bh
- vect_info <- get bh
hpc_info <- get bh
trust <- get bh
trust_pkg <- get bh
@@ -1131,7 +1113,6 @@ instance Binary ModIface where
mi_fam_insts = fam_insts,
mi_rules = rules,
mi_orphan_hash = orphan_hash,
- mi_vect_info = vect_info,
mi_hpc = hpc_info,
mi_trust = trust,
mi_trust_pkg = trust_pkg,
@@ -1172,7 +1153,6 @@ emptyModIface mod
mi_decls = [],
mi_globals = Nothing,
mi_orphan_hash = fingerprint0,
- mi_vect_info = noIfaceVectInfo,
mi_warn_fn = emptyIfaceWarnCache,
mi_fix_fn = emptyIfaceFixCache,
mi_hash_fn = emptyIfaceHashCache,
@@ -1211,7 +1191,6 @@ data ModDetails
md_rules :: ![CoreRule], -- ^ Domain may include 'Id's from other modules
md_anns :: ![Annotation], -- ^ Annotations present in this module: currently
-- they only annotate things also declared in this module
- md_vect_info :: !VectInfo, -- ^ Module vectorisation information
md_complete_sigs :: [CompleteMatch]
-- ^ Complete match pragmas for this module
}
@@ -1225,7 +1204,6 @@ emptyModDetails
md_rules = [],
md_fam_insts = [],
md_anns = [],
- md_vect_info = noVectInfo,
md_complete_sigs = [] }
-- | Records the modules directly imported by a module for extracting e.g.
@@ -1292,9 +1270,6 @@ data ModGuts
mg_complete_sigs :: [CompleteMatch], -- ^ Complete Matches
mg_hpc_info :: !HpcInfo, -- ^ Coverage tick boxes in the module
mg_modBreaks :: !(Maybe ModBreaks), -- ^ Breakpoints for the module
- mg_vect_decls:: ![CoreVect], -- ^ Vectorisation declarations in this module
- -- (produced by desugarer & consumed by vectoriser)
- mg_vect_info :: !VectInfo, -- ^ Pool of vectorised declarations in the module
-- The next two fields are unusual, because they give instance
-- environments for *all* modules in the home package, including
@@ -2323,7 +2298,6 @@ lookupFixity env n = case lookupNameEnv env n of
-- * A transformation rule in a module other than the one defining
-- the function in the head of the rule
--
--- * A vectorisation pragma
type WhetherHasOrphans = Bool
-- | Does this module define family instances?
@@ -2517,7 +2491,6 @@ type PackageTypeEnv = TypeEnv
type PackageRuleBase = RuleBase
type PackageInstEnv = InstEnv
type PackageFamInstEnv = FamInstEnv
-type PackageVectInfo = VectInfo
type PackageAnnEnv = AnnEnv
type PackageCompleteMatchMap = CompleteMatchMap
@@ -2579,8 +2552,6 @@ data ExternalPackageState
-- from all the external-package modules
eps_rule_base :: !PackageRuleBase, -- ^ The total 'RuleEnv' accumulated
-- from all the external-package modules
- eps_vect_info :: !PackageVectInfo, -- ^ The total 'VectInfo' accumulated
- -- from all the external-package modules
eps_ann_env :: !PackageAnnEnv, -- ^ The total 'AnnEnv' accumulated
-- from all the external-package modules
eps_complete_matches :: !PackageCompleteMatchMap,
@@ -2883,119 +2854,6 @@ isHpcUsed (NoHpcInfo { hpcUsed = used }) = used
{-
************************************************************************
* *
-\subsection{Vectorisation Support}
-* *
-************************************************************************
-
-The following information is generated and consumed by the vectorisation
-subsystem. It communicates the vectorisation status of declarations from one
-module to another.
-
-Why do we need both f and f_v in the ModGuts/ModDetails/EPS version VectInfo
-below? We need to know `f' when converting to IfaceVectInfo. However, during
-vectorisation, we need to know `f_v', whose `Var' we cannot lookup based
-on just the OccName easily in a Core pass.
--}
-
--- |Vectorisation information for 'ModGuts', 'ModDetails' and 'ExternalPackageState'; see also
--- documentation at 'Vectorise.Env.GlobalEnv'.
---
--- NB: The following tables may also include 'Var's, 'TyCon's and 'DataCon's from imported modules,
--- which have been subsequently vectorised in the current module.
---
-data VectInfo
- = VectInfo
- { vectInfoVar :: DVarEnv (Var , Var ) -- ^ @(f, f_v)@ keyed on @f@
- , vectInfoTyCon :: NameEnv (TyCon , TyCon) -- ^ @(T, T_v)@ keyed on @T@
- , vectInfoDataCon :: NameEnv (DataCon, DataCon) -- ^ @(C, C_v)@ keyed on @C@
- , vectInfoParallelVars :: DVarSet -- ^ set of parallel variables
- , vectInfoParallelTyCons :: NameSet -- ^ set of parallel type constructors
- }
-
--- |Vectorisation information for 'ModIface'; i.e, the vectorisation information propagated
--- across module boundaries.
---
--- NB: The field 'ifaceVectInfoVar' explicitly contains the workers of data constructors as well as
--- class selectors — i.e., their mappings are /not/ implicitly generated from the data types.
--- Moreover, whether the worker of a data constructor is in 'ifaceVectInfoVar' determines
--- whether that data constructor was vectorised (or is part of an abstractly vectorised type
--- constructor).
---
-data IfaceVectInfo
- = IfaceVectInfo
- { ifaceVectInfoVar :: [Name] -- ^ All variables in here have a vectorised variant
- , ifaceVectInfoTyCon :: [Name] -- ^ All 'TyCon's in here have a vectorised variant;
- -- the name of the vectorised variant and those of its
- -- data constructors are determined by
- -- 'OccName.mkVectTyConOcc' and
- -- 'OccName.mkVectDataConOcc'; the names of the
- -- isomorphisms are determined by 'OccName.mkVectIsoOcc'
- , ifaceVectInfoTyConReuse :: [Name] -- ^ The vectorised form of all the 'TyCon's in here
- -- coincides with the unconverted form; the name of the
- -- isomorphisms is determined by 'OccName.mkVectIsoOcc'
- , ifaceVectInfoParallelVars :: [Name] -- iface version of 'vectInfoParallelVar'
- , ifaceVectInfoParallelTyCons :: [Name] -- iface version of 'vectInfoParallelTyCon'
- }
-
-noVectInfo :: VectInfo
-noVectInfo
- = VectInfo emptyDVarEnv emptyNameEnv emptyNameEnv emptyDVarSet emptyNameSet
-
-plusVectInfo :: VectInfo -> VectInfo -> VectInfo
-plusVectInfo vi1 vi2 =
- VectInfo (vectInfoVar vi1 `plusDVarEnv` vectInfoVar vi2)
- (vectInfoTyCon vi1 `plusNameEnv` vectInfoTyCon vi2)
- (vectInfoDataCon vi1 `plusNameEnv` vectInfoDataCon vi2)
- (vectInfoParallelVars vi1 `unionDVarSet` vectInfoParallelVars vi2)
- (vectInfoParallelTyCons vi1 `unionNameSet` vectInfoParallelTyCons vi2)
-
-concatVectInfo :: [VectInfo] -> VectInfo
-concatVectInfo = foldr plusVectInfo noVectInfo
-
-noIfaceVectInfo :: IfaceVectInfo
-noIfaceVectInfo = IfaceVectInfo [] [] [] [] []
-
-isNoIfaceVectInfo :: IfaceVectInfo -> Bool
-isNoIfaceVectInfo (IfaceVectInfo l1 l2 l3 l4 l5)
- = null l1 && null l2 && null l3 && null l4 && null l5
-
-instance Outputable VectInfo where
- ppr info = vcat
- [ text "variables :" <+> ppr (vectInfoVar info)
- , text "tycons :" <+> ppr (vectInfoTyCon info)
- , text "datacons :" <+> ppr (vectInfoDataCon info)
- , text "parallel vars :" <+> ppr (vectInfoParallelVars info)
- , text "parallel tycons :" <+> ppr (vectInfoParallelTyCons info)
- ]
-
-instance Outputable IfaceVectInfo where
- ppr info = vcat
- [ text "variables :" <+> ppr (ifaceVectInfoVar info)
- , text "tycons :" <+> ppr (ifaceVectInfoTyCon info)
- , text "tycons reuse :" <+> ppr (ifaceVectInfoTyConReuse info)
- , text "parallel vars :" <+> ppr (ifaceVectInfoParallelVars info)
- , text "parallel tycons :" <+> ppr (ifaceVectInfoParallelTyCons info)
- ]
-
-
-instance Binary IfaceVectInfo where
- put_ bh (IfaceVectInfo a1 a2 a3 a4 a5) = do
- put_ bh a1
- put_ bh a2
- put_ bh a3
- put_ bh a4
- put_ bh a5
- get bh = do
- a1 <- get bh
- a2 <- get bh
- a3 <- get bh
- a4 <- get bh
- a5 <- get bh
- return (IfaceVectInfo a1 a2 a3 a4 a5)
-
-{-
-************************************************************************
-* *
\subsection{Safe Haskell Support}
* *
************************************************************************
diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs
index f27e597a39..008e9b5da0 100644
--- a/compiler/main/Packages.hs
+++ b/compiler/main/Packages.hs
@@ -911,15 +911,6 @@ packageFlagErr :: DynFlags
-> PackageFlag
-> [(PackageConfig, UnusablePackageReason)]
-> IO a
-
--- for missing DPH package we emit a more helpful error message, because
--- this may be the result of using -fdph-par or -fdph-seq.
-packageFlagErr dflags (ExposePackage _ (PackageArg pkg) _) []
- | is_dph_package pkg
- = throwGhcExceptionIO (CmdLineError (showSDoc dflags $ dph_err))
- where dph_err = text "the " <> text pkg <> text " package is not installed."
- $$ text "To install it: \"cabal install dph\"."
- is_dph_package pkg = "dph" `isPrefixOf` pkg
packageFlagErr dflags flag reasons
= packageFlagErr' dflags (pprFlag flag) reasons
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs
index ce8ac53919..1728bc0a69 100644
--- a/compiler/main/TidyPgm.hs
+++ b/compiler/main/TidyPgm.hs
@@ -61,7 +61,6 @@ import Maybes
import UniqSupply
import ErrUtils (Severity(..))
import Outputable
-import UniqDFM
import SrcLoc
import qualified ErrUtils as Err
@@ -71,7 +70,7 @@ import Data.List ( sortBy )
import Data.IORef ( atomicModifyIORef' )
{-
-Constructing the TypeEnv, Instances, Rules, VectInfo from which the
+Constructing the TypeEnv, Instances, Rules from which the
ModIface is constructed, and which goes on to subsequent modules in
--make mode.
@@ -165,7 +164,6 @@ mkBootModDetailsTc hsc_env
, md_rules = []
, md_anns = []
, md_exports = exports
- , md_vect_info = noVectInfo
, md_complete_sigs = []
})
}
@@ -246,9 +244,8 @@ First we figure out which Ids are "external" Ids. An
unit. These are
a) the user exported ones
b) the ones bound to static forms
- c) ones mentioned in the unfoldings, workers,
- rules of externally-visible ones ,
- or vectorised versions of externally-visible ones
+ c) ones mentioned in the unfoldings, workers, or
+ rules of externally-visible ones
While figuring out which Ids are external, we pick a "tidy" OccName
for each one. That is, we make its OccName distinct from the other
@@ -324,7 +321,6 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
, mg_binds = binds
, mg_patsyns = patsyns
, mg_rules = imp_rules
- , mg_vect_info = vect_info
, mg_anns = anns
, mg_complete_sigs = complete_sigs
, mg_deps = deps
@@ -351,7 +347,7 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
; (unfold_env, tidy_occ_env)
<- chooseExternalIds hsc_env mod omit_prags expose_all
- binds implicit_binds imp_rules (vectInfoVar vect_info)
+ binds implicit_binds imp_rules
; let { (trimmed_binds, trimmed_rules)
= findExternalRules omit_prags binds imp_rules unfold_env }
@@ -373,8 +369,6 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
-- and indeed it does, but if omit_prags is on, ext_rules is
-- empty
- ; tidy_vect_info = tidyVectInfo tidy_env vect_info
-
-- Tidy the Ids inside each PatSyn, very similarly to DFunIds
-- and then override the PatSyns in the type_env with the new tidy ones
-- This is really the only reason we keep mg_patsyns at all; otherwise
@@ -444,7 +438,6 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
ModDetails { md_types = tidy_type_env,
md_rules = tidy_rules,
md_insts = tidy_cls_insts,
- md_vect_info = tidy_vect_info,
md_fam_insts = fam_insts,
md_exports = exports,
md_anns = anns, -- are already tidy
@@ -493,38 +486,6 @@ extendTypeEnvWithPatSyns :: [PatSyn] -> TypeEnv -> TypeEnv
extendTypeEnvWithPatSyns tidy_patsyns type_env
= extendTypeEnvList type_env [AConLike (PatSynCon ps) | ps <- tidy_patsyns ]
-tidyVectInfo :: TidyEnv -> VectInfo -> VectInfo
-tidyVectInfo (_, var_env) info@(VectInfo { vectInfoVar = vars
- , vectInfoParallelVars = parallelVars
- })
- = info { vectInfoVar = tidy_vars
- , vectInfoParallelVars = tidy_parallelVars
- }
- where
- -- we only export mappings whose domain and co-domain is exported (otherwise, the iface is
- -- inconsistent)
- tidy_vars = mkDVarEnv [ (tidy_var, (tidy_var, tidy_var_v))
- | (var, var_v) <- eltsUDFM vars
- , let tidy_var = lookup_var var
- tidy_var_v = lookup_var var_v
- , isExternalId tidy_var && isExportedId tidy_var
- , isExternalId tidy_var_v && isExportedId tidy_var_v
- , isDataConWorkId var || not (isImplicitId var)
- ]
-
- tidy_parallelVars = mkDVarSet
- [ tidy_var
- | var <- dVarSetElems parallelVars
- , let tidy_var = lookup_var var
- , isExternalId tidy_var && isExportedId tidy_var
- ]
-
- lookup_var var = lookupWithDefaultVarEnv var_env var var
-
- -- We need to make sure that all names getting into the iface version of 'VectInfo' are
- -- external; otherwise, 'MkIface' will bomb out.
- isExternalId = isExternalName . idName
-
{-
Note [Don't attempt to trim data types]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -641,11 +602,10 @@ chooseExternalIds :: HscEnv
-> [CoreBind]
-> [CoreBind]
-> [CoreRule]
- -> DVarEnv (Var, Var)
-> IO (UnfoldEnv, TidyOccEnv)
-- Step 1 from the notes above
-chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_rules vect_vars
+chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_rules
= do { (unfold_env1,occ_env1) <- search init_work_list emptyVarEnv init_occ_env
; let internal_ids = filter (not . (`elemVarEnv` unfold_env1)) binders
; tidy_internal internal_ids unfold_env1 occ_env1 }
@@ -665,13 +625,10 @@ chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_
-- An Id should be external if either (a) it is exported,
-- (b) it appears in the RHS of a local rule for an imported Id, or
- -- (c) it is the vectorised version of an imported Id.
-- See Note [Which rules to expose]
is_external id = isExportedId id || id `elemVarSet` rule_rhs_vars
- || id `elemVarSet` vect_var_vs
rule_rhs_vars = mapUnionVarSet ruleRhsFreeVars imp_id_rules
- vect_var_vs = mkVarSet [var_v | (var, var_v) <- eltsUDFM vect_vars, isGlobalId var]
binders = map fst $ flattenBinds binds
implicit_binders = bindersOfBinds implicit_binds
@@ -721,9 +678,6 @@ chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_
| omit_prags = ([], False)
| otherwise = addExternal expose_all refined_id
- -- add vectorised version if any exists
- new_ids' = new_ids ++ maybeToList (fmap snd $ lookupDVarEnv vect_vars idocc)
-
-- 'idocc' is an *occurrence*, but we need to see the
-- unfolding in the *definition*; so look up in binder_set
refined_id = case lookupVarSet binder_set idocc of
@@ -734,7 +688,7 @@ chooseExternalIds hsc_env mod omit_prags expose_all binds implicit_binds imp_id_
referrer' | isExportedId refined_id = refined_id
| otherwise = referrer
--
- search (zip new_ids' (repeat referrer') ++ rest) unfold_env' occ_env'
+ search (zip new_ids (repeat referrer') ++ rest) unfold_env' occ_env'
tidy_internal :: [Id] -> UnfoldEnv -> TidyOccEnv
-> IO (UnfoldEnv, TidyOccEnv)
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index 83beef210d..fc8b988332 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -371,11 +371,6 @@ $tab { warnTab }
-- "special" symbols
<0> {
- "[:" / { ifExtension parrEnabled } { token ITopabrack }
- ":]" / { ifExtension parrEnabled } { token ITcpabrack }
-}
-
-<0> {
"[|" / { ifExtension thQuotesEnabled } { token (ITopenExpQuote NoE
NormalSyntax) }
"[||" / { ifExtension thQuotesEnabled } { token (ITopenTExpQuote NoE) }
@@ -665,9 +660,6 @@ data Token
| IToptions_prag String
| ITinclude_prag String
| ITlanguage_prag
- | ITvect_prag SourceText
- | ITvect_scalar_prag SourceText
- | ITnovect_prag SourceText
| ITminimal_prag SourceText
| IToverlappable_prag SourceText -- instance overlap mode
| IToverlapping_prag SourceText -- instance overlap mode
@@ -2230,7 +2222,6 @@ data ExtBits
= FfiBit
| InterruptibleFfiBit
| CApiFfiBit
- | ParrBit
| ArrowsBit
| ThBit
| ThQuotesBit
@@ -2271,8 +2262,6 @@ data ExtBits
always :: ExtsBitmap -> Bool
always _ = True
-parrEnabled :: ExtsBitmap -> Bool
-parrEnabled = xtest ParrBit
arrowsEnabled :: ExtsBitmap -> Bool
arrowsEnabled = xtest ArrowsBit
thEnabled :: ExtsBitmap -> Bool
@@ -2357,7 +2346,6 @@ mkParserFlags flags =
bitmap = FfiBit `setBitIf` xopt LangExt.ForeignFunctionInterface flags
.|. InterruptibleFfiBit `setBitIf` xopt LangExt.InterruptibleFFI flags
.|. CApiFfiBit `setBitIf` xopt LangExt.CApiFFI flags
- .|. ParrBit `setBitIf` xopt LangExt.ParallelArrays flags
.|. ArrowsBit `setBitIf` xopt LangExt.Arrows flags
.|. ThBit `setBitIf` xopt LangExt.TemplateHaskell flags
.|. ThQuotesBit `setBitIf` xopt LangExt.TemplateHaskellQuotes flags
@@ -2878,8 +2866,6 @@ oneWordPrags = Map.fromList [
("unpack", strtoken (\s -> ITunpack_prag (SourceText s))),
("nounpack", strtoken (\s -> ITnounpack_prag (SourceText s))),
("ann", strtoken (\s -> ITann_prag (SourceText s))),
- ("vectorize", strtoken (\s -> ITvect_prag (SourceText s))),
- ("novectorize", strtoken (\s -> ITnovect_prag (SourceText s))),
("minimal", strtoken (\s -> ITminimal_prag (SourceText s))),
("overlaps", strtoken (\s -> IToverlaps_prag (SourceText s))),
("overlappable", strtoken (\s -> IToverlappable_prag (SourceText s))),
@@ -2890,7 +2876,7 @@ oneWordPrags = Map.fromList [
("column", columnPrag)
]
-twoWordPrags = Map.fromList([
+twoWordPrags = Map.fromList [
("inline conlike",
strtoken (\s -> (ITinline_prag (SourceText s) Inline ConLike))),
("notinline conlike",
@@ -2898,9 +2884,8 @@ twoWordPrags = Map.fromList([
("specialize inline",
strtoken (\s -> (ITspec_inline_prag (SourceText s) True))),
("specialize notinline",
- strtoken (\s -> (ITspec_inline_prag (SourceText s) False))),
- ("vectorize scalar",
- strtoken (\s -> ITvect_scalar_prag (SourceText s)))])
+ strtoken (\s -> (ITspec_inline_prag (SourceText s) False)))
+ ]
dispatch_pragmas :: Map String Action -> Action
dispatch_pragmas prags span buf len = case Map.lookup (clean_pragma (lexemeToString buf len)) prags of
@@ -2922,8 +2907,6 @@ clean_pragma prag = canon_ws (map toLower (unprefix prag))
canonical prag' = case prag' of
"noinline" -> "notinline"
"specialise" -> "specialize"
- "vectorise" -> "vectorize"
- "novectorise" -> "novectorize"
"constructorlike" -> "conlike"
_ -> prag'
canon_ws s = unwords (map canonical (words s))
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index c6face8be2..533e21d0d1 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -79,7 +79,7 @@ import TysPrim ( eqPrimTyCon )
import PrelNames ( eqTyCon_RDR )
import TysWiredIn ( unitTyCon, unitDataCon, tupleTyCon, tupleDataCon, nilDataCon,
unboxedUnitTyCon, unboxedUnitDataCon,
- listTyCon_RDR, parrTyCon_RDR, consDataCon_RDR )
+ listTyCon_RDR, consDataCon_RDR )
-- compiler/utils
import Util ( looksLikePackageName )
@@ -88,7 +88,7 @@ import GhcPrelude
import qualified GHC.LanguageExtensions as LangExt
}
-%expect 233 -- shift/reduce conflicts
+%expect 229 -- shift/reduce conflicts
{- Last updated: 14 Apr 2018
@@ -502,9 +502,6 @@ are the most common patterns, rewritten as regular expressions for clarity:
'{-# UNPACK' { L _ (ITunpack_prag _) }
'{-# NOUNPACK' { L _ (ITnounpack_prag _) }
'{-# ANN' { L _ (ITann_prag _) }
- '{-# VECTORISE' { L _ (ITvect_prag _) }
- '{-# VECTORISE_SCALAR' { L _ (ITvect_scalar_prag _) }
- '{-# NOVECTORISE' { L _ (ITnovect_prag _) }
'{-# MINIMAL' { L _ (ITminimal_prag _) }
'{-# CTYPE' { L _ (ITctype _) }
'{-# OVERLAPPING' { L _ (IToverlapping_prag _) }
@@ -1040,33 +1037,6 @@ topdecl :: { LHsDecl GhcPs }
[mo $1,mc $3] }
| '{-# RULES' rules '#-}' {% ams (sLL $1 $> $ RuleD noExt (HsRules noExt (getRULES_PRAGs $1) (fromOL $2)))
[mo $1,mc $3] }
- | '{-# VECTORISE' qvar '=' exp '#-}' {% ams (sLL $1 $> $ VectD noExt (HsVect noExt (getVECT_PRAGs $1) $2 $4))
- [mo $1,mj AnnEqual $3
- ,mc $5] }
- | '{-# NOVECTORISE' qvar '#-}' {% ams (sLL $1 $> $ VectD noExt (HsNoVect noExt (getNOVECT_PRAGs $1) $2))
- [mo $1,mc $3] }
- | '{-# VECTORISE' 'type' gtycon '#-}'
- {% ams (sLL $1 $> $
- VectD noExt (HsVectType (VectTypePR (getVECT_PRAGs $1) $3 Nothing) False))
- [mo $1,mj AnnType $2,mc $4] }
-
- | '{-# VECTORISE_SCALAR' 'type' gtycon '#-}'
- {% ams (sLL $1 $> $
- VectD noExt (HsVectType (VectTypePR (getVECT_SCALAR_PRAGs $1) $3 Nothing) True))
- [mo $1,mj AnnType $2,mc $4] }
-
- | '{-# VECTORISE' 'type' gtycon '=' gtycon '#-}'
- {% ams (sLL $1 $> $
- VectD noExt (HsVectType (VectTypePR (getVECT_PRAGs $1) $3 (Just $5)) False))
- [mo $1,mj AnnType $2,mj AnnEqual $4,mc $6] }
- | '{-# VECTORISE_SCALAR' 'type' gtycon '=' gtycon '#-}'
- {% ams (sLL $1 $> $
- VectD noExt (HsVectType (VectTypePR (getVECT_SCALAR_PRAGs $1) $3 (Just $5)) True))
- [mo $1,mj AnnType $2,mj AnnEqual $4,mc $6] }
-
- | '{-# VECTORISE' 'class' gtycon '#-}'
- {% ams (sLL $1 $> $ VectD noExt (HsVectClass (VectClassPR (getVECT_PRAGs $1) $3)))
- [mo $1,mj AnnClass $2,mc $4] }
| annotation { $1 }
| decl_no_th { $1 }
@@ -1968,9 +1938,8 @@ atype :: { LHsType GhcPs }
[mo $1,mc $3] }
| '(#' bar_types2 '#)' {% ams (sLL $1 $> $ HsSumTy noExt $2)
[mo $1,mc $3] }
- | '[' ctype ']' {% ams (sLL $1 $> $ HsListTy noExt $2) [mos $1,mcs $3] }
- | '[:' ctype ':]' {% ams (sLL $1 $> $ HsPArrTy noExt $2) [mo $1,mc $3] }
- | '(' ctype ')' {% ams (sLL $1 $> $ HsParTy noExt $2) [mop $1,mcp $3] }
+ | '[' ctype ']' {% ams (sLL $1 $> $ HsListTy noExt $2) [mos $1,mcs $3] }
+ | '(' ctype ')' {% ams (sLL $1 $> $ HsParTy noExt $2) [mop $1,mcp $3] }
| '(' ctype '::' kind ')' {% ams (sLL $1 $> $ HsKindSig noExt $2 $4)
[mop $1,mu AnnDcolon $3,mcp $5] }
| quasiquote { sL1 $1 (HsSpliceTy noExt (unLoc $1) ) }
@@ -2628,7 +2597,6 @@ aexp2 :: { LHsExpr GhcPs }
; ams (sLL $1 $> e) ((mo $1:fst $2) ++ [mc $3]) } }
| '[' list ']' {% ams (sLL $1 $> (snd $2)) (mos $1:mcs $3:(fst $2)) }
- | '[:' parr ':]' {% ams (sLL $1 $> (snd $2)) (mo $1:mc $3:(fst $2)) }
| '_' { sL1 $1 $ EWildPat noExt }
-- Template Haskell Extension
@@ -2834,28 +2802,6 @@ transformqual :: { Located ([AddAnn],[LStmt GhcPs (LHsExpr GhcPs)] -> Stmt GhcPs
-- in by choosing the "group by" variant, which is what we want.
-----------------------------------------------------------------------------
--- Parallel array expressions
-
--- The rules below are little bit contorted; see the list case for details.
--- Note that, in contrast to lists, we only have finite arithmetic sequences.
--- Moreover, we allow explicit arrays with no element (represented by the nil
--- constructor in the list case).
-
-parr :: { ([AddAnn],HsExpr GhcPs) }
- : { ([],ExplicitPArr noExt []) }
- | texp { ([],ExplicitPArr noExt [$1]) }
- | lexps { ([],ExplicitPArr noExt (reverse (unLoc $1))) }
- | texp '..' exp { ([mj AnnDotdot $2]
- ,PArrSeq noExt (FromTo $1 $3)) }
- | texp ',' exp '..' exp
- { ([mj AnnComma $2,mj AnnDotdot $4]
- ,PArrSeq noExt (FromThenTo $1 $3 $5)) }
- | texp '|' flattenedpquals
- { ([mj AnnVbar $2],mkHsComp PArrComp (unLoc $3) $1) }
-
--- We are reusing `lexps' and `flattenedpquals' from the list case.
-
------------------------------------------------------------------------------
-- Guards
guardquals :: { Located [LStmt GhcPs (LHsExpr GhcPs)] }
@@ -3114,8 +3060,6 @@ gen_qcon :: { Located RdrName }
| '(' qconsym ')' {% ams (sLL $1 $> (unLoc $2))
[mop $1,mj AnnVal $2,mcp $3] }
--- The case of '[:' ':]' is part of the production `parr'
-
con :: { Located RdrName }
: conid { $1 }
| '(' consym ')' {% ams (sLL $1 $> (unLoc $2))
@@ -3175,7 +3119,6 @@ ntgtycon :: { Located RdrName } -- A "general" qualified tycon, excluding unit
| '(' '->' ')' {% ams (sLL $1 $> $ getRdrName funTyCon)
[mop $1,mu AnnRarrow $2,mcp $3] }
| '[' ']' {% ams (sLL $1 $> $ listTyCon_RDR) [mos $1,mcs $2] }
- | '[:' ':]' {% ams (sLL $1 $> $ parrTyCon_RDR) [mo $1,mc $2] }
| '(' '~#' ')' {% ams (sLL $1 $> $ getRdrName eqPrimTyCon)
[mop $1,mj AnnTildehsh $2,mcp $3] }
@@ -3555,9 +3498,6 @@ getCORE_PRAGs (L _ (ITcore_prag src)) = src
getUNPACK_PRAGs (L _ (ITunpack_prag src)) = src
getNOUNPACK_PRAGs (L _ (ITnounpack_prag src)) = src
getANN_PRAGs (L _ (ITann_prag src)) = src
-getVECT_PRAGs (L _ (ITvect_prag src)) = src
-getVECT_SCALAR_PRAGs (L _ (ITvect_scalar_prag src)) = src
-getNOVECT_PRAGs (L _ (ITnovect_prag src)) = src
getMINIMAL_PRAGs (L _ (ITminimal_prag src)) = src
getOVERLAPPABLE_PRAGs (L _ (IToverlappable_prag src)) = src
getOVERLAPPING_PRAGs (L _ (IToverlapping_prag src)) = src
diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs
index b887440389..dfcccd369e 100644
--- a/compiler/parser/RdrHsSyn.hs
+++ b/compiler/parser/RdrHsSyn.hs
@@ -1012,11 +1012,10 @@ checkAPat msg loc e0 = do
OpApp {} -> patFail msg loc e0
- HsPar _ e -> checkLPat msg e >>= (return . (ParPat noExt))
ExplicitList _ _ es -> do ps <- mapM (checkLPat msg) es
return (ListPat noExt ps)
- ExplicitPArr _ es -> do ps <- mapM (checkLPat msg) es
- return (PArrPat noExt ps)
+
+ HsPar _ e -> checkLPat msg e >>= (return . (ParPat noExt))
ExplicitTuple _ es b
| all tupArgPresent es -> do ps <- mapM (checkLPat msg)
diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs
index fd324cb43e..88541120ca 100644
--- a/compiler/prelude/PrelNames.hs
+++ b/compiler/prelude/PrelNames.hs
@@ -543,9 +543,6 @@ dATA_TYPE_EQUALITY = mkBaseModule (fsLit "Data.Type.Equality")
dATA_COERCE = mkBaseModule (fsLit "Data.Coerce")
dEBUG_TRACE = mkBaseModule (fsLit "Debug.Trace")
-gHC_PARR' :: Module
-gHC_PARR' = mkBaseModule (fsLit "GHC.PArr")
-
gHC_SRCLOC :: Module
gHC_SRCLOC = mkBaseModule (fsLit "GHC.SrcLoc")
@@ -1744,10 +1741,6 @@ funPtrTyConKey = mkPreludeTyConUnique 76
tVarPrimTyConKey = mkPreludeTyConUnique 77
compactPrimTyConKey = mkPreludeTyConUnique 78
--- Parallel array type constructor
-parrTyConKey :: Unique
-parrTyConKey = mkPreludeTyConUnique 82
-
-- dotnet interop
objectTyConKey :: Unique
objectTyConKey = mkPreludeTyConUnique 83
@@ -1938,10 +1931,6 @@ inlDataConKey = mkPreludeDataConUnique 21
inrDataConKey = mkPreludeDataConUnique 22
genUnitDataConKey = mkPreludeDataConUnique 23
--- Data constructor for parallel arrays
-parrDataConKey :: Unique
-parrDataConKey = mkPreludeDataConUnique 24
-
leftDataConKey, rightDataConKey :: Unique
leftDataConKey = mkPreludeDataConUnique 25
rightDataConKey = mkPreludeDataConUnique 26
diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs
index 72c24edc3c..0817a75898 100644
--- a/compiler/prelude/TysWiredIn.hs
+++ b/compiler/prelude/TysWiredIn.hs
@@ -95,11 +95,6 @@ module TysWiredIn (
unicodeStarKindTyCon, unicodeStarKindTyConName,
liftedTypeKindTyCon, constraintKindTyCon,
- -- * Parallel arrays
- mkPArrTy,
- parrTyCon, parrFakeCon, isPArrTyCon, isPArrFakeCon,
- parrTyCon_RDR, parrTyConName,
-
-- * Equality predicates
heqTyCon, heqClass, heqDataCon,
coercibleTyCon, coercibleTyConName, coercibleDataCon, coercibleClass,
@@ -220,7 +215,6 @@ wiredInTyCons = [ -- Units are not treated like other tuples, because then
, word8TyCon
, listTyCon
, maybeTyCon
- , parrTyCon
, heqTyCon
, coercibleTyCon
, typeNatKindCon
@@ -445,14 +439,8 @@ vecElemDataConNames = zipWith3Lazy mk_special_dc_name
mk_special_dc_name :: FastString -> Unique -> DataCon -> Name
mk_special_dc_name fs u dc = mkWiredInDataConName UserSyntax gHC_TYPES fs u dc
-parrTyConName, parrDataConName :: Name
-parrTyConName = mkWiredInTyConName BuiltInSyntax
- gHC_PARR' (fsLit "[::]") parrTyConKey parrTyCon
-parrDataConName = mkWiredInDataConName UserSyntax
- gHC_PARR' (fsLit "PArr") parrDataConKey parrDataCon
-
boolTyCon_RDR, false_RDR, true_RDR, intTyCon_RDR, charTyCon_RDR,
- intDataCon_RDR, listTyCon_RDR, consDataCon_RDR, parrTyCon_RDR :: RdrName
+ intDataCon_RDR, listTyCon_RDR, consDataCon_RDR :: RdrName
boolTyCon_RDR = nameRdrName boolTyConName
false_RDR = nameRdrName falseDataConName
true_RDR = nameRdrName trueDataConName
@@ -461,7 +449,6 @@ charTyCon_RDR = nameRdrName charTyConName
intDataCon_RDR = nameRdrName intDataConName
listTyCon_RDR = nameRdrName listTyConName
consDataCon_RDR = nameRdrName consDataConName
-parrTyCon_RDR = nameRdrName parrTyConName
{-
************************************************************************
@@ -692,8 +679,6 @@ isBuiltInOcc_maybe occ =
"[]" -> Just $ choose_ns listTyConName nilDataConName
":" -> Just consDataConName
- "[::]" -> Just parrTyConName
-
-- boxed tuple data/tycon
"()" -> Just $ tup_name Boxed 0
_ | Just rest <- "(" `BS.stripPrefix` name
@@ -1518,78 +1503,6 @@ mkSumTy :: [Type] -> Type
mkSumTy tys = mkTyConApp (sumTyCon (length tys))
(map getRuntimeRep tys ++ tys)
-{- *********************************************************************
-* *
- The parallel-array type, [::]
-* *
-************************************************************************
-
-Special syntax for parallel arrays needs some wired in definitions.
--}
-
--- | Construct a type representing the application of the parallel array constructor
-mkPArrTy :: Type -> Type
-mkPArrTy ty = mkTyConApp parrTyCon [ty]
-
--- | Represents the type constructor of parallel arrays
---
--- * This must match the definition in @PrelPArr@
---
--- NB: Although the constructor is given here, it will not be accessible in
--- user code as it is not in the environment of any compiled module except
--- @PrelPArr@.
---
-parrTyCon :: TyCon
-parrTyCon = pcTyCon parrTyConName Nothing alpha_tyvar [parrDataCon]
-
-parrDataCon :: DataCon
-parrDataCon = pcDataCon
- parrDataConName
- alpha_tyvar -- forall'ed type variables
- [intTy, -- 1st argument: Int
- mkTyConApp -- 2nd argument: Array# a
- arrayPrimTyCon
- alpha_ty]
- parrTyCon
-
--- | Check whether a type constructor is the constructor for parallel arrays
-isPArrTyCon :: TyCon -> Bool
-isPArrTyCon tc = tyConName tc == parrTyConName
-
--- | Fake array constructors
---
--- * These constructors are never really used to represent array values;
--- however, they are very convenient during desugaring (and, in particular,
--- in the pattern matching compiler) to treat array pattern just like
--- yet another constructor pattern
---
-parrFakeCon :: Arity -> DataCon
-parrFakeCon i | i > mAX_TUPLE_SIZE = mkPArrFakeCon i -- build one specially
-parrFakeCon i = parrFakeConArr!i
-
--- pre-defined set of constructors
---
-parrFakeConArr :: Array Int DataCon
-parrFakeConArr = array (0, mAX_TUPLE_SIZE) [(i, mkPArrFakeCon i)
- | i <- [0..mAX_TUPLE_SIZE]]
-
--- build a fake parallel array constructor for the given arity
---
-mkPArrFakeCon :: Int -> DataCon
-mkPArrFakeCon arity = data_con
- where
- data_con = pcDataCon name [tyvar] tyvarTys parrTyCon
- tyvar = head alphaTyVars
- tyvarTys = replicate arity $ mkTyVarTy tyvar
- nameStr = mkFastString ("MkPArr" ++ show arity)
- name = mkWiredInName gHC_PARR' (mkDataOccFS nameStr) unique
- (AConLike (RealDataCon data_con)) UserSyntax
- unique = mkPArrDataConUnique arity
-
--- | Checks whether a data constructor is a fake constructor for parallel arrays
-isPArrFakeCon :: DataCon -> Bool
-isPArrFakeCon dcon = dcon == parrFakeCon (dataConSourceArity dcon)
-
-- Promoted Booleans
promotedFalseDataCon, promotedTrueDataCon :: TyCon
diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs
index 8478ab0322..937ffaf248 100644
--- a/compiler/rename/RnExpr.hs
+++ b/compiler/rename/RnExpr.hs
@@ -272,10 +272,6 @@ rnExpr (ExplicitList x _ exps)
else
return (ExplicitList x Nothing exps', fvs) }
-rnExpr (ExplicitPArr x exps)
- = do { (exps', fvs) <- rnExprs exps
- ; return (ExplicitPArr x exps', fvs) }
-
rnExpr (ExplicitTuple x tup_args boxity)
= do { checkTupleSection tup_args
; checkTupSize (length tup_args)
@@ -342,10 +338,6 @@ rnExpr (ArithSeq x _ seq)
else
return (ArithSeq x Nothing new_seq, fvs) }
-rnExpr (PArrSeq x seq)
- = do { (new_seq, fvs) <- rnArithSeq seq
- ; return (PArrSeq x new_seq, fvs) }
-
{-
These three are pattern syntax appearing in expressions.
Since all the symbols are reservedops we can simply reject them.
@@ -841,7 +833,7 @@ rnStmt ctxt rnBody (L loc (BodyStmt _ body _ _)) thing_inside
; (guard_op, fvs2) <- if isListCompExpr ctxt
then lookupStmtName ctxt guardMName
else return (noSyntaxExpr, emptyFVs)
- -- Only list/parr/monad comprehensions use 'guard'
+ -- Only list/monad comprehensions use 'guard'
-- Also for sub-stmts of same eg [ e | x<-xs, gd | blah ]
-- Here "gd" is a guard
; (thing, fvs3) <- thing_inside []
@@ -1020,12 +1012,11 @@ lookupStmtNamePoly ctxt name
not_rebindable = return (HsVar noExt (noLoc name), emptyFVs)
-- | Is this a context where we respect RebindableSyntax?
--- but ListComp/PArrComp are never rebindable
+-- but ListComp are never rebindable
-- Neither is ArrowExpr, which has its own desugarer in DsArrows
rebindableContext :: HsStmtContext Name -> Bool
rebindableContext ctxt = case ctxt of
ListComp -> False
- PArrComp -> False
ArrowExpr -> False
PatGuard {} -> False
@@ -1818,7 +1809,6 @@ isStrictPattern (L _ pat) =
ListPat{} -> True
TuplePat{} -> True
SumPat{} -> True
- PArrPat{} -> True
ConPatIn{} -> True
ConPatOut{} -> True
LitPat{} -> True
@@ -1977,7 +1967,6 @@ checkLastStmt ctxt lstmt@(L loc stmt)
= case ctxt of
ListComp -> check_comp
MonadComp -> check_comp
- PArrComp -> check_comp
ArrowExpr -> check_do
DoExpr -> check_do
MDoExpr -> check_do
@@ -2028,7 +2017,7 @@ pprStmtCat (XStmtLR {}) = panic "pprStmtCat: XStmtLR"
emptyInvalid :: Validity -- Payload is the empty document
emptyInvalid = NotValid Outputable.empty
-okStmt, okDoStmt, okCompStmt, okParStmt, okPArrStmt
+okStmt, okDoStmt, okCompStmt, okParStmt
:: DynFlags -> HsStmtContext Name
-> Stmt GhcPs (Located (body GhcPs)) -> Validity
-- Return Nothing if OK, (Just extra) if not ok
@@ -2044,7 +2033,6 @@ okStmt dflags ctxt stmt
GhciStmtCtxt -> okDoStmt dflags ctxt stmt
ListComp -> okCompStmt dflags ctxt stmt
MonadComp -> okCompStmt dflags ctxt stmt
- PArrComp -> okPArrStmt dflags ctxt stmt
TransStmtCtxt ctxt -> okStmt dflags ctxt stmt
-------------
@@ -2091,21 +2079,6 @@ okCompStmt dflags _ stmt
ApplicativeStmt {} -> emptyInvalid
XStmtLR{} -> panic "okCompStmt"
-----------------
-okPArrStmt dflags _ stmt
- = case stmt of
- BindStmt {} -> IsValid
- LetStmt {} -> IsValid
- BodyStmt {} -> IsValid
- ParStmt {}
- | LangExt.ParallelListComp `xopt` dflags -> IsValid
- | otherwise -> NotValid (text "Use ParallelListComp")
- TransStmt {} -> emptyInvalid
- RecStmt {} -> emptyInvalid
- LastStmt {} -> emptyInvalid -- Should not happen (dealt with by checkLastStmt)
- ApplicativeStmt {} -> emptyInvalid
- XStmtLR{} -> panic "okPArrStmt"
-
---------
checkTupleSection :: [LHsTupArg GhcPs] -> RnM ()
checkTupleSection args
diff --git a/compiler/rename/RnPat.hs b/compiler/rename/RnPat.hs
index 8f7c2e2309..4601b948d2 100644
--- a/compiler/rename/RnPat.hs
+++ b/compiler/rename/RnPat.hs
@@ -483,10 +483,6 @@ rnPatAndThen mk (ListPat _ pats)
; return (ListPat (Just to_list_name) pats')}
False -> return (ListPat Nothing pats') }
-rnPatAndThen mk (PArrPat x pats)
- = do { pats' <- rnLPatsAndThen mk pats
- ; return (PArrPat x pats') }
-
rnPatAndThen mk (TuplePat x pats boxed)
= do { liftCps $ checkTupSize (length pats)
; pats' <- rnLPatsAndThen mk pats
diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs
index 502be23bc0..5e01f285b4 100644
--- a/compiler/rename/RnSource.hs
+++ b/compiler/rename/RnSource.hs
@@ -99,7 +99,6 @@ rnSrcDecls group@(HsGroup { hs_valds = val_decls,
hs_fords = foreign_decls,
hs_defds = default_decls,
hs_ruleds = rule_decls,
- hs_vects = vect_decls,
hs_docs = docs })
= do {
-- (A) Process the fixity declarations, creating a mapping from
@@ -187,12 +186,11 @@ rnSrcDecls group@(HsGroup { hs_valds = val_decls,
(rn_rule_decls, src_fvs2) <- setXOptM LangExt.ScopedTypeVariables $
rnList rnHsRuleDecls rule_decls ;
-- Inside RULES, scoped type variables are on
- (rn_vect_decls, src_fvs3) <- rnList rnHsVectDecl vect_decls ;
- (rn_foreign_decls, src_fvs4) <- rnList rnHsForeignDecl foreign_decls ;
- (rn_ann_decls, src_fvs5) <- rnList rnAnnDecl ann_decls ;
- (rn_default_decls, src_fvs6) <- rnList rnDefaultDecl default_decls ;
- (rn_deriv_decls, src_fvs7) <- rnList rnSrcDerivDecl deriv_decls ;
- (rn_splice_decls, src_fvs8) <- rnList rnSpliceDecl splice_decls ;
+ (rn_foreign_decls, src_fvs3) <- rnList rnHsForeignDecl foreign_decls ;
+ (rn_ann_decls, src_fvs4) <- rnList rnAnnDecl ann_decls ;
+ (rn_default_decls, src_fvs5) <- rnList rnDefaultDecl default_decls ;
+ (rn_deriv_decls, src_fvs6) <- rnList rnSrcDerivDecl deriv_decls ;
+ (rn_splice_decls, src_fvs7) <- rnList rnSpliceDecl splice_decls ;
-- Haddock docs; no free vars
rn_docs <- mapM (wrapLocM rnDocDecl) docs ;
@@ -210,13 +208,12 @@ rnSrcDecls group@(HsGroup { hs_valds = val_decls,
hs_annds = rn_ann_decls,
hs_defds = rn_default_decls,
hs_ruleds = rn_rule_decls,
- hs_vects = rn_vect_decls,
hs_docs = rn_docs } ;
tcf_bndrs = hsTyClForeignBinders rn_tycl_decls rn_foreign_decls ;
other_def = (Just (mkNameSet tcf_bndrs), emptyNameSet) ;
- other_fvs = plusFVs [src_fvs1, src_fvs2, src_fvs3, src_fvs4, src_fvs5,
- src_fvs6, src_fvs7, src_fvs8] ;
+ other_fvs = plusFVs [src_fvs1, src_fvs2, src_fvs3, src_fvs4,
+ src_fvs5, src_fvs6, src_fvs7] ;
-- It is tiresome to gather the binders from type and class decls
src_dus = [other_def] `plusDU` bind_dus `plusDU` usesOnly other_fvs ;
@@ -1106,53 +1103,6 @@ badRuleLhsErr name lhs bad_e
HsUnboundVar _ uv -> text "Not in scope:" <+> ppr uv
_ -> text "Illegal expression:" <+> ppr bad_e
-{-
-*********************************************************
-* *
-\subsection{Vectorisation declarations}
-* *
-*********************************************************
--}
-
-rnHsVectDecl :: VectDecl GhcPs -> RnM (VectDecl GhcRn, FreeVars)
--- FIXME: For the moment, the right-hand side is restricted to be a variable as we cannot properly
--- typecheck a complex right-hand side without invoking 'vectType' from the vectoriser.
-rnHsVectDecl (HsVect _ s var rhs@(L _ (HsVar _ _)))
- = do { var' <- lookupLocatedOccRn var
- ; (rhs', fv_rhs) <- rnLExpr rhs
- ; return (HsVect noExt s var' rhs', fv_rhs `addOneFV` unLoc var')
- }
-rnHsVectDecl (HsVect _ _ _var _rhs)
- = failWith $ vcat
- [ text "IMPLEMENTATION RESTRICTION: right-hand side of a VECTORISE pragma"
- , text "must be an identifier"
- ]
-rnHsVectDecl (HsNoVect _ s var)
- = do { var' <- lookupLocatedTopBndrRn var -- only applies to local (not imported) names
- ; return (HsNoVect noExt s var', unitFV (unLoc var'))
- }
-rnHsVectDecl (HsVectType (VectTypePR s tycon Nothing) isScalar)
- = do { tycon' <- lookupLocatedOccRn tycon
- ; return ( HsVectType (VectTypePR s tycon' Nothing) isScalar
- , unitFV (unLoc tycon'))
- }
-rnHsVectDecl (HsVectType (VectTypePR s tycon (Just rhs_tycon)) isScalar)
- = do { tycon' <- lookupLocatedOccRn tycon
- ; rhs_tycon' <- lookupLocatedOccRn rhs_tycon
- ; return ( HsVectType (VectTypePR s tycon' (Just rhs_tycon')) isScalar
- , mkFVs [unLoc tycon', unLoc rhs_tycon'])
- }
-rnHsVectDecl (HsVectClass (VectClassPR s cls))
- = do { cls' <- lookupLocatedOccRn cls
- ; return (HsVectClass (VectClassPR s cls'), unitFV (unLoc cls'))
- }
-rnHsVectDecl (HsVectInst instTy)
- = do { (instTy', fvs) <- rnLHsInstType (text "a VECTORISE pragma") instTy
- ; return (HsVectInst instTy', fvs)
- }
-rnHsVectDecl (XVectDecl {})
- = panic "RnSource.rnHsVectDecl: Unexpected 'XVectDecl'"
-
{- **************************************************************
* *
Renaming type, class, instance and role declarations
@@ -2187,8 +2137,6 @@ add gp@(HsGroup {hs_annds = ts}) l (AnnD _ d) ds
= addl (gp { hs_annds = L l d : ts }) ds
add gp@(HsGroup {hs_ruleds = ts}) l (RuleD _ d) ds
= addl (gp { hs_ruleds = L l d : ts }) ds
-add gp@(HsGroup {hs_vects = ts}) l (VectD _ d) ds
- = addl (gp { hs_vects = L l d : ts }) ds
add gp l (DocD _ d) ds
= addl (gp { hs_docs = (L l d) : (hs_docs gp) }) ds
add (HsGroup {}) _ (SpliceD _ (XSpliceDecl _)) _ = panic "RnSource.add"
diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs
index b51a178e82..1f08856142 100644
--- a/compiler/rename/RnTypes.hs
+++ b/compiler/rename/RnTypes.hs
@@ -350,7 +350,7 @@ rnImplicitBndrs bind_free_tvs
rnLHsInstType :: SDoc -> LHsSigType GhcPs -> RnM (LHsSigType GhcRn, FreeVars)
-- Rename the type in an instance.
--- The 'doc_str' is "an instance declaration" or "a VECTORISE pragma"
+-- The 'doc_str' is "an instance declaration".
-- Do not try to decompose the inst_ty in case it is malformed
rnLHsInstType doc inst_ty = rnHsSigType (GenericCtx doc) inst_ty
@@ -608,11 +608,6 @@ rnHsTyKi env t@(HsKindSig _ ty k)
; (k', fvs2) <- rnLHsTyKi (env { rtke_level = KindLevel }) k
; return (HsKindSig noExt ty' k', fvs1 `plusFV` fvs2) }
-rnHsTyKi env t@(HsPArrTy _ ty)
- = do { notInKinds env t
- ; (ty', fvs) <- rnLHsTyKi env ty
- ; return (HsPArrTy noExt ty', fvs) }
-
-- Unboxed tuples are allowed to have poly-typed arguments. These
-- sometimes crop up as a result of CPR worker-wrappering dictionaries.
rnHsTyKi env tupleTy@(HsTupleTy _ tup_con tys)
@@ -1149,7 +1144,6 @@ collectAnonWildCards lty = go lty
HsAppTy _ ty1 ty2 -> go ty1 `mappend` go ty2
HsFunTy _ ty1 ty2 -> go ty1 `mappend` go ty2
HsListTy _ ty -> go ty
- HsPArrTy _ ty -> go ty
HsTupleTy _ _ tys -> gos tys
HsSumTy _ tys -> gos tys
HsOpTy _ ty1 _ ty2 -> go ty1 `mappend` go ty2
@@ -1839,7 +1833,6 @@ extract_lty t_or_k (L _ ty) acc
HsAppTy _ ty1 ty2 -> extract_lty t_or_k ty1 =<<
extract_lty t_or_k ty2 acc
HsListTy _ ty -> extract_lty t_or_k ty acc
- HsPArrTy _ ty -> extract_lty t_or_k ty acc
HsTupleTy _ _ tys -> extract_ltys t_or_k tys acc
HsSumTy _ tys -> extract_ltys t_or_k tys acc
HsFunTy _ ty1 ty2 -> extract_lty t_or_k ty1 =<<
diff --git a/compiler/rename/RnUtils.hs b/compiler/rename/RnUtils.hs
index bbac43d304..99272c2943 100644
--- a/compiler/rename/RnUtils.hs
+++ b/compiler/rename/RnUtils.hs
@@ -374,7 +374,6 @@ data HsDocContext
| GHCiCtx
| SpliceTypeCtx (LHsType GhcPs)
| ClassInstanceCtx
- | VectDeclCtx (Located RdrName)
| GenericCtx SDoc -- Maybe we want to use this more!
withHsDocContext :: HsDocContext -> SDoc -> SDoc
@@ -409,5 +408,3 @@ pprHsDocContext (ConDeclCtx [name])
= text "the definition of data constructor" <+> quotes (ppr name)
pprHsDocContext (ConDeclCtx names)
= text "the definition of data constructors" <+> interpp'SP names
-pprHsDocContext (VectDeclCtx tycon)
- = text "the VECTORISE pragma for type constructor" <+> quotes (ppr tycon)
diff --git a/compiler/simplCore/CoreMonad.hs b/compiler/simplCore/CoreMonad.hs
index e5b449b516..912ff9949c 100644
--- a/compiler/simplCore/CoreMonad.hs
+++ b/compiler/simplCore/CoreMonad.hs
@@ -123,7 +123,6 @@ data CoreToDo -- These are diff core-to-core passes,
| CoreCSE
| CoreDoRuleCheck CompilerPhase String -- Check for non-application of rules
-- matching this string
- | CoreDoVectorisation
| CoreDoNothing -- Useful when building up
| CoreDoPasses [CoreToDo] -- lists of these things
@@ -149,7 +148,6 @@ instance Outputable CoreToDo where
ppr CoreDoSpecialising = text "Specialise"
ppr CoreDoSpecConstr = text "SpecConstr"
ppr CoreCSE = text "Common sub-expression"
- ppr CoreDoVectorisation = text "Vectorisation"
ppr CoreDesugar = text "Desugar (before optimization)"
ppr CoreDesugarOpt = text "Desugar (after optimization)"
ppr CoreTidy = text "Tidy Core"
diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs
index 016574e84b..8ffb6bed69 100644
--- a/compiler/simplCore/OccurAnal.hs
+++ b/compiler/simplCore/OccurAnal.hs
@@ -62,9 +62,9 @@ Here's the externally-callable interface:
occurAnalysePgm :: Module -- Used only in debug output
-> (Id -> Bool) -- Active unfoldings
-> (Activation -> Bool) -- Active rules
- -> [CoreRule] -> [CoreVect] -> VarSet
+ -> [CoreRule]
-> CoreProgram -> CoreProgram
-occurAnalysePgm this_mod active_unf active_rule imp_rules vects vectVars binds
+occurAnalysePgm this_mod active_unf active_rule imp_rules binds
| isEmptyDetails final_usage
= occ_anald_binds
@@ -86,12 +86,8 @@ occurAnalysePgm this_mod active_unf active_rule imp_rules vects vectVars binds
-- we can easily create an infinite loop (Trac #9583 is an example)
initial_uds = addManyOccsSet emptyDetails
- (rulesFreeVars imp_rules `unionVarSet`
- vectsFreeVars vects `unionVarSet`
- vectVars)
- -- The RULES and VECTORISE declarations keep things alive! (For VECTORISE declarations,
- -- we only get them *until* the vectoriser runs. Afterwards, these dependencies are
- -- reflected in 'vectors' — see Note [Vectorisation declarations and occurrences].)
+ (rulesFreeVars imp_rules)
+ -- The RULES declarations keep things alive!
-- Note [Preventing loops due to imported functions rules]
imp_rule_edges = foldr (plusVarEnv_C unionVarSet) emptyVarEnv
diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs
index 70a13cc110..888463622a 100644
--- a/compiler/simplCore/SimplCore.hs
+++ b/compiler/simplCore/SimplCore.hs
@@ -48,14 +48,12 @@ import DmdAnal ( dmdAnalProgram )
import CallArity ( callArityAnalProgram )
import Exitify ( exitifyProgram )
import WorkWrap ( wwTopBinds )
-import Vectorise ( vectorise )
import SrcLoc
import Util
import Module
import Plugins ( withPlugins, installCoreToDos )
import DynamicLoading -- ( initializePlugins )
-import Maybes
import UniqSupply ( UniqSupply, mkSplitUniqSupply, splitUniqSupply )
import UniqFM
import Outputable
@@ -137,7 +135,6 @@ getCoreToDo dflags
rules_on = gopt Opt_EnableRewriteRules dflags
eta_expand_on = gopt Opt_DoLambdaEtaExpansion dflags
ww_on = gopt Opt_WorkerWrapper dflags
- vectorise_on = gopt Opt_Vectorise dflags
static_ptrs = xopt LangExt.StaticPointers dflags
maybe_rule_check phase = runMaybe rule_check (CoreDoRuleCheck phase)
@@ -162,30 +159,6 @@ getCoreToDo dflags
, maybe_rule_check (Phase phase) ]
- -- Vectorisation can introduce a fair few common sub expressions involving
- -- DPH primitives. For example, see the Reverse test from dph-examples.
- -- We need to eliminate these common sub expressions before their definitions
- -- are inlined in phase 2. The CSE introduces lots of v1 = v2 bindings,
- -- so we also run simpl_gently to inline them.
- ++ (if vectorise_on && phase == 3
- then [CoreCSE, simpl_gently]
- else [])
-
- vectorisation
- = runWhen vectorise_on $
- CoreDoPasses [ simpl_gently, CoreDoVectorisation ]
-
- -- By default, we have 2 phases before phase 0.
-
- -- Want to run with inline phase 2 after the specialiser to give
- -- maximum chance for fusion to work before we inline build/augment
- -- in phase 1. This made a difference in 'ansi' where an
- -- overloaded function wasn't inlined till too late.
-
- -- Need phase 1 so that build/augment get
- -- inlined. I found that spectral/hartel/genfft lost some useful
- -- strictness in the function sumcode' if augment is not inlined
- -- before strictness analysis runs
simpl_phases = CoreDoPasses [ simpl_phase phase ["main"] max_iter
| phase <- [phases, phases-1 .. 1] ]
@@ -195,7 +168,7 @@ getCoreToDo dflags
(base_mode { sm_phase = InitialPhase
, sm_names = ["Gentle"]
, sm_rules = rules_on -- Note [RULEs enabled in SimplGently]
- , sm_inline = not vectorise_on
+ , sm_inline = True
-- See Note [Inline in InitialPhase]
, sm_case_case = False })
-- Don't do case-of-case transformations.
@@ -228,8 +201,7 @@ getCoreToDo dflags
core_todo =
if opt_level == 0 then
- [ vectorisation,
- static_ptrs_float_outwards,
+ [ static_ptrs_float_outwards,
CoreDoSimplify max_iter
(base_mode { sm_phase = Phase 0
, sm_names = ["Non-opt simplification"] })
@@ -243,10 +215,6 @@ getCoreToDo dflags
-- after this before anything else
runWhen static_args (CoreDoPasses [ simpl_gently, CoreDoStaticArgs ]),
- -- We run vectorisation here for now, but we might also try to run
- -- it later
- vectorisation,
-
-- initial simplify: mk specialiser happy: minimum effort please
simpl_gently,
@@ -483,9 +451,6 @@ doCorePass CoreDoSpecialising = {-# SCC "Specialise" #-}
doCorePass CoreDoSpecConstr = {-# SCC "SpecConstr" #-}
specConstrProgram
-doCorePass CoreDoVectorisation = {-# SCC "Vectorise" #-}
- vectorise
-
doCorePass CoreDoPrintCore = observe printCore
doCorePass (CoreDoRuleCheck phase pat) = ruleCheckPass phase pat
doCorePass CoreDoNothing = return
@@ -718,30 +683,9 @@ simplifyPgmIO pass@(CoreDoSimplify max_iterations mode)
, () <- sz `seq` () -- Force it
= do {
-- Occurrence analysis
- let { -- Note [Vectorisation declarations and occurrences]
- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- -- During the 'InitialPhase' (i.e., before vectorisation), we need to make sure
- -- that the right-hand sides of vectorisation declarations are taken into
- -- account during occurrence analysis. After the 'InitialPhase', we need to ensure
- -- that the binders representing variable vectorisation declarations are kept alive.
- -- (In contrast to automatically vectorised variables, their unvectorised versions
- -- don't depend on them.)
- vectVars = mkVarSet $
- catMaybes [ fmap snd $ lookupDVarEnv (vectInfoVar (mg_vect_info guts)) bndr
- | Vect bndr _ <- mg_vect_decls guts]
- ++
- catMaybes [ fmap snd $ lookupDVarEnv (vectInfoVar (mg_vect_info guts)) bndr
- | bndr <- bindersOfBinds binds]
- -- FIXME: This second comprehensions is only needed as long as we
- -- have vectorised bindings where we get "Could NOT call
- -- vectorised from original version".
- ; (maybeVects, maybeVectVars)
- = case sm_phase mode of
- InitialPhase -> (mg_vect_decls guts, vectVars)
- _ -> ([], vectVars)
- ; tagged_binds = {-# SCC "OccAnal" #-}
+ let { tagged_binds = {-# SCC "OccAnal" #-}
occurAnalysePgm this_mod active_unf active_rule rules
- maybeVects maybeVectVars binds
+ binds
} ;
Err.dumpIfSet_dyn dflags Opt_D_dump_occur_anal "Occurrence analysis"
(pprCoreBindings tagged_binds);
diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs
index f32e0e325d..2f6821c850 100644
--- a/compiler/specialise/SpecConstr.hs
+++ b/compiler/specialise/SpecConstr.hs
@@ -611,7 +611,7 @@ to mean "don't specialise on arguments of this type". It was added
before we had ForceSpecConstr. Lacking ForceSpecConstr we specialised
regardless of size; and then we needed a way to turn that *off*. Now
that we have ForceSpecConstr, this NoSpecConstr is probably redundant.
-(Used only for PArray.)
+(Used only for PArray, TODO: remove?)
-----------------------------------------------------
Stuff not yet handled
diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs
index 5fceeff565..b409c0768d 100644
--- a/compiler/typecheck/FamInst.hs
+++ b/compiler/typecheck/FamInst.hs
@@ -152,7 +152,6 @@ See #9562.
newFamInst :: FamFlavor -> CoAxiom Unbranched -> TcRnIf gbl lcl FamInst
-- Freshen the type variables of the FamInst branches
--- Called from the vectoriser monad too, hence the rather general type
newFamInst flavor axiom@(CoAxiom { co_ax_tc = fam_tc })
= ASSERT2( tyCoVarsOfTypes lhs `subVarSet` tcv_set, text "lhs" <+> pp_ax )
ASSERT2( tyCoVarsOfType rhs `subVarSet` tcv_set, text "rhs" <+> pp_ax )
diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs
index 980185c0fe..4b2cc08e7b 100644
--- a/compiler/typecheck/TcBinds.hs
+++ b/compiler/typecheck/TcBinds.hs
@@ -11,7 +11,7 @@
module TcBinds ( tcLocalBinds, tcTopBinds, tcRecSelBinds,
tcHsBootSigs, tcPolyCheck,
- tcVectDecls, addTypecheckedBinds,
+ addTypecheckedBinds,
chooseInferredQuantifiers,
badBootDeclErr ) where
@@ -53,7 +53,6 @@ import NameSet
import NameEnv
import SrcLoc
import Bag
-import ListSetOps
import ErrUtils
import Digraph
import Maybes
@@ -68,7 +67,6 @@ import qualified GHC.LanguageExtensions as LangExt
import ConLike
import Control.Monad
-import Data.List.NonEmpty ( NonEmpty(..) )
#include "HsVersions.h"
@@ -1215,78 +1213,6 @@ It also cleverly does an ambiguity check; for example, rejecting
where F is a non-injective type function.
-}
-{- *********************************************************************
-* *
- Vectorisation
-* *
-********************************************************************* -}
-
-tcVectDecls :: [LVectDecl GhcRn] -> TcM ([LVectDecl GhcTcId])
-tcVectDecls decls
- = do { decls' <- mapM (wrapLocM tcVect) decls
- ; let ids = [lvectDeclName decl | decl <- decls', not $ lvectInstDecl decl]
- dups = findDupsEq (==) ids
- ; mapM_ reportVectDups dups
- ; traceTcConstraints "End of tcVectDecls"
- ; return decls'
- }
- where
- reportVectDups (first :| (_second:_more))
- = addErrAt (getSrcSpan first) $
- text "Duplicate vectorisation declarations for" <+> ppr first
- reportVectDups _ = return ()
-
---------------
-tcVect :: VectDecl GhcRn -> TcM (VectDecl GhcTcId)
--- FIXME: We can't typecheck the expression of a vectorisation declaration against the vectorised
--- type of the original definition as this requires internals of the vectoriser not available
--- during type checking. Instead, constrain the rhs of a vectorisation declaration to be a single
--- identifier (this is checked in 'rnHsVectDecl'). Fix this by enabling the use of 'vectType'
--- from the vectoriser here.
-tcVect (HsVect _ s name rhs)
- = addErrCtxt (vectCtxt name) $
- do { var <- wrapLocM tcLookupId name
- ; let L rhs_loc (HsVar noExt (L lv rhs_var_name)) = rhs
- ; rhs_id <- tcLookupId rhs_var_name
- ; return $ HsVect noExt s var (L rhs_loc (HsVar noExt (L lv rhs_id)))
- }
-
-tcVect (HsNoVect _ s name)
- = addErrCtxt (vectCtxt name) $
- do { var <- wrapLocM tcLookupId name
- ; return $ HsNoVect noExt s var
- }
-tcVect (HsVectType (VectTypePR _ lname rhs_name) isScalar)
- = addErrCtxt (vectCtxt lname) $
- do { tycon <- tcLookupLocatedTyCon lname
- ; checkTc ( not isScalar -- either we have a non-SCALAR declaration
- || isJust rhs_name -- or we explicitly provide a vectorised type
- || tyConArity tycon == 0 -- otherwise the type constructor must be nullary
- )
- scalarTyConMustBeNullary
-
- ; rhs_tycon <- fmapMaybeM (tcLookupTyCon . unLoc) rhs_name
- ; return $ HsVectType (VectTypeTc tycon rhs_tycon) isScalar
- }
-tcVect (HsVectClass (VectClassPR _ lname))
- = addErrCtxt (vectCtxt lname) $
- do { cls <- tcLookupLocatedClass lname
- ; return $ HsVectClass cls
- }
-tcVect (HsVectInst linstTy)
- = addErrCtxt (vectCtxt linstTy) $
- do { (cls, tys) <- tcHsVectInst linstTy
- ; inst <- tcLookupInstance cls tys
- ; return $ HsVectInst inst
- }
-tcVect (XVectDecl {})
- = panic "TcBinds.tcVect: Unexpected 'XVectDecl'"
-
-vectCtxt :: Outputable thing => thing -> SDoc
-vectCtxt thing = text "When checking the vectorisation declaration for" <+> ppr thing
-
-scalarTyConMustBeNullary :: MsgDoc
-scalarTyConMustBeNullary = text "VECTORISE SCALAR type constructor must be nullary"
{-
Note [SPECIALISE pragmas]
diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs
index aac880fa16..dd70aa2678 100644
--- a/compiler/typecheck/TcExpr.hs
+++ b/compiler/typecheck/TcExpr.hs
@@ -45,7 +45,6 @@ import TcPatSyn( tcPatSynBuilderOcc, nonBidirectionalErr )
import TcPat
import TcMType
import TcType
-import DsMonad
import Id
import IdInfo
import ConLike
@@ -533,15 +532,6 @@ tcExpr (ExplicitList _ witness exprs) res_ty
; return $ ExplicitList elt_ty (Just fln') exprs' }
where tc_elt elt_ty expr = tcPolyExpr expr elt_ty
-tcExpr (ExplicitPArr _ exprs) res_ty -- maybe empty
- = do { res_ty <- expTypeToType res_ty
- ; (coi, elt_ty) <- matchExpectedPArrTy res_ty
- ; exprs' <- mapM (tc_elt elt_ty) exprs
- ; return $
- mkHsWrapCo coi $ ExplicitPArr elt_ty exprs' }
- where
- tc_elt elt_ty expr = tcPolyExpr expr elt_ty
-
{-
************************************************************************
* *
@@ -1001,34 +991,6 @@ tcExpr e@(HsRecFld _ f) res_ty
tcExpr (ArithSeq _ witness seq) res_ty
= tcArithSeq witness seq res_ty
-tcExpr (PArrSeq _ seq@(FromTo expr1 expr2)) res_ty
- = do { res_ty <- expTypeToType res_ty
- ; (coi, elt_ty) <- matchExpectedPArrTy res_ty
- ; expr1' <- tcPolyExpr expr1 elt_ty
- ; expr2' <- tcPolyExpr expr2 elt_ty
- ; enumFromToP <- initDsTc $ dsDPHBuiltin enumFromToPVar
- ; enum_from_to <- newMethodFromName (PArrSeqOrigin seq)
- (idName enumFromToP) elt_ty
- ; return $
- mkHsWrapCo coi $ PArrSeq enum_from_to (FromTo expr1' expr2') }
-
-tcExpr (PArrSeq _ seq@(FromThenTo expr1 expr2 expr3)) res_ty
- = do { res_ty <- expTypeToType res_ty
- ; (coi, elt_ty) <- matchExpectedPArrTy res_ty
- ; expr1' <- tcPolyExpr expr1 elt_ty
- ; expr2' <- tcPolyExpr expr2 elt_ty
- ; expr3' <- tcPolyExpr expr3 elt_ty
- ; enumFromThenToP <- initDsTc $ dsDPHBuiltin enumFromThenToPVar
- ; eft <- newMethodFromName (PArrSeqOrigin seq)
- (idName enumFromThenToP) elt_ty -- !!!FIXME: chak
- ; return $
- mkHsWrapCo coi $ PArrSeq eft (FromThenTo expr1' expr2' expr3') }
-
-tcExpr (PArrSeq {}) _
- = panic "TcExpr.tcExpr: Infinite parallel array!"
- -- the parser shouldn't have generated it and the renamer shouldn't have
- -- let it through
-
{-
************************************************************************
* *
diff --git a/compiler/typecheck/TcHsSyn.hs b/compiler/typecheck/TcHsSyn.hs
index b7b06dddae..0bc5c9c81e 100644
--- a/compiler/typecheck/TcHsSyn.hs
+++ b/compiler/typecheck/TcHsSyn.hs
@@ -101,7 +101,6 @@ hsPatType (AsPat _ var _) = idType (unLoc var)
hsPatType (ViewPat ty _ _) = ty
hsPatType (ListPat (ListPatTc ty Nothing) _) = mkListTy ty
hsPatType (ListPat (ListPatTc _ (Just (ty,_))) _) = ty
-hsPatType (PArrPat ty _) = mkPArrTy ty
hsPatType (TuplePat tys _ bx) = mkTupleTy bx tys
hsPatType (SumPat tys _ _ _ ) = mkSumTy tys
hsPatType (ConPatOut { pat_con = L _ con, pat_arg_tys = tys })
@@ -379,24 +378,22 @@ zonkTopLExpr e = zonkLExpr emptyZonkEnv e
zonkTopDecls :: Bag EvBind
-> LHsBinds GhcTcId
- -> [LRuleDecl GhcTcId] -> [LVectDecl GhcTcId] -> [LTcSpecPrag]
+ -> [LRuleDecl GhcTcId] -> [LTcSpecPrag]
-> [LForeignDecl GhcTcId]
-> TcM (TypeEnv,
Bag EvBind,
LHsBinds GhcTc,
[LForeignDecl GhcTc],
[LTcSpecPrag],
- [LRuleDecl GhcTc],
- [LVectDecl GhcTc])
-zonkTopDecls ev_binds binds rules vects imp_specs fords
+ [LRuleDecl GhcTc])
+zonkTopDecls ev_binds binds rules imp_specs fords
= do { (env1, ev_binds') <- zonkEvBinds emptyZonkEnv ev_binds
; (env2, binds') <- zonkRecMonoBinds env1 binds
-- Top level is implicitly recursive
; rules' <- zonkRules env2 rules
- ; vects' <- zonkVects env2 vects
; specs' <- zonkLTcSpecPrags env2 imp_specs
; fords' <- zonkForeignExports env2 fords
- ; return (zonkEnvIds env2, ev_binds', binds', fords', specs', rules', vects') }
+ ; return (zonkEnvIds env2, ev_binds', binds', fords', specs', rules') }
---------------------------------------------
zonkLocalBinds :: ZonkEnv -> HsLocalBinds GhcTcId
@@ -784,11 +781,6 @@ zonkExpr env (ExplicitList ty wit exprs)
where zonkWit env Nothing = return (env, Nothing)
zonkWit env (Just fln) = second Just <$> zonkSyntaxExpr env fln
-zonkExpr env (ExplicitPArr ty exprs)
- = do new_ty <- zonkTcTypeToType env ty
- new_exprs <- zonkLExprs env exprs
- return (ExplicitPArr new_ty new_exprs)
-
zonkExpr env expr@(RecordCon { rcon_ext = ext, rcon_flds = rbinds })
= do { new_con_expr <- zonkExpr env (rcon_con_expr ext)
; new_rbinds <- zonkRecFields env rbinds
@@ -823,11 +815,6 @@ zonkExpr env (ArithSeq expr wit info)
where zonkWit env Nothing = return (env, Nothing)
zonkWit env (Just fln) = second Just <$> zonkSyntaxExpr env fln
-zonkExpr env (PArrSeq expr info)
- = do new_expr <- zonkExpr env expr
- new_info <- zonkArithSeq env info
- return (PArrSeq new_expr new_info)
-
zonkExpr env (HsSCC x src lbl expr)
= do new_expr <- zonkLExpr env expr
return (HsSCC x src lbl new_expr)
@@ -1284,11 +1271,6 @@ zonk_pat env (ListPat (ListPatTc ty (Just (ty2,wit))) pats)
; (env'', pats') <- zonkPats env' pats
; return (env'', ListPat (ListPatTc ty' (Just (ty2',wit'))) pats') }
-zonk_pat env (PArrPat ty pats)
- = do { ty' <- zonkTcTypeToType env ty
- ; (env', pats') <- zonkPats env pats
- ; return (env', PArrPat ty' pats') }
-
zonk_pat env (TuplePat tys pats boxed)
= do { tys' <- mapM (zonkTcTypeToType env) tys
; (env', pats') <- zonkPats env pats
@@ -1446,27 +1428,6 @@ zonkRule env (HsRule fvs name act (vars{-::[RuleBndr TcId]-}) lhs rhs)
-- of v and zonk there!
zonkRule _ (XRuleDecl _) = panic "zonkRule"
-zonkVects :: ZonkEnv -> [LVectDecl GhcTcId] -> TcM [LVectDecl GhcTc]
-zonkVects env = mapM (wrapLocM (zonkVect env))
-
-zonkVect :: ZonkEnv -> VectDecl GhcTcId -> TcM (VectDecl GhcTc)
-zonkVect env (HsVect x s v e)
- = do { v' <- wrapLocM (zonkIdBndr env) v
- ; e' <- zonkLExpr env e
- ; return $ HsVect x s v' e'
- }
-zonkVect env (HsNoVect x s v)
- = do { v' <- wrapLocM (zonkIdBndr env) v
- ; return $ HsNoVect x s v'
- }
-zonkVect _env (HsVectType (VectTypeTc t rt) s)
- = return $ HsVectType (VectTypeTc t rt) s
-zonkVect _env (HsVectClass c)
- = return $ HsVectClass c
-zonkVect _env (HsVectInst i)
- = return $ HsVectInst i
-zonkVect _ (XVectDecl _) = panic "TcHsSyn.zonkVect: XVectDecl"
-
{-
************************************************************************
* *
diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs
index ba1fc3fac4..d23ae23269 100644
--- a/compiler/typecheck/TcHsType.hs
+++ b/compiler/typecheck/TcHsType.hs
@@ -15,7 +15,7 @@ module TcHsType (
funsSigCtxt, addSigCtxt, pprSigCtxt,
tcHsClsInstType,
- tcHsDeriv, tcHsVectInst,
+ tcHsDeriv,
tcHsTypeApp,
UserTypeCtxt(..),
tcImplicitTKBndrs, tcImplicitTKBndrsX,
@@ -303,22 +303,6 @@ tcHsClsInstType user_ctxt hs_inst_ty
do { inst_ty <- tc_hs_sig_type_and_gen (SigTypeSkol user_ctxt) hs_inst_ty constraintKind
; checkValidInstance user_ctxt hs_inst_ty inst_ty }
--- Used for 'VECTORISE [SCALAR] instance' declarations
-tcHsVectInst :: LHsSigType GhcRn -> TcM (Class, [Type])
-tcHsVectInst ty
- | let hs_cls_ty = hsSigType ty
- , Just (L _ cls_name, tys) <- hsTyGetAppHead_maybe hs_cls_ty
- -- Ignoring the binders looks pretty dodgy to me
- = do { (cls, cls_kind) <- tcClass cls_name
- ; (applied_class, _res_kind)
- <- tcTyApps typeLevelMode hs_cls_ty (mkClassPred cls []) cls_kind tys
- ; case tcSplitTyConApp_maybe applied_class of
- Just (_tc, args) -> ASSERT( _tc == classTyCon cls )
- return (cls, args)
- _ -> failWithTc (text "Too many arguments passed to" <+> ppr cls_name) }
- | otherwise
- = failWithTc $ text "Malformed instance type"
-
----------------------------------------------
-- | Type-check a visible type application
tcHsTypeApp :: LHsWcType GhcRn -> Kind -> TcM Type
@@ -679,12 +663,6 @@ tc_hs_type mode rn_ty@(HsListTy _ elt_ty) exp_kind
; checkWiredInTyCon listTyCon
; checkExpectedKind rn_ty (mkListTy tau_ty) liftedTypeKind exp_kind }
-tc_hs_type mode rn_ty@(HsPArrTy _ elt_ty) exp_kind
- = do { MASSERT( isTypeLevel (mode_level mode) )
- ; tau_ty <- tc_lhs_type mode elt_ty liftedTypeKind
- ; checkWiredInTyCon parrTyCon
- ; checkExpectedKind rn_ty (mkPArrTy tau_ty) liftedTypeKind exp_kind }
-
-- See Note [Distinguishing tuple kinds] in HsTypes
-- See Note [Inferring tuple kinds]
tc_hs_type mode rn_ty@(HsTupleTy _ HsBoxedOrConstraintTuple hs_tys) exp_kind
@@ -1187,23 +1165,6 @@ tcTyVar mode name -- Could be a tyvar, a tycon, or a datacon
_ -> do { traceTc "lk1 (loopy)" (ppr name)
; return tc_tc } }
-tcClass :: Name -> TcM (Class, TcKind)
-tcClass cls -- Must be a class
- = do { thing <- tcLookup cls
- ; case thing of
- ATcTyCon tc -> return (aThingErr "tcClass" cls, tyConKind tc)
- AGlobal (ATyCon tc)
- | Just cls <- tyConClass_maybe tc
- -> return (cls, tyConKind tc)
- _ -> wrongThingErr "class" thing cls }
-
-
-aThingErr :: String -> Name -> b
--- The type checker for types is sometimes called simply to
--- do *kind* checking; and in that case it ignores the type
--- returned. Which is a good thing since it may not be available yet!
-aThingErr str x = pprPanic "AThing evaluated unexpectedly" (text str <+> ppr x)
-
{-
Note [Type-checking inside the knot]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/compiler/typecheck/TcMatches.hs b/compiler/typecheck/TcMatches.hs
index 1ab91bd170..e2c29cad36 100644
--- a/compiler/typecheck/TcMatches.hs
+++ b/compiler/typecheck/TcMatches.hs
@@ -302,14 +302,6 @@ tcDoStmts ListComp (L l stmts) res_ty
(mkCheckExpType elt_ty)
; return $ mkHsWrapCo co (HsDo list_ty ListComp (L l stmts')) }
-tcDoStmts PArrComp (L l stmts) res_ty
- = do { res_ty <- expTypeToType res_ty
- ; (co, elt_ty) <- matchExpectedPArrTy res_ty
- ; let parr_ty = mkPArrTy elt_ty
- ; stmts' <- tcStmts PArrComp (tcLcStmt parrTyCon) stmts
- (mkCheckExpType elt_ty)
- ; return $ mkHsWrapCo co (HsDo parr_ty PArrComp (L l stmts')) }
-
tcDoStmts DoExpr (L l stmts) res_ty
= do { stmts' <- tcStmts DoExpr tcDoStmt stmts res_ty
; res_ty <- readExpType res_ty
@@ -427,20 +419,19 @@ tcGuardStmt _ stmt _ _
---------------------------------------------------
--- List comprehensions and PArrays
+-- List comprehensions
-- (no rebindable syntax)
---------------------------------------------------
-- Dealt with separately, rather than by tcMcStmt, because
--- a) PArr isn't (yet) an instance of Monad, so the generality seems overkill
--- b) We have special desugaring rules for list comprehensions,
+-- a) We have special desugaring rules for list comprehensions,
-- which avoid creating intermediate lists. They in turn
-- assume that the bind/return operations are the regular
-- polymorphic ones, and in particular don't have any
-- coercion matching stuff in them. It's hard to avoid the
-- potential for non-trivial coercions in tcMcStmt
-tcLcStmt :: TyCon -- The list/Parray type constructor ([] or PArray)
+tcLcStmt :: TyCon -- The list type constructor ([])
-> TcExprStmtChecker
tcLcStmt _ _ (LastStmt x body noret _) elt_ty thing_inside
diff --git a/compiler/typecheck/TcPat.hs b/compiler/typecheck/TcPat.hs
index 249b01fc7b..e59d15f375 100644
--- a/compiler/typecheck/TcPat.hs
+++ b/compiler/typecheck/TcPat.hs
@@ -442,14 +442,6 @@ tc_pat penv (ListPat (Just e) pats) pat_ty thing_inside
; return (ListPat (ListPatTc elt_ty (Just (tau_pat_ty,e'))) pats', res)
}
-tc_pat penv (PArrPat _ pats ) pat_ty thing_inside
- = do { (coi, elt_ty) <- matchExpectedPatTy matchExpectedPArrTy penv pat_ty
- ; (pats', res) <- tcMultiple (\p -> tc_lpat p (mkCheckExpType elt_ty))
- pats penv thing_inside
- ; pat_ty <- readExpType pat_ty
- ; return (mkHsWrapPat coi (PArrPat elt_ty pats') pat_ty, res)
- }
-
tc_pat penv (TuplePat _ pats boxity) pat_ty thing_inside
= do { let arity = length pats
tc = tupleTyCon boxity arity
diff --git a/compiler/typecheck/TcPatSyn.hs b/compiler/typecheck/TcPatSyn.hs
index f39ce52917..fcea649d01 100644
--- a/compiler/typecheck/TcPatSyn.hs
+++ b/compiler/typecheck/TcPatSyn.hs
@@ -893,8 +893,6 @@ tcPatToExpr name args pat = go pat
| otherwise
= Left (quotes (ppr var) <+> text "is not bound by the LHS of the pattern synonym")
go1 (ParPat _ pat) = fmap (HsPar noExt) $ go pat
- go1 (PArrPat _ pats) = do { exprs <- mapM go pats
- ; return $ ExplicitPArr noExt exprs }
go1 p@(ListPat reb pats)
| Nothing <- reb = do { exprs <- mapM go pats
; return $ ExplicitList noExt Nothing exprs }
@@ -1064,7 +1062,6 @@ tcCollectEx pat = go pat
go1 (ListPat _ ps) = mergeMany . map go $ ps
go1 (TuplePat _ ps _) = mergeMany . map go $ ps
go1 (SumPat _ p _ _) = go p
- go1 (PArrPat _ ps) = mergeMany . map go $ ps
go1 (ViewPat _ _ p) = go p
go1 con@ConPatOut{} = merge (pat_tvs con, pat_dicts con) $
goConDetails $ pat_args con
diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs
index d20d43affb..7730f7efd6 100644
--- a/compiler/typecheck/TcRnDriver.hs
+++ b/compiler/typecheck/TcRnDriver.hs
@@ -2,7 +2,7 @@
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-\section[TcMovectle]{Typechecking a whole module}
+\section[TcRnDriver]{Typechecking a whole module}
https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/TypeChecker
-}
@@ -435,13 +435,12 @@ tcRnSrcDecls explicit_mod_hdr decls
tcg_ev_binds = cur_ev_binds,
tcg_imp_specs = imp_specs,
tcg_rules = rules,
- tcg_vects = vects,
tcg_fords = fords } = tcg_env
; all_ev_binds = cur_ev_binds `unionBags` new_ev_binds } ;
- ; (bind_env, ev_binds', binds', fords', imp_specs', rules', vects')
+ ; (bind_env, ev_binds', binds', fords', imp_specs', rules')
<- {-# SCC "zonkTopDecls" #-}
- zonkTopDecls all_ev_binds binds rules vects
+ zonkTopDecls all_ev_binds binds rules
imp_specs fords ;
; traceTc "Tc11" empty
@@ -450,7 +449,6 @@ tcRnSrcDecls explicit_mod_hdr decls
tcg_ev_binds = ev_binds',
tcg_imp_specs = imp_specs',
tcg_rules = rules',
- tcg_vects = vects',
tcg_fords = fords' } } ;
; setGlobalTypeEnv tcg_env' final_type_env
@@ -575,7 +573,6 @@ tcRnHsBootDecls hsc_src decls
, hs_fords = for_decls
, hs_defds = def_decls
, hs_ruleds = rule_decls
- , hs_vects = vect_decls
, hs_annds = _
, hs_valds
= XValBindsLR (NValBinds val_binds val_sigs) })
@@ -593,7 +590,6 @@ tcRnHsBootDecls hsc_src decls
; mapM_ (badBootDecl hsc_src "foreign") for_decls
; mapM_ (badBootDecl hsc_src "default") def_decls
; mapM_ (badBootDecl hsc_src "rule") rule_decls
- ; mapM_ (badBootDecl hsc_src "vect") vect_decls
-- Typecheck type/class/instance decls
; traceTc "Tc2 (boot)" empty
@@ -1324,7 +1320,6 @@ tcTopSrcDecls (HsGroup { hs_tyclds = tycl_decls,
hs_defds = default_decls,
hs_annds = annotation_decls,
hs_ruleds = rule_decls,
- hs_vects = vect_decls,
hs_valds = hs_val_binds@(XValBindsLR
(NValBinds val_binds val_sigs)) })
= do { -- Type-check the type and class decls, and all imported decls
@@ -1387,9 +1382,6 @@ tcTopSrcDecls (HsGroup { hs_tyclds = tycl_decls,
-- Rules
rules <- tcRules rule_decls ;
- -- Vectorisation declarations
- vects <- tcVectDecls vect_decls ;
-
-- Wrap up
traceTc "Tc7a" empty ;
let { all_binds = inst_binds `unionBags`
@@ -1408,7 +1400,6 @@ tcTopSrcDecls (HsGroup { hs_tyclds = tycl_decls,
, tcg_sigs = tcg_sigs tcg_env `unionNameSet` sig_names
, tcg_rules = tcg_rules tcg_env
++ flattenRuleDecls rules
- , tcg_vects = tcg_vects tcg_env ++ vects
, tcg_anns = tcg_anns tcg_env ++ annotations
, tcg_ann_env = extendAnnEnvList (tcg_ann_env tcg_env) annotations
, tcg_fords = tcg_fords tcg_env ++ foe_decls ++ fi_decls
@@ -2608,14 +2599,12 @@ pprTcGblEnv (TcGblEnv { tcg_type_env = type_env,
tcg_insts = insts,
tcg_fam_insts = fam_insts,
tcg_rules = rules,
- tcg_vects = vects,
tcg_imports = imports })
= vcat [ ppr_types type_env
, ppr_tycons fam_insts type_env
, ppr_insts insts
, ppr_fam_insts fam_insts
, vcat (map ppr rules)
- , vcat (map ppr vects)
, text "Dependent modules:" <+>
pprUFM (imp_dep_mods imports) (ppr . sort)
, text "Dependent packages:" <+>
diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs
index 8f4812e5a3..a68d0f504a 100644
--- a/compiler/typecheck/TcRnMonad.hs
+++ b/compiler/typecheck/TcRnMonad.hs
@@ -290,7 +290,6 @@ initTc hsc_env hsc_src keep_rn_syntax mod loc do_this
tcg_fam_insts = [],
tcg_rules = [],
tcg_fords = [],
- tcg_vects = [],
tcg_patsyns = [],
tcg_merged = [],
tcg_dfun_n = dfun_n_var,
diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs
index 4be3e5efd1..fb09fdd923 100644
--- a/compiler/typecheck/TcRnTypes.hs
+++ b/compiler/typecheck/TcRnTypes.hs
@@ -46,7 +46,7 @@ module TcRnTypes(
pprTcTyThingCategory, pprPECategory, CompleteMatch(..),
-- Desugaring types
- DsM, DsLclEnv(..), DsGblEnv(..), PArrBuiltin(..),
+ DsM, DsLclEnv(..), DsGblEnv(..),
DsMetaEnv, DsMetaVal(..), CompleteMatchMap,
mkCompleteMatchMap, extendCompleteMatchMap,
@@ -362,25 +362,6 @@ a @UniqueSupply@ and some annotations, which
presumably include source-file location information:
-}
--- If '-XParallelArrays' is given, the desugarer populates this table with the corresponding
--- variables found in 'Data.Array.Parallel'.
---
-data PArrBuiltin
- = PArrBuiltin
- { lengthPVar :: Var -- ^ lengthP
- , replicatePVar :: Var -- ^ replicateP
- , singletonPVar :: Var -- ^ singletonP
- , mapPVar :: Var -- ^ mapP
- , filterPVar :: Var -- ^ filterP
- , zipPVar :: Var -- ^ zipP
- , crossMapPVar :: Var -- ^ crossMapP
- , indexPVar :: Var -- ^ (!:)
- , emptyPVar :: Var -- ^ emptyP
- , appPVar :: Var -- ^ (+:+)
- , enumFromToPVar :: Var -- ^ enumFromToP
- , enumFromThenToPVar :: Var -- ^ enumFromThenToP
- }
-
data DsGblEnv
= DsGblEnv
{ ds_mod :: Module -- For SCC profiling
@@ -389,11 +370,6 @@ data DsGblEnv
, ds_msgs :: IORef Messages -- Warning messages
, ds_if_env :: (IfGblEnv, IfLclEnv) -- Used for looking up global,
-- possibly-imported things
- , ds_dph_env :: GlobalRdrEnv -- exported entities of 'Data.Array.Parallel.Prim'
- -- iff '-fvectorise' flag was given as well as
- -- exported entities of 'Data.Array.Parallel' iff
- -- '-XParallelArrays' was given; otherwise, empty
- , ds_parr_bi :: PArrBuiltin -- desugarer names for '-XParallelArrays'
, ds_complete_matches :: CompleteMatchMap
-- Additional complete pattern matches
, ds_cc_st :: IORef CostCentreState
@@ -678,7 +654,6 @@ data TcGblEnv
tcg_fam_insts :: [FamInst], -- ...Family instances
tcg_rules :: [LRuleDecl GhcTc], -- ...Rules
tcg_fords :: [LForeignDecl GhcTc], -- ...Foreign import & exports
- tcg_vects :: [LVectDecl GhcTc], -- ...Vectorisation declarations
tcg_patsyns :: [PatSyn], -- ...Pattern synonyms
tcg_doc_hdr :: Maybe LHsDocString, -- ^ Maybe Haddock header docs
@@ -3383,7 +3358,6 @@ data CtOrigin
| NegateOrigin -- Occurrence of syntactic negation
| ArithSeqOrigin (ArithSeqInfo GhcRn) -- [x..], [x..y] etc
- | PArrSeqOrigin (ArithSeqInfo GhcRn) -- [:x..y:] and [:x,y..z:]
| SectionOrigin
| TupleOrigin -- (..,..)
| ExprSigOrigin -- e :: ty
@@ -3523,12 +3497,10 @@ exprCtOrigin (HsMultiIf _ rhs) = lGRHSCtOrigin rhs
exprCtOrigin (HsLet _ _ e) = lexprCtOrigin e
exprCtOrigin (HsDo {}) = DoOrigin
exprCtOrigin (ExplicitList {}) = Shouldn'tHappenOrigin "list"
-exprCtOrigin (ExplicitPArr {}) = Shouldn'tHappenOrigin "parallel array"
exprCtOrigin (RecordCon {}) = Shouldn'tHappenOrigin "record construction"
exprCtOrigin (RecordUpd {}) = Shouldn'tHappenOrigin "record update"
exprCtOrigin (ExprWithTySig {}) = ExprSigOrigin
exprCtOrigin (ArithSeq {}) = Shouldn'tHappenOrigin "arithmetic sequence"
-exprCtOrigin (PArrSeq {}) = Shouldn'tHappenOrigin "parallel array sequence"
exprCtOrigin (HsSCC _ _ _ e) = lexprCtOrigin e
exprCtOrigin (HsCoreAnn _ _ _ e) = lexprCtOrigin e
exprCtOrigin (HsBracket {}) = Shouldn'tHappenOrigin "TH bracket"
@@ -3675,7 +3647,6 @@ pprCtO ViewPatOrigin = text "a view pattern"
pprCtO IfOrigin = text "an if expression"
pprCtO (LiteralOrigin lit) = hsep [text "the literal", quotes (ppr lit)]
pprCtO (ArithSeqOrigin seq) = hsep [text "the arithmetic sequence", quotes (ppr seq)]
-pprCtO (PArrSeqOrigin seq) = hsep [text "the parallel array sequence", quotes (ppr seq)]
pprCtO SectionOrigin = text "an operator section"
pprCtO TupleOrigin = text "a tuple"
pprCtO NegateOrigin = text "a use of syntactic negation"
diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs
index 4343c32bf4..be0586eeda 100644
--- a/compiler/typecheck/TcUnify.hs
+++ b/compiler/typecheck/TcUnify.hs
@@ -25,7 +25,6 @@ module TcUnify (
-- Holes
tcInferInst, tcInferNoInst,
matchExpectedListTy,
- matchExpectedPArrTy,
matchExpectedTyConApp,
matchExpectedAppTy,
matchExpectedFunTys,
@@ -362,13 +361,6 @@ matchExpectedListTy exp_ty
= do { (co, [elt_ty]) <- matchExpectedTyConApp listTyCon exp_ty
; return (co, elt_ty) }
-----------------------
-matchExpectedPArrTy :: TcRhoType -> TcM (TcCoercionN, TcRhoType)
--- Special case for parrs
-matchExpectedPArrTy exp_ty
- = do { (co, [elt_ty]) <- matchExpectedTyConApp parrTyCon exp_ty
- ; return (co, elt_ty) }
-
---------------------
matchExpectedTyConApp :: TyCon -- T :: forall kv1 ... kvm. k1 -> ... -> kn -> *
-> TcRhoType -- orig_ty
diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs
index 2b89162296..2c96ddaba0 100644
--- a/compiler/utils/Outputable.hs
+++ b/compiler/utils/Outputable.hs
@@ -24,7 +24,7 @@ module Outputable (
text, ftext, ptext, ztext,
int, intWithCommas, integer, word, float, double, rational, doublePrec,
parens, cparen, brackets, braces, quotes, quote,
- doubleQuotes, angleBrackets, paBrackets,
+ doubleQuotes, angleBrackets,
semi, comma, colon, dcolon, space, equals, dot, vbar,
arrow, larrow, darrow, arrowt, larrowt, arrowtt, larrowtt,
lparen, rparen, lbrack, rbrack, lbrace, rbrace, underscore,
@@ -592,7 +592,7 @@ doublePrec :: Int -> Double -> SDoc
doublePrec p n = text (showFFloat (Just p) n "")
parens, braces, brackets, quotes, quote,
- paBrackets, doubleQuotes, angleBrackets :: SDoc -> SDoc
+ doubleQuotes, angleBrackets :: SDoc -> SDoc
parens d = SDoc $ Pretty.parens . runSDoc d
braces d = SDoc $ Pretty.braces . runSDoc d
@@ -600,7 +600,6 @@ brackets d = SDoc $ Pretty.brackets . runSDoc d
quote d = SDoc $ Pretty.quote . runSDoc d
doubleQuotes d = SDoc $ Pretty.doubleQuotes . runSDoc d
angleBrackets d = char '<' <> d <> char '>'
-paBrackets d = text "[:" <> d <> text ":]"
cparen :: Bool -> SDoc -> SDoc
cparen b d = SDoc $ Pretty.maybeParens b . runSDoc d
diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs
deleted file mode 100644
index 0181c6cdd1..0000000000
--- a/compiler/vectorise/Vectorise.hs
+++ /dev/null
@@ -1,358 +0,0 @@
--- Main entry point to the vectoriser. It is invoked iff the option '-fvectorise' is passed.
---
--- This module provides the function 'vectorise', which vectorises an entire (desugared) module.
--- It vectorises all type declarations and value bindings. It also processes all VECTORISE pragmas
--- (aka vectorisation declarations), which can lead to the vectorisation of imported data types
--- and the enrichment of imported functions with vectorised versions.
-
-module Vectorise ( vectorise )
-where
-
-import GhcPrelude
-
-import Vectorise.Type.Env
-import Vectorise.Type.Type
-import Vectorise.Convert
-import Vectorise.Utils.Hoisting
-import Vectorise.Exp
-import Vectorise.Env
-import Vectorise.Monad
-
-import HscTypes hiding ( MonadThings(..) )
-import CoreUnfold ( mkInlineUnfoldingWithArity )
-import PprCore
-import CoreSyn
-import CoreMonad ( CoreM, getHscEnv )
-import Type
-import Id
-import DynFlags
-import Outputable
-import Util ( zipLazy )
-import MonadUtils
-
-import Control.Monad
-
-
--- |Vectorise a single module.
---
-vectorise :: ModGuts -> CoreM ModGuts
-vectorise guts
- = do { hsc_env <- getHscEnv
- ; liftIO $ vectoriseIO hsc_env guts
- }
-
--- Vectorise a single monad, given the dynamic compiler flags and HscEnv.
---
-vectoriseIO :: HscEnv -> ModGuts -> IO ModGuts
-vectoriseIO hsc_env guts
- = do { -- Get information about currently loaded external packages.
- ; eps <- hscEPS hsc_env
-
- -- Combine vectorisation info from the current module, and external ones.
- ; let info = hptVectInfo hsc_env `plusVectInfo` eps_vect_info eps
-
- -- Run the main VM computation.
- ; Just (info', guts') <- initV hsc_env guts info (vectModule guts)
- ; return (guts' { mg_vect_info = info' })
- }
-
--- Vectorise a single module, in the VM monad.
---
-vectModule :: ModGuts -> VM ModGuts
-vectModule guts@(ModGuts { mg_tcs = tycons
- , mg_binds = binds
- , mg_fam_insts = fam_insts
- , mg_vect_decls = vect_decls
- })
- = do { dumpOptVt Opt_D_dump_vt_trace "Before vectorisation" $
- pprCoreBindings binds
-
- -- Pick out all 'VECTORISE [SCALAR] type' and 'VECTORISE class' pragmas
- ; let ty_vect_decls = [vd | vd@(VectType _ _ _) <- vect_decls]
- cls_vect_decls = [vd | vd@(VectClass _) <- vect_decls]
-
- -- Vectorise the type environment. This will add vectorised
- -- type constructors, their representations, and the
- -- corresponding data constructors. Moreover, we produce
- -- bindings for dfuns and family instances of the classes
- -- and type families used in the DPH library to represent
- -- array types.
- ; (new_tycons, new_fam_insts, tc_binds) <- vectTypeEnv tycons ty_vect_decls cls_vect_decls
-
- -- Family instance environment for /all/ home-package modules including those instances
- -- generated by 'vectTypeEnv'.
- ; (_, fam_inst_env) <- readGEnv global_fam_inst_env
-
- -- Vectorise all the top level bindings and VECTORISE declarations on imported identifiers
- -- NB: Need to vectorise the imported bindings first (local bindings may depend on them).
- ; let impBinds = [(imp_id, expr) | Vect imp_id expr <- vect_decls, isGlobalId imp_id]
- ; binds_imp <- mapM vectImpBind impBinds
- ; binds_top <- mapM vectTopBind binds
-
- ; return $ guts { mg_tcs = tycons ++ new_tycons
- -- we produce no new classes or instances, only new class type constructors
- -- and dfuns
- , mg_binds = Rec tc_binds : (binds_top ++ binds_imp)
- , mg_fam_inst_env = fam_inst_env
- , mg_fam_insts = fam_insts ++ new_fam_insts
- }
- }
-
--- Try to vectorise a top-level binding. If it doesn't vectorise, or if it is entirely scalar, then
--- omit vectorisation of that binding.
---
--- For example, for the binding
---
--- @
--- foo :: Int -> Int
--- foo = \x -> x + x
--- @
---
--- we get
--- @
--- foo :: Int -> Int
--- foo = \x -> vfoo $: x
---
--- v_foo :: Closure void vfoo lfoo
--- v_foo = closure vfoo lfoo void
---
--- vfoo :: Void -> Int -> Int
--- vfoo = ...
---
--- lfoo :: PData Void -> PData Int -> PData Int
--- lfoo = ...
--- @
---
--- @vfoo@ is the "vectorised", or scalar, version that does the same as the original function foo,
--- but takes an explicit environment.
---
--- @lfoo@ is the "lifted" version that works on arrays.
---
--- @v_foo@ combines both of these into a `Closure` that also contains the environment.
---
--- The original binding @foo@ is rewritten to call the vectorised version present in the closure.
---
--- Vectorisation may be suppressed by annotating a binding with a 'NOVECTORISE' pragma. If this
--- pragma is used in a group of mutually recursive bindings, either all or no binding must have
--- the pragma. If only some bindings are annotated, a fatal error is being raised. (In the case of
--- scalar bindings, we only omit vectorisation if all bindings in a group are scalar.)
---
--- FIXME: Once we support partial vectorisation, we may be able to vectorise parts of a group, or
--- we may emit a warning and refrain from vectorising the entire group.
---
-vectTopBind :: CoreBind -> VM CoreBind
-vectTopBind b@(NonRec var expr)
- = do
- { traceVt "= Vectorise non-recursive top-level variable" (ppr var)
-
- ; (hasNoVect, vectDecl) <- lookupVectDecl var
- ; if hasNoVect
- then do
- { -- 'NOVECTORISE' pragma => leave this binding as it is
- ; traceVt "NOVECTORISE" $ ppr var
- ; return b
- }
- else do
- { vectRhs <- case vectDecl of
- Just (_, expr') ->
- -- 'VECTORISE' pragma => just use the provided vectorised rhs
- do
- { traceVt "VECTORISE" $ ppr var
- ; addGlobalParallelVar var
- ; return $ Just (False, inlineMe, expr')
- }
- Nothing ->
- -- no pragma => standard vectorisation of rhs
- do
- { traceVt "[Vanilla]" $ ppr var <+> char '=' <+> ppr expr
- ; vectTopExpr var expr
- }
- ; hs <- takeHoisted -- make sure we clean those out (even if we skip)
- ; case vectRhs of
- { Nothing ->
- -- scalar binding => leave this binding as it is
- do
- { traceVt "scalar binding [skip]" $ ppr var
- ; return b
- }
- ; Just (parBind, inline, expr') -> do
- {
- -- vanilla case => create an appropriate top-level binding & add it to the vectorisation map
- ; when parBind $
- addGlobalParallelVar var
- ; var' <- vectTopBinder var inline expr'
-
- -- We replace the original top-level binding by a value projected from the vectorised
- -- closure and add any newly created hoisted top-level bindings.
- ; cexpr <- tryConvert var var' expr
- ; return . Rec $ (var, cexpr) : (var', expr') : hs
- } } } }
- `orElseErrV`
- do
- { emitVt " Could NOT vectorise top-level binding" $ ppr var
- ; return b
- }
-vectTopBind b@(Rec binds)
- = do
- { traceVt "= Vectorise recursive top-level variables" $ ppr vars
-
- ; vectDecls <- mapM lookupVectDecl vars
- ; let hasNoVects = map fst vectDecls
- ; if and hasNoVects
- then do
- { -- 'NOVECTORISE' pragmas => leave this entire binding group as it is
- ; traceVt "NOVECTORISE" $ ppr vars
- ; return b
- }
- else do
- { if or hasNoVects
- then do
- { -- Inconsistent 'NOVECTORISE' pragmas => bail out
- ; dflags <- getDynFlags
- ; cantVectorise dflags noVectoriseErr (ppr b)
- }
- else do
- { traceVt "[Vanilla]" $ vcat [ppr var <+> char '=' <+> ppr expr | (var, expr) <- binds]
-
- -- For all bindings *with* a pragma, just use the pragma-supplied vectorised expression
- ; newBindsWPragma <- concat <$>
- sequence [ vectTopBindAndConvert bind inlineMe expr'
- | (bind, (_, Just (_, expr'))) <- zip binds vectDecls]
-
- -- Standard vectorisation of all rhses that are *without* a pragma.
- -- NB: The reason for 'fixV' is rather subtle: 'vectTopBindAndConvert' adds entries for
- -- the bound variables in the recursive group to the vectorisation map, which in turn
- -- are needed by 'vectPolyExprs' (unless it returns 'Nothing').
- ; let bindsWOPragma = [bind | (bind, (_, Nothing)) <- zip binds vectDecls]
- ; (newBinds, _) <- fixV $
- \ ~(_, exprs') ->
- do
- { -- Create appropriate top-level bindings, enter them into the vectorisation map, and
- -- vectorise the right-hand sides
- ; newBindsWOPragma <- concat <$>
- sequence [vectTopBindAndConvert bind inline expr
- | (bind, ~(inline, expr)) <- zipLazy bindsWOPragma exprs']
- -- irrefutable pattern and 'zipLazy' to tie the knot;
- -- hence, can't use 'zipWithM'
- ; vectRhses <- vectTopExprs bindsWOPragma
- ; hs <- takeHoisted -- make sure we clean those out (even if we skip)
-
- ; case vectRhses of
- Nothing ->
- -- scalar bindings => skip all bindings except those with pragmas and retract the
- -- entries into the vectorisation map for the scalar bindings
- do
- { traceVt "scalar bindings [skip]" $ ppr vars
- ; mapM_ (undefGlobalVar . fst) bindsWOPragma
- ; return (bindsWOPragma ++ newBindsWPragma, exprs')
- }
- Just (parBind, exprs') ->
- -- vanilla case => record parallel variables and return the final bindings
- do
- { when parBind $
- mapM_ addGlobalParallelVar vars
- ; return (newBindsWOPragma ++ newBindsWPragma ++ hs, exprs')
- }
- }
- ; return $ Rec newBinds
- } } }
- `orElseErrV`
- do
- { emitVt " Could NOT vectorise top-level bindings" $ ppr vars
- ; return b
- }
- where
- vars = map fst binds
- noVectoriseErr = "NOVECTORISE must be used on all or no bindings of a recursive group"
-
- -- Replace the original top-level bindings by a values projected from the vectorised
- -- closures and add any newly created hoisted top-level bindings to the group.
- vectTopBindAndConvert (var, expr) inline expr'
- = do
- { var' <- vectTopBinder var inline expr'
- ; cexpr <- tryConvert var var' expr
- ; return [(var, cexpr), (var', expr')]
- }
-
--- Add a vectorised binding to an imported top-level variable that has a VECTORISE pragma
--- in this module.
---
--- RESTRICTION: Currently, we cannot use the pragma for mutually recursive definitions.
---
-vectImpBind :: (Id, CoreExpr) -> VM CoreBind
-vectImpBind (var, expr)
- = do
- { traceVt "= Add vectorised binding to imported variable" (ppr var)
-
- ; var' <- vectTopBinder var inlineMe expr
- ; return $ NonRec var' expr
- }
-
--- |Make the vectorised version of this top level binder, and add the mapping between it and the
--- original to the state. For some binder @foo@ the vectorised version is @$v_foo@
---
--- NOTE: 'vectTopBinder' *MUST* be lazy in inline and expr because of how it is used inside of
--- 'fixV' in 'vectTopBind'.
---
-vectTopBinder :: Var -- ^ Name of the binding.
- -> Inline -- ^ Whether it should be inlined, used to annotate it.
- -> CoreExpr -- ^ RHS of binding, used to set the 'Unfolding' of the returned 'Var'.
- -> VM Var -- ^ Name of the vectorised binding.
-vectTopBinder var inline expr
- = do { -- Vectorise the type attached to the var.
- ; vty <- vectType (idType var)
-
- -- If there is a vectorisation declaration for this binding, make sure its type matches
- ; (_, vectDecl) <- lookupVectDecl var
- ; case vectDecl of
- Nothing -> return ()
- Just (vdty, _)
- | eqType vty vdty -> return ()
- | otherwise ->
- do
- { dflags <- getDynFlags
- ; cantVectorise dflags ("Type mismatch in vectorisation pragma for " ++ showPpr dflags var) $
- (text "Expected type" <+> ppr vty)
- $$
- (text "Inferred type" <+> ppr vdty)
- }
- -- Make the vectorised version of binding's name, and set the unfolding used for inlining
- ; var' <- liftM (`setIdUnfolding` unfolding)
- $ mkVectId var vty
-
- -- Add the mapping between the plain and vectorised name to the state.
- ; defGlobalVar var var'
-
- ; return var'
- }
- where
- unfolding = case inline of
- Inline arity -> mkInlineUnfoldingWithArity arity expr
- DontInline -> noUnfolding
-{-
-!!!TODO: dfuns and unfoldings:
- -- Do not inline the dfun; instead give it a magic DFunFunfolding
- -- See Note [ClassOp/DFun selection]
- -- See also note [Single-method classes]
- dfun_id_w_fun
- | isNewTyCon class_tc
- = dfun_id `setInlinePragma` alwaysInlinePragma { inl_sat = Just 0 }
- | otherwise
- = dfun_id `setIdUnfolding` mkDFunUnfolding dfun_ty dfun_args
- `setInlinePragma` dfunInlinePragma
- -}
-
--- |Project out the vectorised version of a binding from some closure, or return the original body
--- if that doesn't work.
---
-tryConvert :: Var -- ^Name of the original binding (eg @foo@)
- -> Var -- ^Name of vectorised version of binding (eg @$vfoo@)
- -> CoreExpr -- ^The original body of the binding.
- -> VM CoreExpr
-tryConvert var vect_var rhs
- = fromVect (idType var) (Var vect_var)
- `orElseErrV`
- do
- { emitVt " Could NOT call vectorised from original version" $ ppr var <+> dcolon <+> ppr (idType var)
- ; return rhs
- }
diff --git a/compiler/vectorise/Vectorise/Builtins.hs b/compiler/vectorise/Vectorise/Builtins.hs
deleted file mode 100644
index 7fe5b2cecc..0000000000
--- a/compiler/vectorise/Vectorise/Builtins.hs
+++ /dev/null
@@ -1,35 +0,0 @@
--- Types and functions declared in 'Data.Array.Parallel.Prim' and used by the vectoriser.
---
--- The @Builtins@ structure holds the name of all the things in 'Data.Array.Parallel.Prim' that
--- appear in code generated by the vectoriser.
-
-module Vectorise.Builtins (
- -- * Restrictions
- mAX_DPH_SCALAR_ARGS,
-
- -- * Builtins
- Builtins(..),
-
- -- * Wrapped selectors
- selTy, selsTy,
- selReplicate,
- selTags,
- selElements,
- selsLength,
- sumTyCon,
- prodTyCon,
- prodDataCon,
- replicatePD_PrimVar,
- emptyPD_PrimVar,
- packByTagPD_PrimVar,
- combinePDVar,
- combinePD_PrimVar,
- scalarZip,
- closureCtrFun,
-
- -- * Initialisation
- initBuiltins, initBuiltinVars,
-) where
-
-import Vectorise.Builtins.Base
-import Vectorise.Builtins.Initialise
diff --git a/compiler/vectorise/Vectorise/Builtins/Base.hs b/compiler/vectorise/Vectorise/Builtins/Base.hs
deleted file mode 100644
index ba61a8b548..0000000000
--- a/compiler/vectorise/Vectorise/Builtins/Base.hs
+++ /dev/null
@@ -1,219 +0,0 @@
--- |Builtin types and functions used by the vectoriser. These are all defined in
--- 'Data.Array.Parallel.Prim'.
-
-module Vectorise.Builtins.Base (
- -- * Hard config
- mAX_DPH_PROD,
- mAX_DPH_SUM,
- mAX_DPH_COMBINE,
- mAX_DPH_SCALAR_ARGS,
- aLL_DPH_PRIM_TYCONS,
-
- -- * Builtins
- Builtins(..),
-
- -- * Projections
- selTy, selsTy,
- selReplicate,
- selTags,
- selElements,
- selsLength,
- sumTyCon,
- prodTyCon,
- prodDataCon,
- replicatePD_PrimVar,
- emptyPD_PrimVar,
- packByTagPD_PrimVar,
- combinePDVar,
- combinePD_PrimVar,
- scalarZip,
- closureCtrFun
-) where
-
-import GhcPrelude
-
-import TysPrim
-import BasicTypes
-import Class
-import CoreSyn
-import TysWiredIn hiding (sumTyCon)
-import Type
-import TyCon
-import DataCon
-import NameEnv
-import Name
-import Outputable
-
-import Data.Array
-
-
--- Cardinality of the various families of types and functions exported by the DPH library.
-
-mAX_DPH_PROD :: Int
-mAX_DPH_PROD = 5
-
-mAX_DPH_SUM :: Int
-mAX_DPH_SUM = 2
-
-mAX_DPH_COMBINE :: Int
-mAX_DPH_COMBINE = 2
-
-mAX_DPH_SCALAR_ARGS :: Int
-mAX_DPH_SCALAR_ARGS = 8
-
--- Types from 'GHC.Prim' supported by DPH
---
-aLL_DPH_PRIM_TYCONS :: [Name]
-aLL_DPH_PRIM_TYCONS = map tyConName [intPrimTyCon, {- floatPrimTyCon, -} doublePrimTyCon]
-
-
--- |Holds the names of the types and functions from 'Data.Array.Parallel.Prim' that are used by the
--- vectoriser.
---
-data Builtins
- = Builtins
- { parrayTyCon :: TyCon -- ^ PArray
- , pdataTyCon :: TyCon -- ^ PData
- , pdatasTyCon :: TyCon -- ^ PDatas
- , prClass :: Class -- ^ PR
- , prTyCon :: TyCon -- ^ PR
- , preprTyCon :: TyCon -- ^ PRepr
- , paClass :: Class -- ^ PA
- , paTyCon :: TyCon -- ^ PA
- , paDataCon :: DataCon -- ^ PA
- , paPRSel :: Var -- ^ PA
- , replicatePDVar :: Var -- ^ replicatePD
- , replicatePD_PrimVars :: NameEnv Var -- ^ replicatePD_Int# etc.
- , emptyPDVar :: Var -- ^ emptyPD
- , emptyPD_PrimVars :: NameEnv Var -- ^ emptyPD_Int# etc.
- , packByTagPDVar :: Var -- ^ packByTagPD
- , packByTagPD_PrimVars :: NameEnv Var -- ^ packByTagPD_Int# etc.
- , combinePDVars :: Array Int Var -- ^ combinePD
- , combinePD_PrimVarss :: Array Int (NameEnv Var) -- ^ combine2PD_Int# etc.
- , scalarClass :: Class -- ^ Scalar
- , scalarZips :: Array Int Var -- ^ map, zipWith, zipWith3
- , voidTyCon :: TyCon -- ^ Void
- , voidVar :: Var -- ^ void
- , fromVoidVar :: Var -- ^ fromVoid
- , sumTyCons :: Array Int TyCon -- ^ Sum2 .. Sum3
- , wrapTyCon :: TyCon -- ^ Wrap
- , pvoidVar :: Var -- ^ pvoid
- , pvoidsVar :: Var -- ^ pvoids
- , closureTyCon :: TyCon -- ^ :->
- , closureVar :: Var -- ^ closure
- , liftedClosureVar :: Var -- ^ liftedClosure
- , applyVar :: Var -- ^ $:
- , liftedApplyVar :: Var -- ^ liftedApply
- , closureCtrFuns :: Array Int Var -- ^ closure1 .. closure3
- , selTys :: Array Int Type -- ^ Sel2
- , selsTys :: Array Int Type -- ^ Sels2
- , selsLengths :: Array Int CoreExpr -- ^ lengthSels2
- , selReplicates :: Array Int CoreExpr -- ^ replicate2
- , selTagss :: Array Int CoreExpr -- ^ tagsSel2
- , selElementss :: Array (Int, Int) CoreExpr -- ^ elementsSel2_0 .. elementsSel_2_1
- , liftingContext :: Var -- ^ lc
- }
-
-
--- Projections ----------------------------------------------------------------
--- We use these wrappers instead of indexing the `Builtin` structure directly
--- because they give nicer panic messages if the indexed thing cannot be found.
-
-selTy :: Int -> Builtins -> Type
-selTy = indexBuiltin "selTy" selTys
-
-selsTy :: Int -> Builtins -> Type
-selsTy = indexBuiltin "selsTy" selsTys
-
-selsLength :: Int -> Builtins -> CoreExpr
-selsLength = indexBuiltin "selLength" selsLengths
-
-selReplicate :: Int -> Builtins -> CoreExpr
-selReplicate = indexBuiltin "selReplicate" selReplicates
-
-selTags :: Int -> Builtins -> CoreExpr
-selTags = indexBuiltin "selTags" selTagss
-
-selElements :: Int -> Int -> Builtins -> CoreExpr
-selElements i j = indexBuiltin "selElements" selElementss (i, j)
-
-sumTyCon :: Int -> Builtins -> TyCon
-sumTyCon = indexBuiltin "sumTyCon" sumTyCons
-
-prodTyCon :: Int -> Builtins -> TyCon
-prodTyCon n _
- | n >= 2 && n <= mAX_DPH_PROD
- = tupleTyCon Boxed n
- | otherwise
- = pprPanic "prodTyCon" (ppr n)
-
-prodDataCon :: Int -> Builtins -> DataCon
-prodDataCon n bi
- = case tyConDataCons (prodTyCon n bi) of
- [con] -> con
- _ -> pprPanic "prodDataCon" (ppr n)
-
-replicatePD_PrimVar :: TyCon -> Builtins -> Var
-replicatePD_PrimVar tc bi
- = lookupEnvBuiltin "replicatePD_PrimVar" (replicatePD_PrimVars bi) (tyConName tc)
-
-emptyPD_PrimVar :: TyCon -> Builtins -> Var
-emptyPD_PrimVar tc bi
- = lookupEnvBuiltin "emptyPD_PrimVar" (emptyPD_PrimVars bi) (tyConName tc)
-
-packByTagPD_PrimVar :: TyCon -> Builtins -> Var
-packByTagPD_PrimVar tc bi
- = lookupEnvBuiltin "packByTagPD_PrimVar" (packByTagPD_PrimVars bi) (tyConName tc)
-
-combinePDVar :: Int -> Builtins -> Var
-combinePDVar = indexBuiltin "combinePDVar" combinePDVars
-
-combinePD_PrimVar :: Int -> TyCon -> Builtins -> Var
-combinePD_PrimVar i tc bi
- = lookupEnvBuiltin "combinePD_PrimVar"
- (indexBuiltin "combinePD_PrimVar" combinePD_PrimVarss i bi) (tyConName tc)
-
-scalarZip :: Int -> Builtins -> Var
-scalarZip = indexBuiltin "scalarZip" scalarZips
-
-closureCtrFun :: Int -> Builtins -> Var
-closureCtrFun = indexBuiltin "closureCtrFun" closureCtrFuns
-
--- | Get an element from one of the arrays of `Builtins`.
--- Panic if the indexed thing is not in the array.
-indexBuiltin :: (Ix i, Outputable i)
- => String -- ^ Name of the selector we've used, for panic messages.
- -> (Builtins -> Array i a) -- ^ Field selector for the `Builtins`.
- -> i -- ^ Index into the array.
- -> Builtins
- -> a
-indexBuiltin fn f i bi
- | inRange (bounds xs) i = xs ! i
- | otherwise
- = pprSorry "Vectorise.Builtins.indexBuiltin"
- (vcat [ text ""
- , text "DPH builtin function '" <> text fn <> text "' of size '" <> ppr i <>
- text "' is not yet implemented."
- , text "This function does not appear in your source program, but it is needed"
- , text "to compile your code in the backend. This is a known, current limitation"
- , text "of DPH. If you want it to work, you should send mail to ghc-commits@haskell.org"
- , text "and ask what you can do to help (it might involve some GHC hacking)."])
- where xs = f bi
-
-
--- | Get an entry from one of a 'NameEnv' of `Builtins`. Panic if the named item is not in the array.
-lookupEnvBuiltin :: String -- Function name for error messages
- -> NameEnv a -- Name environment
- -> Name -- Index into the name environment
- -> a
-lookupEnvBuiltin fn env n
- | Just r <- lookupNameEnv env n = r
- | otherwise
- = pprSorry "Vectorise.Builtins.lookupEnvBuiltin"
- (vcat [ text ""
- , text "DPH builtin function '" <> text fn <> text "_" <> ppr n <>
- text "' is not yet implemented."
- , text "This function does not appear in your source program, but it is needed"
- , text "to compile your code in the backend. This is a known, current limitation"
- , text "of DPH. If you want it to work, you should send mail to ghc-commits@haskell.org"
- , text "and ask what you can do to help (it might involve some GHC hacking)."])
diff --git a/compiler/vectorise/Vectorise/Builtins/Initialise.hs b/compiler/vectorise/Vectorise/Builtins/Initialise.hs
deleted file mode 100644
index 0772e5be43..0000000000
--- a/compiler/vectorise/Vectorise/Builtins/Initialise.hs
+++ /dev/null
@@ -1,234 +0,0 @@
--- Set up the data structures provided by 'Vectorise.Builtins'.
-
-module Vectorise.Builtins.Initialise (
- -- * Initialisation
- initBuiltins, initBuiltinVars
-) where
-
-import GhcPrelude
-
-import Vectorise.Builtins.Base
-
-import BasicTypes
-import TysPrim
-import DsMonad
-import TysWiredIn
-import DataCon
-import TyCon
-import Class
-import CoreSyn
-import Type
-import NameEnv
-import Name
-import Id
-import FastString
-import Outputable
-
-import Control.Monad
-import Data.Array
-
-
--- |Create the initial map of builtin types and functions.
---
-initBuiltins :: DsM Builtins
-initBuiltins
- = do { -- 'PArray: representation type for parallel arrays
- ; parrayTyCon <- externalTyCon (fsLit "PArray")
-
- -- 'PData': type family mapping array element types to array representation types
- -- Not all backends use `PDatas`.
- ; pdataTyCon <- externalTyCon (fsLit "PData")
- ; pdatasTyCon <- externalTyCon (fsLit "PDatas")
-
- -- 'PR': class of basic array operators operating on 'PData' types
- ; prClass <- externalClass (fsLit "PR")
- ; let prTyCon = classTyCon prClass
-
- -- 'PRepr': type family mapping element types to representation types
- ; preprTyCon <- externalTyCon (fsLit "PRepr")
-
- -- 'PA': class of basic operations on arrays (parametrised by the element type)
- ; paClass <- externalClass (fsLit "PA")
- ; let paTyCon = classTyCon paClass
- [paDataCon] = tyConDataCons paTyCon
- paPRSel = classSCSelId paClass 0
-
- -- Functions on array representations
- ; replicatePDVar <- externalVar (fsLit "replicatePD")
- ; replicate_vars <- mapM externalVar (suffixed "replicatePA" aLL_DPH_PRIM_TYCONS)
- ; emptyPDVar <- externalVar (fsLit "emptyPD")
- ; empty_vars <- mapM externalVar (suffixed "emptyPA" aLL_DPH_PRIM_TYCONS)
- ; packByTagPDVar <- externalVar (fsLit "packByTagPD")
- ; packByTag_vars <- mapM externalVar (suffixed "packByTagPA" aLL_DPH_PRIM_TYCONS)
- ; let combineNamesD = [("combine" ++ show i ++ "PD") | i <- [2..mAX_DPH_COMBINE]]
- ; let combineNamesA = [("combine" ++ show i ++ "PA") | i <- [2..mAX_DPH_COMBINE]]
- ; combines <- mapM externalVar (map mkFastString combineNamesD)
- ; combines_vars <- mapM (mapM externalVar) $
- map (\name -> suffixed name aLL_DPH_PRIM_TYCONS) combineNamesA
- ; let replicatePD_PrimVars = mkNameEnv (zip aLL_DPH_PRIM_TYCONS replicate_vars)
- emptyPD_PrimVars = mkNameEnv (zip aLL_DPH_PRIM_TYCONS empty_vars)
- packByTagPD_PrimVars = mkNameEnv (zip aLL_DPH_PRIM_TYCONS packByTag_vars)
- combinePDVars = listArray (2, mAX_DPH_COMBINE) combines
- combinePD_PrimVarss = listArray (2, mAX_DPH_COMBINE)
- [ mkNameEnv (zip aLL_DPH_PRIM_TYCONS vars)
- | vars <- combines_vars]
-
- -- 'Scalar': class moving between plain unboxed arrays and 'PData' representations
- ; scalarClass <- externalClass (fsLit "Scalar")
-
- -- N-ary maps ('zipWith' family)
- ; scalar_map <- externalVar (fsLit "scalar_map")
- ; scalar_zip2 <- externalVar (fsLit "scalar_zipWith")
- ; scalar_zips <- mapM externalVar (numbered "scalar_zipWith" 3 mAX_DPH_SCALAR_ARGS)
- ; let scalarZips = listArray (1, mAX_DPH_SCALAR_ARGS)
- (scalar_map : scalar_zip2 : scalar_zips)
-
- -- Types and functions for generic type representations
- ; voidTyCon <- externalTyCon (fsLit "Void")
- ; voidVar <- externalVar (fsLit "void")
- ; fromVoidVar <- externalVar (fsLit "fromVoid")
- ; sum_tcs <- mapM externalTyCon (numbered "Sum" 2 mAX_DPH_SUM)
- ; let sumTyCons = listArray (2, mAX_DPH_SUM) sum_tcs
- ; wrapTyCon <- externalTyCon (fsLit "Wrap")
- ; pvoidVar <- externalVar (fsLit "pvoid")
- ; pvoidsVar <- externalVar (fsLit "pvoids#")
-
- -- Types and functions for closure conversion
- ; closureTyCon <- externalTyCon (fsLit ":->")
- ; closureVar <- externalVar (fsLit "closure")
- ; liftedClosureVar <- externalVar (fsLit "liftedClosure")
- ; applyVar <- externalVar (fsLit "$:")
- ; liftedApplyVar <- externalVar (fsLit "liftedApply")
- ; closures <- mapM externalVar (numbered "closure" 1 mAX_DPH_SCALAR_ARGS)
- ; let closureCtrFuns = listArray (1, mAX_DPH_SCALAR_ARGS) closures
-
- -- Types and functions for selectors
- ; sel_tys <- mapM externalType (numbered "Sel" 2 mAX_DPH_SUM)
- ; sels_tys <- mapM externalType (numbered "Sels" 2 mAX_DPH_SUM)
- ; sels_length <- mapM externalFun (numbered_hash "lengthSels" 2 mAX_DPH_SUM)
- ; sel_replicates <- mapM externalFun (numbered_hash "replicateSel" 2 mAX_DPH_SUM)
- ; sel_tags <- mapM externalFun (numbered "tagsSel" 2 mAX_DPH_SUM)
- ; sel_elements <- mapM mk_elements [(i,j) | i <- [2..mAX_DPH_SUM], j <- [0..i-1]]
- ; let selTys = listArray (2, mAX_DPH_SUM) sel_tys
- selsTys = listArray (2, mAX_DPH_SUM) sels_tys
- selsLengths = listArray (2, mAX_DPH_SUM) sels_length
- selReplicates = listArray (2, mAX_DPH_SUM) sel_replicates
- selTagss = listArray (2, mAX_DPH_SUM) sel_tags
- selElementss = array ((2, 0), (mAX_DPH_SUM, mAX_DPH_SUM)) sel_elements
-
- -- Distinct local variable
- ; liftingContext <- liftM (\u -> mkSysLocalOrCoVar (fsLit "lc") u intPrimTy) newUnique
-
- ; return $ Builtins
- { parrayTyCon = parrayTyCon
- , pdataTyCon = pdataTyCon
- , pdatasTyCon = pdatasTyCon
- , preprTyCon = preprTyCon
- , prClass = prClass
- , prTyCon = prTyCon
- , paClass = paClass
- , paTyCon = paTyCon
- , paDataCon = paDataCon
- , paPRSel = paPRSel
- , replicatePDVar = replicatePDVar
- , replicatePD_PrimVars = replicatePD_PrimVars
- , emptyPDVar = emptyPDVar
- , emptyPD_PrimVars = emptyPD_PrimVars
- , packByTagPDVar = packByTagPDVar
- , packByTagPD_PrimVars = packByTagPD_PrimVars
- , combinePDVars = combinePDVars
- , combinePD_PrimVarss = combinePD_PrimVarss
- , scalarClass = scalarClass
- , scalarZips = scalarZips
- , voidTyCon = voidTyCon
- , voidVar = voidVar
- , fromVoidVar = fromVoidVar
- , sumTyCons = sumTyCons
- , wrapTyCon = wrapTyCon
- , pvoidVar = pvoidVar
- , pvoidsVar = pvoidsVar
- , closureTyCon = closureTyCon
- , closureVar = closureVar
- , liftedClosureVar = liftedClosureVar
- , applyVar = applyVar
- , liftedApplyVar = liftedApplyVar
- , closureCtrFuns = closureCtrFuns
- , selTys = selTys
- , selsTys = selsTys
- , selsLengths = selsLengths
- , selReplicates = selReplicates
- , selTagss = selTagss
- , selElementss = selElementss
- , liftingContext = liftingContext
- }
- }
- where
- suffixed :: String -> [Name] -> [FastString]
- suffixed pfx ns = [mkFastString (pfx ++ "_" ++ (occNameString . nameOccName) n) | n <- ns]
-
- -- Make a list of numbered strings in some range, eg foo3, foo4, foo5
- numbered :: String -> Int -> Int -> [FastString]
- numbered pfx m n = [mkFastString (pfx ++ show i) | i <- [m..n]]
-
- numbered_hash :: String -> Int -> Int -> [FastString]
- numbered_hash pfx m n = [mkFastString (pfx ++ show i ++ "#") | i <- [m..n]]
-
- mk_elements :: (Int, Int) -> DsM ((Int, Int), CoreExpr)
- mk_elements (i,j)
- = do { v <- externalVar $ mkFastString ("elementsSel" ++ show i ++ "_" ++ show j ++ "#")
- ; return ((i, j), Var v)
- }
-
--- |Get the mapping of names in the Prelude to names in the DPH library.
---
-initBuiltinVars :: Builtins -> DsM [(Var, Var)]
--- FIXME: must be replaced by VECTORISE pragmas!!!
-initBuiltinVars (Builtins { })
- = do
- cvars <- mapM externalVar cfs
- return $ zip (map dataConWorkId cons) cvars
- where
- (cons, cfs) = unzip preludeDataCons
-
- preludeDataCons :: [(DataCon, FastString)]
- preludeDataCons
- = [mk_tup n (mkFastString $ "tup" ++ show n) | n <- [2..5]]
- where
- mk_tup n name = (tupleDataCon Boxed n, name)
-
-
--- Auxiliary look up functions -----------------------------------------------
-
--- |Lookup a variable given its name and the module that contains it.
-externalVar :: FastString -> DsM Var
-externalVar fs = dsLookupDPHRdrEnv (mkVarOccFS fs) >>= dsLookupGlobalId
-
-
--- |Like `externalVar` but wrap the `Var` in a `CoreExpr`.
-externalFun :: FastString -> DsM CoreExpr
-externalFun fs = Var <$> externalVar fs
-
-
--- |Lookup a 'TyCon' in 'Data.Array.Parallel.Prim', given its name.
--- Panic if there isn't one.
-externalTyCon :: FastString -> DsM TyCon
-externalTyCon fs = dsLookupDPHRdrEnv (mkTcOccFS fs) >>= dsLookupTyCon
-
-
--- |Lookup some `Type` in 'Data.Array.Parallel.Prim', given its name.
-externalType :: FastString -> DsM Type
-externalType fs
- = do tycon <- externalTyCon fs
- return $ mkTyConApp tycon []
-
-
--- |Lookup a 'Class' in 'Data.Array.Parallel.Prim', given its name.
-externalClass :: FastString -> DsM Class
-externalClass fs
- = do { tycon <- dsLookupDPHRdrEnv (mkClsOccFS fs) >>= dsLookupTyCon
- ; case tyConClass_maybe tycon of
- Nothing -> pprPanic "Vectorise.Builtins.Initialise" $
- text "Data.Array.Parallel.Prim." <>
- ftext fs <+> text "is not a type class"
- Just cls -> return cls
- }
diff --git a/compiler/vectorise/Vectorise/Convert.hs b/compiler/vectorise/Vectorise/Convert.hs
deleted file mode 100644
index dda724ff5a..0000000000
--- a/compiler/vectorise/Vectorise/Convert.hs
+++ /dev/null
@@ -1,104 +0,0 @@
-module Vectorise.Convert
- ( fromVect
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Monad
-import Vectorise.Builtins
-import Vectorise.Type.Type
-
-import CoreSyn
-import TyCon
-import Type
-import TyCoRep
-import NameSet
-import FastString
-import Outputable
-
--- |Convert a vectorised expression such that it computes the non-vectorised equivalent of its
--- value.
---
--- For functions, we eta expand the function and convert the arguments and result:
-
--- For example
--- @
--- \(x :: Double) ->
--- \(y :: Double) ->
--- ($v_foo $: x) $: y
--- @
---
--- We use the type of the original binding to work out how many outer lambdas to add.
---
-fromVect :: Type -- ^ The type of the original binding.
- -> CoreExpr -- ^ Expression giving the closure to use, eg @$v_foo@.
- -> VM CoreExpr
-
--- Convert the type to the core view if it isn't already.
---
-fromVect ty expr
- | Just ty' <- coreView ty
- = fromVect ty' expr
-
--- For each function constructor in the original type we add an outer
--- lambda to bind the parameter variable, and an inner application of it.
-fromVect (FunTy arg_ty res_ty) expr
- = do
- arg <- newLocalVar (fsLit "x") arg_ty
- varg <- toVect arg_ty (Var arg)
- varg_ty <- vectType arg_ty
- vres_ty <- vectType res_ty
- apply <- builtin applyVar
- body <- fromVect res_ty
- $ Var apply `mkTyApps` [varg_ty, vres_ty] `mkApps` [expr, varg]
- return $ Lam arg body
-
--- If the type isn't a function, then we can't current convert it unless the type is scalar (i.e.,
--- is identical to the non-vectorised version).
---
-fromVect ty expr
- = identityConv ty >> return expr
-
--- Convert an expression such that it evaluates to the vectorised equivalent of the value of the
--- original expression.
---
--- WARNING: Currently only works for the scalar types, where the vectorised value coincides with the
--- original one.
---
-toVect :: Type -> CoreExpr -> VM CoreExpr
-toVect ty expr = identityConv ty >> return expr
-
--- |Check that the type is neutral under type vectorisation — i.e., all involved type constructor
--- are not altered by vectorisation as they contain no parallel arrays.
---
-identityConv :: Type -> VM ()
-identityConv ty
- | Just ty' <- coreView ty
- = identityConv ty'
-identityConv (TyConApp tycon tys)
- = do { mapM_ identityConv tys
- ; identityConvTyCon tycon
- }
-identityConv (LitTy {}) = noV $ text "identityConv: not sure about literal types under vectorisation"
-identityConv (TyVarTy {}) = noV $ text "identityConv: type variable changes under vectorisation"
-identityConv (AppTy {}) = noV $ text "identityConv: type appl. changes under vectorisation"
-identityConv (FunTy {}) = noV $ text "identityConv: function type changes under vectorisation"
-identityConv (ForAllTy {}) = noV $ text "identityConv: quantified type changes under vectorisation"
-identityConv (CastTy {}) = noV $ text "identityConv: not sure about casted types under vectorisation"
-identityConv (CoercionTy {}) = noV $ text "identityConv: not sure about coercions under vectorisation"
-
--- |Check that this type constructor is not changed by vectorisation — i.e., it does not embed any
--- parallel arrays.
---
-identityConvTyCon :: TyCon -> VM ()
-identityConvTyCon tc
- = do
- { isParallel <- (tyConName tc `elemNameSet`) <$> globalParallelTyCons
- ; parray <- builtin parrayTyCon
- ; if isParallel && not (tc == parray)
- then noV idErr
- else return ()
- }
- where
- idErr = text "identityConvTyCon: type constructor contains parallel arrays" <+> ppr tc
diff --git a/compiler/vectorise/Vectorise/Env.hs b/compiler/vectorise/Vectorise/Env.hs
deleted file mode 100644
index 8ae35896e1..0000000000
--- a/compiler/vectorise/Vectorise/Env.hs
+++ /dev/null
@@ -1,240 +0,0 @@
-module Vectorise.Env (
- Scope(..),
-
- -- * Local Environments
- LocalEnv(..),
- emptyLocalEnv,
-
- -- * Global Environments
- GlobalEnv(..),
- initGlobalEnv,
- extendImportedVarsEnv,
- extendFamEnv,
- setPAFunsEnv,
- setPRFunsEnv,
- modVectInfo
-) where
-
-import GhcPrelude
-
-import HscTypes
-import InstEnv
-import FamInstEnv
-import CoreSyn
-import Type
-import Class
-import TyCon
-import DataCon
-import VarEnv
-import VarSet
-import Var
-import NameSet
-import Name
-import NameEnv
-import FastString
-import UniqDFM
-import UniqSet
-
-
-import Data.Maybe
-
-
--- |Indicates what scope something (a variable) is in.
---
-data Scope a b
- = Global a
- | Local b
-
-
--- LocalEnv -------------------------------------------------------------------
-
--- |The local environment.
---
-data LocalEnv
- = LocalEnv
- { local_vars :: VarEnv (Var, Var)
- -- ^Mapping from local variables to their vectorised and lifted versions.
-
- , local_tyvars :: [TyVar]
- -- ^In-scope type variables.
-
- , local_tyvar_pa :: VarEnv CoreExpr
- -- ^Mapping from tyvars to their PA dictionaries.
-
- , local_bind_name :: FastString
- -- ^Local binding name. This is only used to generate better names for hoisted
- -- expressions.
- }
-
--- |Create an empty local environment.
---
-emptyLocalEnv :: LocalEnv
-emptyLocalEnv = LocalEnv
- { local_vars = emptyVarEnv
- , local_tyvars = []
- , local_tyvar_pa = emptyVarEnv
- , local_bind_name = fsLit "fn"
- }
-
-
--- GlobalEnv ------------------------------------------------------------------
-
--- |The global environment: entities that exist at top-level.
---
-data GlobalEnv
- = GlobalEnv
- { global_vect_avoid :: Bool
- -- ^'True' implies to avoid vectorisation as far as possible.
-
- , global_vars :: VarEnv Var
- -- ^Mapping from global variables to their vectorised versions — aka the /vectorisation
- -- map/.
-
- , global_parallel_vars :: DVarSet
- -- ^The domain of 'global_vars'.
- --
- -- This information is not redundant as it is impossible to extract the domain from a
- -- 'VarEnv' (which is keyed on uniques alone). Moreover, we have mapped variables that
- -- do not involve parallelism — e.g., the workers of vectorised, but scalar data types.
- -- In addition, workers of parallel data types that we could not vectorise also need to
- -- be tracked.
-
- , global_vect_decls :: VarEnv (Maybe (Type, CoreExpr))
- -- ^Mapping from global variables that have a vectorisation declaration to the right-hand
- -- side of that declaration and its type and mapping variables that have NOVECTORISE
- -- declarations to 'Nothing'.
-
- , global_tycons :: NameEnv TyCon
- -- ^Mapping from TyCons to their vectorised versions. The vectorised version will be
- -- identical to the original version if it is not changed by vectorisation. In any case,
- -- if a tycon appears in the domain of this mapping, it was successfully vectorised.
-
- , global_parallel_tycons :: NameSet
- -- ^Type constructors whose definition directly or indirectly includes a parallel type,
- -- such as '[::]'.
- --
- -- NB: This information is not redundant as some types have got a mapping in
- -- 'global_tycons' (to a type other than themselves) and are still not parallel. An
- -- example is '(->)'. Moreover, some types have *not* got a mapping in 'global_tycons'
- -- (because they couldn't be vectorised), but still contain parallel types.
-
- , global_datacons :: NameEnv DataCon
- -- ^Mapping from DataCons to their vectorised versions.
-
- , global_pa_funs :: NameEnv Var
- -- ^Mapping from TyCons to their PA dfuns.
-
- , global_pr_funs :: NameEnv Var
- -- ^Mapping from TyCons to their PR dfuns.
-
- , global_inst_env :: InstEnvs
- -- ^External package inst-env & home-package inst-env for class instances.
-
- , global_fam_inst_env :: FamInstEnvs
- -- ^External package inst-env & home-package inst-env for family instances.
-
- , global_bindings :: [(Var, CoreExpr)]
- -- ^Hoisted bindings — temporary storage for toplevel bindings during code gen.
- }
-
--- |Create an initial global environment.
---
--- We add scalar variables and type constructors identified by vectorisation pragmas already here
--- to the global table, so that we can query scalarness during vectorisation, and especially, when
--- vectorising the scalar entities' definitions themselves.
---
-initGlobalEnv :: Bool
- -> VectInfo
- -> [CoreVect]
- -> InstEnvs
- -> FamInstEnvs
- -> GlobalEnv
-initGlobalEnv vectAvoid info vectDecls instEnvs famInstEnvs
- = GlobalEnv
- { global_vect_avoid = vectAvoid
- , global_vars = mapVarEnv snd $ udfmToUfm $ vectInfoVar info
- , global_vect_decls = mkVarEnv vects
- , global_parallel_vars = vectInfoParallelVars info
- , global_parallel_tycons = vectInfoParallelTyCons info
- , global_tycons = mapNameEnv snd $ vectInfoTyCon info
- , global_datacons = mapNameEnv snd $ vectInfoDataCon info
- , global_pa_funs = emptyNameEnv
- , global_pr_funs = emptyNameEnv
- , global_inst_env = instEnvs
- , global_fam_inst_env = famInstEnvs
- , global_bindings = []
- }
- where
- vects = [(var, Just (ty, exp)) | Vect var exp@(Var rhs_var) <- vectDecls
- , let ty = varType rhs_var] ++
- -- FIXME: we currently only allow RHSes consisting of a
- -- single variable to be able to obtain the type without
- -- inference — see also 'TcBinds.tcVect'
- [(var, Nothing) | NoVect var <- vectDecls]
-
-
--- Operators on Global Environments -------------------------------------------
-
--- |Extend the list of global variables in an environment.
---
-extendImportedVarsEnv :: [(Var, Var)] -> GlobalEnv -> GlobalEnv
-extendImportedVarsEnv ps genv
- = genv { global_vars = extendVarEnvList (global_vars genv) ps }
-
--- |Extend the list of type family instances.
---
-extendFamEnv :: [FamInst] -> GlobalEnv -> GlobalEnv
-extendFamEnv new genv
- = genv { global_fam_inst_env = (g_fam_inst, extendFamInstEnvList l_fam_inst new) }
- where (g_fam_inst, l_fam_inst) = global_fam_inst_env genv
-
--- |Set the list of PA functions in an environment.
---
-setPAFunsEnv :: [(Name, Var)] -> GlobalEnv -> GlobalEnv
-setPAFunsEnv ps genv = genv { global_pa_funs = mkNameEnv ps }
-
--- |Set the list of PR functions in an environment.
---
-setPRFunsEnv :: [(Name, Var)] -> GlobalEnv -> GlobalEnv
-setPRFunsEnv ps genv = genv { global_pr_funs = mkNameEnv ps }
-
--- |Compute vectorisation information that goes into 'ModGuts' (and is stored in interface files).
--- The incoming 'vectInfo' is that from the 'HscEnv' and 'EPS'. The outgoing one contains only the
--- declarations for the currently compiled module; this includes variables, type constructors, and
--- data constructors referenced in VECTORISE pragmas, even if they are defined in an imported
--- module.
---
--- The variables explicitly include class selectors and dfuns.
---
-modVectInfo :: GlobalEnv -> [Id] -> [TyCon] -> [CoreVect]-> VectInfo -> VectInfo
-modVectInfo env mg_ids mg_tyCons vectDecls info
- = info
- { vectInfoVar = mk_denv ids (global_vars env)
- , vectInfoTyCon = mk_env tyCons (global_tycons env)
- , vectInfoDataCon = mk_env dataCons (global_datacons env)
- , vectInfoParallelVars = (global_parallel_vars env `minusDVarSet` vectInfoParallelVars info)
- `udfmIntersectUFM` (getUniqSet $ mkVarSet ids)
- , vectInfoParallelTyCons = global_parallel_tycons env `minusNameSet` vectInfoParallelTyCons info
- }
- where
- vectIds = [id | Vect id _ <- vectDecls] ++
- [id | VectInst id <- vectDecls]
- vectTypeTyCons = [tycon | VectType _ tycon _ <- vectDecls] ++
- [tycon | VectClass tycon <- vectDecls]
- vectDataCons = concatMap tyConDataCons vectTypeTyCons
- ids = mg_ids ++ vectIds ++ dataConIds ++ selIds
- tyCons = mg_tyCons ++ vectTypeTyCons
- dataCons = concatMap tyConDataCons mg_tyCons ++ vectDataCons
- dataConIds = map dataConWorkId dataCons
- selIds = concat [ classAllSelIds cls
- | tycon <- tyCons
- , cls <- maybeToList . tyConClass_maybe $ tycon]
-
- -- Produce an entry for every declaration that is mentioned in the domain of the 'inspectedEnv'
- mk_env decls inspectedEnv = mkNameEnv $ mk_assoc_env decls inspectedEnv
- mk_denv decls inspectedEnv = listToUDFM $ mk_assoc_env decls inspectedEnv
- mk_assoc_env decls inspectedEnv
- = [(name, (decl, to))
- | decl <- decls
- , let name = getName decl
- , Just to <- [lookupNameEnv inspectedEnv name]]
diff --git a/compiler/vectorise/Vectorise/Exp.hs b/compiler/vectorise/Vectorise/Exp.hs
deleted file mode 100644
index c5de9c4250..0000000000
--- a/compiler/vectorise/Vectorise/Exp.hs
+++ /dev/null
@@ -1,1260 +0,0 @@
-{-# LANGUAGE CPP, TupleSections #-}
-
--- |Vectorisation of expressions.
-
-module Vectorise.Exp
- ( -- * Vectorise right-hand sides of toplevel bindings
- vectTopExpr
- , vectTopExprs
- , vectScalarFun
- , vectScalarDFun
- )
-where
-
-#include "HsVersions.h"
-
-import GhcPrelude
-
-import Vectorise.Type.Type
-import Vectorise.Var
-import Vectorise.Convert
-import Vectorise.Vect
-import Vectorise.Env
-import Vectorise.Monad
-import Vectorise.Builtins
-import Vectorise.Utils
-
-import CoreUtils
-import MkCore
-import CoreSyn
-import CoreFVs
-import Class
-import DataCon
-import TyCon
-import TcType
-import Type
-import TyCoRep
-import Var
-import VarEnv
-import VarSet
-import NameSet
-import Id
-import BasicTypes( isStrongLoopBreaker )
-import Literal
-import TysPrim
-import Outputable
-import FastString
-import DynFlags
-import Util
-
-import Control.Monad
-import Data.Maybe
-import Data.List
-
-
--- Main entry point to vectorise expressions -----------------------------------
-
--- |Vectorise a polymorphic expression that forms a *non-recursive* binding.
---
--- Return 'Nothing' if the expression is scalar; otherwise, the first component of the result
--- (which is of type 'Bool') indicates whether the expression is parallel (i.e., whether it is
--- tagged as 'VIParr').
---
--- We have got the non-recursive case as a special case as it doesn't require to compute
--- vectorisation information twice.
---
-vectTopExpr :: Var -> CoreExpr -> VM (Maybe (Bool, Inline, CoreExpr))
-vectTopExpr var expr
- = do
- { exprVI <- encapsulateScalars <=< vectAvoidInfo emptyVarSet . freeVars $ expr
- ; if isVIEncaps exprVI
- then
- return Nothing
- else do
- { vExpr <- closedV $
- inBind var $
- vectAnnPolyExpr False exprVI
- ; inline <- computeInline exprVI
- ; return $ Just (isVIParr exprVI, inline, vectorised vExpr)
- }
- }
-
--- Compute the inlining hint for the right-hand side of a top-level binding.
---
-computeInline :: CoreExprWithVectInfo -> VM Inline
-computeInline ((_, VIDict), _) = return $ DontInline
-computeInline (_, AnnTick _ expr) = computeInline expr
-computeInline expr@(_, AnnLam _ _) = Inline <$> polyArity tvs
- where
- (tvs, _) = collectAnnTypeBinders expr
-computeInline _expr = return $ DontInline
-
--- |Vectorise a recursive group of top-level polymorphic expressions.
---
--- Return 'Nothing' if the expression group is scalar; otherwise, the first component of the result
--- (which is of type 'Bool') indicates whether the expressions are parallel (i.e., whether they are
--- tagged as 'VIParr').
---
-vectTopExprs :: [(Var, CoreExpr)] -> VM (Maybe (Bool, [(Inline, CoreExpr)]))
-vectTopExprs binds
- = do
- { exprVIs <- mapM (vectAvoidAndEncapsulate emptyVarSet) exprs
- ; if all isVIEncaps exprVIs
- -- if all bindings are scalar => don't vectorise this group of bindings
- then return Nothing
- else do
- { -- non-scalar bindings need to be vectorised
- ; let areVIParr = any isVIParr exprVIs
- ; revised_exprVIs <- if not areVIParr
- -- if no binding is parallel => 'exprVIs' is ready for vectorisation
- then return exprVIs
- -- if any binding is parallel => recompute the vectorisation info
- else mapM (vectAvoidAndEncapsulate (mkVarSet vars)) exprs
-
- ; vExprs <- zipWithM vect vars revised_exprVIs
- ; return $ Just (areVIParr, vExprs)
- }
- }
- where
- (vars, exprs) = unzip binds
-
- vectAvoidAndEncapsulate pvs = encapsulateScalars <=< vectAvoidInfo pvs . freeVars
-
- vect var exprVI
- = do
- { vExpr <- closedV $
- inBind var $
- vectAnnPolyExpr (isStrongLoopBreaker $ idOccInfo var) exprVI
- ; inline <- computeInline exprVI
- ; return (inline, vectorised vExpr)
- }
-
--- |Vectorise a polymorphic expression annotated with vectorisation information.
---
--- The special case of dictionary functions is currently handled separately. (Would be neater to
--- integrate them, though!)
---
-vectAnnPolyExpr :: Bool -> CoreExprWithVectInfo -> VM VExpr
-vectAnnPolyExpr loop_breaker (_, AnnTick tickish expr)
- -- traverse through ticks
- = vTick tickish <$> vectAnnPolyExpr loop_breaker expr
-vectAnnPolyExpr loop_breaker expr
- | isVIDict expr
- -- special case the right-hand side of dictionary functions
- = (, undefined) <$> vectDictExpr (deAnnotate expr)
- | otherwise
- -- collect and vectorise type abstractions; then, descent into the body
- = polyAbstract tvs $ \args ->
- mapVect (mkLams $ tvs ++ args) <$> vectFnExpr False loop_breaker mono
- where
- (tvs, mono) = collectAnnTypeBinders expr
-
--- Encapsulate every purely sequential subexpression of a (potentially) parallel expression into a
--- lambda abstraction over all its free variables followed by the corresponding application to those
--- variables. We can, then, avoid the vectorisation of the ensapsulated subexpressions.
---
--- Preconditions:
---
--- * All free variables and the result type must be /simple/ types.
--- * The expression is sufficiently complex (to warrant special treatment). For now, that is
--- every expression that is not constant and contains at least one operation.
---
---
--- The user has an option to choose between aggressive and minimal vectorisation avoidance. With
--- minimal vectorisation avoidance, we only encapsulate individual scalar operations. With
--- aggressive vectorisation avoidance, we encapsulate subexpression that are as big as possible.
---
-encapsulateScalars :: CoreExprWithVectInfo -> VM CoreExprWithVectInfo
-encapsulateScalars ce@(_, AnnType _ty)
- = return ce
-encapsulateScalars ce@((_, VISimple), AnnVar _v)
- -- NB: diverts from the paper: encapsulate scalar variables (including functions)
- = liftSimpleAndCase ce
-encapsulateScalars ce@(_, AnnVar _v)
- = return ce
-encapsulateScalars ce@(_, AnnLit _)
- = return ce
-encapsulateScalars ((fvs, vi), AnnTick tck expr)
- = do
- { encExpr <- encapsulateScalars expr
- ; return ((fvs, vi), AnnTick tck encExpr)
- }
-encapsulateScalars ce@((fvs, vi), AnnLam bndr expr)
- = do
- { vectAvoid <- isVectAvoidanceAggressive
- ; varsS <- allScalarVarTypeSet fvs
- -- NB: diverts from the paper: we need to check the scalarness of bound variables as well,
- -- as 'vectScalarFun' will handle them just the same as those introduced for the 'fvs'
- -- by encapsulation.
- ; bndrsS <- allScalarVarType bndrs
- ; case (vi, vectAvoid && varsS && bndrsS) of
- (VISimple, True) -> liftSimpleAndCase ce
- _ -> do
- { encExpr <- encapsulateScalars expr
- ; return ((fvs, vi), AnnLam bndr encExpr)
- }
- }
- where
- (bndrs, _) = collectAnnBndrs ce
-encapsulateScalars ce@((fvs, vi), AnnApp ce1 ce2)
- = do
- { vectAvoid <- isVectAvoidanceAggressive
- ; varsS <- allScalarVarTypeSet fvs
- ; case (vi, (vectAvoid || isSimpleApplication ce) && varsS) of
- (VISimple, True) -> liftSimpleAndCase ce
- _ -> do
- { encCe1 <- encapsulateScalars ce1
- ; encCe2 <- encapsulateScalars ce2
- ; return ((fvs, vi), AnnApp encCe1 encCe2)
- }
- }
- where
- isSimpleApplication :: CoreExprWithVectInfo -> Bool
- isSimpleApplication (_, AnnTick _ ce) = isSimpleApplication ce
- isSimpleApplication (_, AnnCast ce _) = isSimpleApplication ce
- isSimpleApplication ce | isSimple ce = True
- isSimpleApplication (_, AnnApp ce1 ce2) = isSimple ce1 && isSimpleApplication ce2
- isSimpleApplication _ = False
- --
- isSimple :: CoreExprWithVectInfo -> Bool
- isSimple (_, AnnType {}) = True
- isSimple (_, AnnVar {}) = True
- isSimple (_, AnnLit {}) = True
- isSimple (_, AnnTick _ ce) = isSimple ce
- isSimple (_, AnnCast ce _) = isSimple ce
- isSimple _ = False
-encapsulateScalars ce@((fvs, vi), AnnCase scrut bndr ty alts)
- = do
- { vectAvoid <- isVectAvoidanceAggressive
- ; varsS <- allScalarVarTypeSet fvs
- ; case (vi, vectAvoid && varsS) of
- (VISimple, True) -> liftSimpleAndCase ce
- _ -> do
- { encScrut <- encapsulateScalars scrut
- ; encAlts <- mapM encAlt alts
- ; return ((fvs, vi), AnnCase encScrut bndr ty encAlts)
- }
- }
- where
- encAlt (con, bndrs, expr) = (con, bndrs,) <$> encapsulateScalars expr
-encapsulateScalars ce@((fvs, vi), AnnLet (AnnNonRec bndr expr1) expr2)
- = do
- { vectAvoid <- isVectAvoidanceAggressive
- ; varsS <- allScalarVarTypeSet fvs
- ; case (vi, vectAvoid && varsS) of
- (VISimple, True) -> liftSimpleAndCase ce
- _ -> do
- { encExpr1 <- encapsulateScalars expr1
- ; encExpr2 <- encapsulateScalars expr2
- ; return ((fvs, vi), AnnLet (AnnNonRec bndr encExpr1) encExpr2)
- }
- }
-encapsulateScalars ce@((fvs, vi), AnnLet (AnnRec binds) expr)
- = do
- { vectAvoid <- isVectAvoidanceAggressive
- ; varsS <- allScalarVarTypeSet fvs
- ; case (vi, vectAvoid && varsS) of
- (VISimple, True) -> liftSimpleAndCase ce
- _ -> do
- { encBinds <- mapM encBind binds
- ; encExpr <- encapsulateScalars expr
- ; return ((fvs, vi), AnnLet (AnnRec encBinds) encExpr)
- }
- }
- where
- encBind (bndr, expr) = (bndr,) <$> encapsulateScalars expr
-encapsulateScalars ((fvs, vi), AnnCast expr coercion)
- = do
- { encExpr <- encapsulateScalars expr
- ; return ((fvs, vi), AnnCast encExpr coercion)
- }
-encapsulateScalars _
- = panic "Vectorise.Exp.encapsulateScalars: unknown constructor"
-
--- Lambda-lift the given simple expression and apply it to the abstracted free variables.
---
--- If the expression is a case expression scrutinising anything, but a scalar type, then lift
--- each alternative individually.
---
-liftSimpleAndCase :: CoreExprWithVectInfo -> VM CoreExprWithVectInfo
-liftSimpleAndCase aexpr@((fvs, _vi), AnnCase expr bndr t alts)
- = do
- { vi <- vectAvoidInfoTypeOf expr
- ; if (vi == VISimple)
- then
- liftSimple aexpr -- if the scrutinee is scalar, we need no special treatment
- else do
- { alts' <- mapM (\(ac, bndrs, aexpr) -> (ac, bndrs,) <$> liftSimpleAndCase aexpr) alts
- ; return ((fvs, vi), AnnCase expr bndr t alts')
- }
- }
-liftSimpleAndCase aexpr = liftSimple aexpr
-
-liftSimple :: CoreExprWithVectInfo -> VM CoreExprWithVectInfo
-liftSimple ((fvs, vi), AnnVar v)
- | v `elemDVarSet` fvs -- special case to avoid producing: (\v -> v) v
- && not (isToplevel v) -- NB: if 'v' not free or is toplevel, we must get the 'VIEncaps'
- = return $ ((fvs, vi), AnnVar v)
-liftSimple aexpr@((fvs_orig, VISimple), expr)
- = do
- { let liftedExpr = mkAnnApps (mkAnnLams (reverse vars) fvs expr) vars
-
- ; traceVt "encapsulate:" $ ppr (deAnnotate aexpr) $$ text "==>" $$ ppr (deAnnotate liftedExpr)
-
- ; return $ liftedExpr
- }
- where
- vars = dVarSetElems fvs
- fvs = filterDVarSet (not . isToplevel) fvs_orig -- only include 'Id's that are not toplevel
-
- mkAnnLams :: [Var] -> DVarSet -> AnnExpr' Var (DVarSet, VectAvoidInfo) -> CoreExprWithVectInfo
- mkAnnLams [] fvs expr = ASSERT(isEmptyDVarSet fvs)
- ((emptyDVarSet, VIEncaps), expr)
- mkAnnLams (v:vs) fvs expr = mkAnnLams vs (fvs `delDVarSet` v) (AnnLam v ((fvs, VIEncaps), expr))
-
- mkAnnApps :: CoreExprWithVectInfo -> [Var] -> CoreExprWithVectInfo
- mkAnnApps aexpr [] = aexpr
- mkAnnApps aexpr (v:vs) = mkAnnApps (mkAnnApp aexpr v) vs
-
- mkAnnApp :: CoreExprWithVectInfo -> Var -> CoreExprWithVectInfo
- mkAnnApp aexpr@((fvs, _vi), _expr) v
- = ((fvs `extendDVarSet` v, VISimple), AnnApp aexpr ((unitDVarSet v, VISimple), AnnVar v))
-liftSimple aexpr
- = pprPanic "Vectorise.Exp.liftSimple: not simple" $ ppr (deAnnotate aexpr)
-
-isToplevel :: Var -> Bool
-isToplevel v | isId v = case realIdUnfolding v of
- NoUnfolding -> False
- BootUnfolding -> False
- OtherCon {} -> True
- DFunUnfolding {} -> True
- CoreUnfolding {uf_is_top = top} -> top
- | otherwise = False
-
--- |Vectorise an expression.
---
-vectExpr :: CoreExprWithVectInfo -> VM VExpr
-
-vectExpr aexpr
- -- encapsulated expression of functional type => try to vectorise as a scalar subcomputation
- | (isFunTy . annExprType $ aexpr) && isVIEncaps aexpr
- = vectFnExpr True False aexpr
- -- encapsulated constant => vectorise as a scalar constant
- | isVIEncaps aexpr
- = traceVt "vectExpr (encapsulated constant):" (ppr . deAnnotate $ aexpr) >>
- vectConst (deAnnotate aexpr)
-
-vectExpr (_, AnnVar v)
- = vectVar v
-
-vectExpr (_, AnnLit lit)
- = vectConst $ Lit lit
-
-vectExpr aexpr@(_, AnnLam _ _)
- = traceVt "vectExpr [AnnLam]:" (ppr . deAnnotate $ aexpr) >>
- vectFnExpr True False aexpr
-
- -- SPECIAL CASE: Vectorise/lift 'patError @ ty err' by only vectorising/lifting the type 'ty';
- -- its only purpose is to abort the program, but we need to adjust the type to keep CoreLint
- -- happy.
--- FIXME: can't be do this with a VECTORISE pragma on 'pAT_ERROR_ID' now?
-vectExpr (_, AnnApp (_, AnnApp (_, AnnVar v) (_, AnnType ty)) err)
- | v == pAT_ERROR_ID
- = do
- { (vty, lty) <- vectAndLiftType ty
- ; return (mkCoreApps (Var v) [Type (getRuntimeRep vty), Type vty, err'],
- mkCoreApps (Var v) [Type lty, err'])
- }
- where
- err' = deAnnotate err
-
- -- type application (handle multiple consecutive type applications simultaneously to ensure the
- -- PA dictionaries are put at the right places)
-vectExpr e@(_, AnnApp _ arg)
- | isAnnTypeArg arg
- = vectPolyApp e
-
- -- Lifted literal
-vectExpr (_, AnnApp (_, AnnVar v) (_, AnnLit lit))
- | Just _con <- isDataConId_maybe v
- = do
- { let vexpr = App (Var v) (Lit lit)
- ; lexpr <- liftPD vexpr
- ; return (vexpr, lexpr)
- }
-
- -- value application (dictionary or user value)
-vectExpr e@(_, AnnApp fn arg)
- | isPredTy arg_ty -- dictionary application (whose result is not a dictionary)
- = vectPolyApp e
- | otherwise -- user value
- = do
- { -- vectorise the types
- ; varg_ty <- vectType arg_ty
- ; vres_ty <- vectType res_ty
-
- -- vectorise the function and argument expression
- ; vfn <- vectExpr fn
- ; varg <- vectExpr arg
-
- -- the vectorised function is a closure; apply it to the vectorised argument
- ; mkClosureApp varg_ty vres_ty vfn varg
- }
- where
- (arg_ty, res_ty) = splitFunTy . exprType $ deAnnotate fn
-
-vectExpr (_, AnnCase scrut bndr ty alts)
- | Just (tycon, ty_args) <- splitTyConApp_maybe scrut_ty
- , isAlgTyCon tycon
- = vectAlgCase tycon ty_args scrut bndr ty alts
- | otherwise
- = do
- { dflags <- getDynFlags
- ; cantVectorise dflags "Can't vectorise expression (no algebraic type constructor)" $
- ppr scrut_ty
- }
- where
- scrut_ty = exprType (deAnnotate scrut)
-
-vectExpr (_, AnnLet (AnnNonRec bndr rhs) body)
- = do
- { traceVt "let binding (non-recursive)" Outputable.empty
- ; vrhs <- localV $
- inBind bndr $
- vectAnnPolyExpr False rhs
- ; traceVt "let body (non-recursive)" Outputable.empty
- ; (vbndr, vbody) <- vectBndrIn bndr (vectExpr body)
- ; return $ vLet (vNonRec vbndr vrhs) vbody
- }
-
-vectExpr (_, AnnLet (AnnRec bs) body)
- = do
- { (vbndrs, (vrhss, vbody)) <- vectBndrsIn bndrs $ do
- { traceVt "let bindings (recursive)" Outputable.empty
- ; vrhss <- zipWithM vect_rhs bndrs rhss
- ; traceVt "let body (recursive)" Outputable.empty
- ; vbody <- vectExpr body
- ; return (vrhss, vbody)
- }
- ; return $ vLet (vRec vbndrs vrhss) vbody
- }
- where
- (bndrs, rhss) = unzip bs
-
- vect_rhs bndr rhs = localV $
- inBind bndr $
- vectAnnPolyExpr (isStrongLoopBreaker $ idOccInfo bndr) rhs
-
-vectExpr (_, AnnTick tickish expr)
- = vTick tickish <$> vectExpr expr
-
-vectExpr (_, AnnType ty)
- = vType <$> vectType ty
-
-vectExpr e
- = do
- { dflags <- getDynFlags
- ; cantVectorise dflags "Can't vectorise expression (vectExpr)" $ ppr (deAnnotate e)
- }
-
--- |Vectorise an expression that *may* have an outer lambda abstraction. If the expression is marked
--- as encapsulated ('VIEncaps'), vectorise it as a scalar computation (using a generalised scalar
--- zip).
---
--- We do not handle type variables at this point, as they will already have been stripped off by
--- 'vectPolyExpr'. We also only have to worry about one set of dictionary arguments as we (1) only
--- deal with Haskell 2011 and (2) class selectors are vectorised elsewhere.
---
-vectFnExpr :: Bool -- ^If we process the RHS of a binding, whether that binding
- -- should be inlined
- -> Bool -- ^Whether the binding is a loop breaker
- -> CoreExprWithVectInfo -- ^Expression to vectorise; must have an outer `AnnLam`
- -> VM VExpr
-vectFnExpr inline loop_breaker aexpr@(_ann, AnnLam bndr body)
- -- predicate abstraction: leave as a normal abstraction, but vectorise the predicate type
- | isId bndr
- && isPredTy (idType bndr)
- = do
- { vBndr <- vectBndr bndr
- ; vbody <- vectFnExpr inline loop_breaker body
- ; return $ mapVect (mkLams [vectorised vBndr]) vbody
- }
- -- encapsulated non-predicate abstraction: vectorise as a scalar computation
- | isId bndr && isVIEncaps aexpr
- = vectScalarFun . deAnnotate $ aexpr
- -- non-predicate abstraction: vectorise as a non-scalar computation
- | isId bndr
- = vectLam inline loop_breaker aexpr
- | otherwise
- = do
- { dflags <- getDynFlags
- ; cantVectorise dflags "Vectorise.Exp.vectFnExpr: Unexpected type lambda" $
- ppr (deAnnotate aexpr)
- }
-vectFnExpr _ _ aexpr
- -- encapsulated function: vectorise as a scalar computation
- | (isFunTy . annExprType $ aexpr) && isVIEncaps aexpr
- = vectScalarFun . deAnnotate $ aexpr
- | otherwise
- -- not an abstraction: vectorise as a non-scalar vanilla expression
- -- NB: we can get here due to the recursion in the first case above and from 'vectAnnPolyExpr'
- = vectExpr aexpr
-
--- |Vectorise type and dictionary applications.
---
--- These are always headed by a variable (as we don't support higher-rank polymorphism), but may
--- involve two sets of type variables and dictionaries. Consider,
---
--- > class C a where
--- > m :: D b => b -> a
---
--- The type of 'm' is 'm :: forall a. C a => forall b. D b => b -> a'.
---
-vectPolyApp :: CoreExprWithVectInfo -> VM VExpr
-vectPolyApp e0
- = case e4 of
- (_, AnnVar var)
- -> do { -- get the vectorised form of the variable
- ; vVar <- lookupVar var
- ; traceVt "vectPolyApp of" (ppr var)
-
- -- vectorise type and dictionary arguments
- ; vDictsOuter <- mapM vectDictExpr (map deAnnotate dictsOuter)
- ; vDictsInner <- mapM vectDictExpr (map deAnnotate dictsInner)
- ; vTysOuter <- mapM vectType tysOuter
- ; vTysInner <- mapM vectType tysInner
-
- ; let reconstructOuter v = (`mkApps` vDictsOuter) <$> polyApply v vTysOuter
-
- ; case vVar of
- Local (vv, lv)
- -> do { MASSERT( null dictsInner ) -- local vars cannot be class selectors
- ; traceVt " LOCAL" (text "")
- ; (,) <$> reconstructOuter (Var vv) <*> reconstructOuter (Var lv)
- }
- Global vv
- | isDictComp var -- dictionary computation
- -> do { -- in a dictionary computation, the innermost, non-empty set of
- -- arguments are non-vectorised arguments, where no 'PA'dictionaries
- -- are needed for the type variables
- ; ve <- if null dictsInner
- then
- return $ Var vv `mkTyApps` vTysOuter `mkApps` vDictsOuter
- else
- reconstructOuter
- (Var vv `mkTyApps` vTysInner `mkApps` vDictsInner)
- ; traceVt " GLOBAL (dict):" (ppr ve)
- ; vectConst ve
- }
- | otherwise -- non-dictionary computation
- -> do { MASSERT( null dictsInner )
- ; ve <- reconstructOuter (Var vv)
- ; traceVt " GLOBAL (non-dict):" (ppr ve)
- ; vectConst ve
- }
- }
- _ -> pprSorry "Cannot vectorise programs with higher-rank types:" (ppr . deAnnotate $ e0)
- where
- -- if there is only one set of variables or dictionaries, it will be the outer set
- (e1, dictsOuter) = collectAnnDictArgs e0
- (e2, tysOuter) = collectAnnTypeArgs e1
- (e3, dictsInner) = collectAnnDictArgs e2
- (e4, tysInner) = collectAnnTypeArgs e3
- --
- isDictComp var = (isJust . isClassOpId_maybe $ var) || isDFunId var
-
--- |Vectorise the body of a dfun.
---
--- Dictionary computations are special for the following reasons. The application of dictionary
--- functions are always saturated, so there is no need to create closures. Dictionary computations
--- don't depend on array values, so they are always scalar computations whose result we can
--- replicate (instead of executing them in parallel).
---
--- NB: To keep things simple, we are not rewriting any of the bindings introduced in a dictionary
--- computation. Consequently, the variable case needs to deal with cases where binders are
--- in the vectoriser environments and where that is not the case.
---
-vectDictExpr :: CoreExpr -> VM CoreExpr
-vectDictExpr (Var var)
- = do { mb_scope <- lookupVar_maybe var
- ; case mb_scope of
- Nothing -> return $ Var var -- binder from within the dict. computation
- Just (Local (vVar, _)) -> return $ Var vVar -- local vectorised variable
- Just (Global vVar) -> return $ Var vVar -- global vectorised variable
- }
-vectDictExpr (Lit lit)
- = pprPanic "Vectorise.Exp.vectDictExpr: literal in dictionary computation" (ppr lit)
-vectDictExpr (Lam bndr e)
- = Lam bndr <$> vectDictExpr e
-vectDictExpr (App fn arg)
- = App <$> vectDictExpr fn <*> vectDictExpr arg
-vectDictExpr (Case e bndr ty alts)
- = Case <$> vectDictExpr e <*> pure bndr <*> vectType ty <*> mapM vectDictAlt alts
- where
- vectDictAlt (con, bs, e) = (,,) <$> vectDictAltCon con <*> pure bs <*> vectDictExpr e
- --
- vectDictAltCon (DataAlt datacon) = DataAlt <$> maybeV dataConErr (lookupDataCon datacon)
- where
- dataConErr = text "Cannot vectorise data constructor:" <+> ppr datacon
- vectDictAltCon (LitAlt lit) = return $ LitAlt lit
- vectDictAltCon DEFAULT = return DEFAULT
-vectDictExpr (Let bnd body)
- = Let <$> vectDictBind bnd <*> vectDictExpr body
- where
- vectDictBind (NonRec bndr e) = NonRec bndr <$> vectDictExpr e
- vectDictBind (Rec bnds) = Rec <$> mapM (\(bndr, e) -> (bndr,) <$> vectDictExpr e) bnds
-vectDictExpr e@(Cast _e _coe)
- = pprSorry "Vectorise.Exp.vectDictExpr: cast" (ppr e)
-vectDictExpr (Tick tickish e)
- = Tick tickish <$> vectDictExpr e
-vectDictExpr (Type ty)
- = Type <$> vectType ty
-vectDictExpr (Coercion coe)
- = pprSorry "Vectorise.Exp.vectDictExpr: coercion" (ppr coe)
-
--- |Vectorise an expression of functional type, where all arguments and the result are of primitive
--- types (i.e., 'Int', 'Float', 'Double' etc., which have instances of the 'Scalar' type class) and
--- which does not contain any subcomputations that involve parallel arrays. Such functionals do not
--- require the full blown vectorisation transformation; instead, they can be lifted by application
--- of a member of the zipWith family (i.e., 'map', 'zipWith', zipWith3', etc.)
---
--- Dictionary functions are also scalar functions (as dictionaries themselves are not vectorised,
--- instead they become dictionaries of vectorised methods). We treat them differently, though see
--- "Note [Scalar dfuns]" in 'Vectorise'.
---
-vectScalarFun :: CoreExpr -> VM VExpr
-vectScalarFun expr
- = do
- { traceVt "vectScalarFun:" (ppr expr)
- ; let (arg_tys, res_ty) = splitFunTys (exprType expr)
- ; mkScalarFun arg_tys res_ty expr
- }
-
--- Generate code for a scalar function by generating a scalar closure. If the function is a
--- dictionary function, vectorise it as dictionary code.
---
-mkScalarFun :: [Type] -> Type -> CoreExpr -> VM VExpr
-mkScalarFun arg_tys res_ty expr
- | isPredTy res_ty
- = do { vExpr <- vectDictExpr expr
- ; return (vExpr, unused)
- }
- | otherwise
- = do { traceVt "mkScalarFun: " $ ppr expr $$ text " ::" <+>
- ppr (mkFunTys arg_tys res_ty)
-
- ; fn_var <- hoistExpr (fsLit "fn") expr DontInline
- ; zipf <- zipScalars arg_tys res_ty
- ; clo <- scalarClosure arg_tys res_ty (Var fn_var) (zipf `App` Var fn_var)
- ; clo_var <- hoistExpr (fsLit "clo") clo DontInline
- ; lclo <- liftPD (Var clo_var)
- ; return (Var clo_var, lclo)
- }
- where
- unused = error "Vectorise.Exp.mkScalarFun: we don't lift dictionary expressions"
-
--- |Vectorise a dictionary function that has a 'VECTORISE SCALAR instance' pragma.
---
--- In other words, all methods in that dictionary are scalar functions — to be vectorised with
--- 'vectScalarFun'. The dictionary "function" itself may be a constant, though.
---
--- NB: You may think that we could implement this function guided by the structure of the Core
--- expression of the right-hand side of the dictionary function. We cannot proceed like this as
--- 'vectScalarDFun' must also work for *imported* dfuns, where we don't necessarily have access
--- to the Core code of the unvectorised dfun.
---
--- Here an example — assume,
---
--- > class Eq a where { (==) :: a -> a -> Bool }
--- > instance (Eq a, Eq b) => Eq (a, b) where { (==) = ... }
--- > {-# VECTORISE SCALAR instance Eq (a, b) }
---
--- The unvectorised dfun for the above instance has the following signature:
---
--- > $dEqPair :: forall a b. Eq a -> Eq b -> Eq (a, b)
---
--- We generate the following (scalar) vectorised dfun (liberally using TH notation):
---
--- > $v$dEqPair :: forall a b. V:Eq a -> V:Eq b -> V:Eq (a, b)
--- > $v$dEqPair = /\a b -> \dEqa :: V:Eq a -> \dEqb :: V:Eq b ->
--- > D:V:Eq $(vectScalarFun True recFns
--- > [| (==) @(a, b) ($dEqPair @a @b $(unVect dEqa) $(unVect dEqb)) |])
---
--- NB:
--- * '(,)' vectorises to '(,)' — hence, the type constructor in the result type remains the same.
--- * We share the '$(unVect di)' sub-expressions between the different selectors, but duplicate
--- the application of the unvectorised dfun, to enable the dictionary selection rules to fire.
---
-vectScalarDFun :: Var -- ^ Original dfun
- -> VM CoreExpr
-vectScalarDFun var
- = do { -- bring the type variables into scope
- ; mapM_ defLocalTyVar tvs
-
- -- vectorise dictionary argument types and generate variables for them
- ; vTheta <- mapM vectType theta
- ; vThetaBndr <- mapM (newLocalVar (fsLit "vd")) vTheta
- ; let vThetaVars = varsToCoreExprs vThetaBndr
-
- -- vectorise superclass dictionaries and methods as scalar expressions
- ; thetaVars <- mapM (newLocalVar (fsLit "d")) theta
- ; thetaExprs <- zipWithM unVectDict theta vThetaVars
- ; let thetaDictBinds = zipWith NonRec thetaVars thetaExprs
- dict = Var var `mkTyApps` (mkTyVarTys tvs) `mkVarApps` thetaVars
- scsOps = map (\selId -> varToCoreExpr selId `mkTyApps` tys `mkApps` [dict])
- selIds
- ; vScsOps <- mapM (\e -> vectorised <$> vectScalarFun e) scsOps
-
- -- vectorised applications of the class-dictionary data constructor
- ; Just vDataCon <- lookupDataCon dataCon
- ; vTys <- mapM vectType tys
- ; let vBody = thetaDictBinds `mkLets` mkCoreConApps vDataCon (map Type vTys ++ vScsOps)
-
- ; return $ mkLams (tvs ++ vThetaBndr) vBody
- }
- where
- ty = varType var
- (tvs, theta, pty) = tcSplitSigmaTy ty -- 'theta' is the instance context
- (cls, tys) = tcSplitDFunHead pty -- 'pty' is the instance head
- selIds = classAllSelIds cls
- dataCon = classDataCon cls
-
--- Build a value of the dictionary before vectorisation from original, unvectorised type and an
--- expression computing the vectorised dictionary.
---
--- Given the vectorised version of a dictionary 'vd :: V:C vt1..vtn', generate code that computes
--- the unvectorised version, thus:
---
--- > D:C op1 .. opm
--- > where
--- > opi = $(fromVect opTyi [| vSeli @vt1..vtk vd |])
---
--- where 'opTyi' is the type of the i-th superclass or op of the unvectorised dictionary.
---
-unVectDict :: Type -> CoreExpr -> VM CoreExpr
-unVectDict ty e
- = do { vTys <- mapM vectType tys
- ; let meths = map (\sel -> Var sel `mkTyApps` vTys `mkApps` [e]) selIds
- ; scOps <- zipWithM fromVect methTys meths
- ; return $ mkCoreConApps dataCon (map Type tys ++ scOps)
- }
- where
- (tycon, tys) = splitTyConApp ty
- Just dataCon = isDataProductTyCon_maybe tycon
- Just cls = tyConClass_maybe tycon
- methTys = dataConInstArgTys dataCon tys
- selIds = classAllSelIds cls
-
--- Vectorise an 'n'-ary lambda abstraction by building a set of 'n' explicit closures.
---
--- All non-dictionary free variables go into the closure's environment, whereas the dictionary
--- variables are passed explicit (as conventional arguments) into the body during closure
--- construction.
---
-vectLam :: Bool -- ^ Should the RHS of a binding be inlined?
- -> Bool -- ^ Whether the binding is a loop breaker.
- -> CoreExprWithVectInfo -- ^ Body of abstraction.
- -> VM VExpr
-vectLam inline loop_breaker expr@((fvs, _vi), AnnLam _ _)
- = do { traceVt "fully vectorise a lambda expression" (ppr . deAnnotate $ expr)
-
- ; let (bndrs, body) = collectAnnValBinders expr
-
- -- grab the in-scope type variables
- ; tyvars <- localTyVars
-
- -- collect and vectorise all /local/ free variables
- ; vfvs <- readLEnv $ \env ->
- [ (var, fromJust mb_vv)
- | var <- dVarSetElems fvs
- , let mb_vv = lookupVarEnv (local_vars env) var
- , isJust mb_vv -- its local == is in local var env
- ]
- -- separate dictionary from non-dictionary variables in the free variable set
- ; let (vvs_dict, vvs_nondict) = partition (isPredTy . varType . fst) vfvs
- (_fvs_dict, vfvs_dict) = unzip vvs_dict
- (fvs_nondict, vfvs_nondict) = unzip vvs_nondict
-
- -- compute the type of the vectorised closure
- ; arg_tys <- mapM (vectType . idType) bndrs
- ; res_ty <- vectType (exprType $ deAnnotate body)
-
- ; let arity = length fvs_nondict + length bndrs
- vfvs_dict' = map vectorised vfvs_dict
- ; buildClosures tyvars vfvs_dict' vfvs_nondict arg_tys res_ty
- . hoistPolyVExpr tyvars vfvs_dict' (maybe_inline arity)
- $ do { -- generate the vectorised body of the lambda abstraction
- ; lc <- builtin liftingContext
- ; (vbndrs, vbody) <- vectBndrsIn (fvs_nondict ++ bndrs) $ vectExpr body
-
- ; vbody' <- break_loop lc res_ty vbody
- ; return $ vLams lc vbndrs vbody'
- }
- }
- where
- maybe_inline n | inline = Inline n
- | otherwise = DontInline
-
- -- If this is the body of a binding marked as a loop breaker, add a recursion termination test
- -- to the /lifted/ version of the function body. The termination tests checks if the lifting
- -- context is empty. If so, it returns an empty array of the (lifted) result type instead of
- -- executing the function body. This is the test from the last line (defining \mathcal{L}')
- -- in Figure 6 of HtM.
- break_loop lc ty (ve, le)
- | loop_breaker
- = do { dflags <- getDynFlags
- ; empty <- emptyPD ty
- ; lty <- mkPDataType ty
- ; return (ve, mkWildCase (Var lc) intPrimTy lty
- [(DEFAULT, [], le),
- (LitAlt (mkMachInt dflags 0), [], empty)])
- }
- | otherwise = return (ve, le)
-vectLam _ _ _ = panic "Vectorise.Exp.vectLam: not a lambda"
-
--- Vectorise an algebraic case expression.
---
--- We convert
---
--- case e :: t of v { ... }
---
--- to
---
--- V: let v' = e in case v' of _ { ... }
--- L: let v' = e in case v' `cast` ... of _ { ... }
---
--- When lifting, we have to do it this way because v must have the type
--- [:V(T):] but the scrutinee must be cast to the representation type. We also
--- have to handle the case where v is a wild var correctly.
---
-
--- FIXME: this is too lazy...is it?
-vectAlgCase :: TyCon -> [Type] -> CoreExprWithVectInfo -> Var -> Type
- -> [(AltCon, [Var], CoreExprWithVectInfo)]
- -> VM VExpr
-vectAlgCase _tycon _ty_args scrut bndr ty [(DEFAULT, [], body)]
- = do
- { traceVt "scrutinee (DEFAULT only)" Outputable.empty
- ; vscrut <- vectExpr scrut
- ; (vty, lty) <- vectAndLiftType ty
- ; traceVt "alternative body (DEFAULT only)" Outputable.empty
- ; (vbndr, vbody) <- vectBndrIn bndr (vectExpr body)
- ; return $ vCaseDEFAULT vscrut vbndr vty lty vbody
- }
-vectAlgCase _tycon _ty_args scrut bndr ty [(DataAlt _, [], body)]
- = do
- { traceVt "scrutinee (one shot w/o binders)" Outputable.empty
- ; vscrut <- vectExpr scrut
- ; (vty, lty) <- vectAndLiftType ty
- ; traceVt "alternative body (one shot w/o binders)" Outputable.empty
- ; (vbndr, vbody) <- vectBndrIn bndr (vectExpr body)
- ; return $ vCaseDEFAULT vscrut vbndr vty lty vbody
- }
-vectAlgCase _tycon _ty_args scrut bndr ty [(DataAlt dc, bndrs, body)]
- = do
- { traceVt "scrutinee (one shot w/ binders)" Outputable.empty
- ; vexpr <- vectExpr scrut
- ; (vty, lty) <- vectAndLiftType ty
- ; traceVt "alternative body (one shot w/ binders)" Outputable.empty
- ; (vbndr, (vbndrs, (vect_body, lift_body)))
- <- vect_scrut_bndr
- . vectBndrsIn bndrs
- $ vectExpr body
- ; let (vect_bndrs, lift_bndrs) = unzip vbndrs
- ; (vscrut, lscrut, pdata_dc) <- pdataUnwrapScrut (vVar vbndr)
- ; vect_dc <- maybeV dataConErr (lookupDataCon dc)
-
- ; let vcase = mk_wild_case vscrut vty vect_dc vect_bndrs vect_body
- lcase = mk_wild_case lscrut lty pdata_dc lift_bndrs lift_body
-
- ; return $ vLet (vNonRec vbndr vexpr) (vcase, lcase)
- }
- where
- vect_scrut_bndr | isDeadBinder bndr = vectBndrNewIn bndr (fsLit "scrut")
- | otherwise = vectBndrIn bndr
-
- mk_wild_case expr ty dc bndrs body
- = mkWildCase expr (exprType expr) ty [(DataAlt dc, bndrs, body)]
-
- dataConErr = (text "vectAlgCase: data constructor not vectorised" <+> ppr dc)
-
-vectAlgCase tycon _ty_args scrut bndr ty alts
- = do
- { traceVt "scrutinee (general case)" Outputable.empty
- ; vexpr <- vectExpr scrut
-
- ; vect_tc <- vectTyCon tycon
- ; (vty, lty) <- vectAndLiftType ty
-
- ; let arity = length (tyConDataCons vect_tc)
- ; sel_ty <- builtin (selTy arity)
- ; sel_bndr <- newLocalVar (fsLit "sel") sel_ty
- ; let sel = Var sel_bndr
-
- ; traceVt "alternatives' body (general case)" Outputable.empty
- ; (vbndr, valts) <- vect_scrut_bndr
- $ mapM (proc_alt arity sel vty lty) alts'
- ; let (vect_dcs, vect_bndrss, lift_bndrss, vbodies) = unzip4 valts
-
- ; (vect_scrut, lift_scrut, pdata_dc) <- pdataUnwrapScrut (vVar vbndr)
-
- ; let (vect_bodies, lift_bodies) = unzip vbodies
-
- ; vdummy <- newDummyVar (exprType vect_scrut)
- ; ldummy <- newDummyVar (exprType lift_scrut)
- ; let vect_case = Case vect_scrut vdummy vty
- (zipWith3 mk_vect_alt vect_dcs vect_bndrss vect_bodies)
-
- ; lc <- builtin liftingContext
- ; lbody <- combinePD vty (Var lc) sel lift_bodies
- ; let lift_case = Case lift_scrut ldummy lty
- [(DataAlt pdata_dc, sel_bndr : concat lift_bndrss,
- lbody)]
-
- ; return . vLet (vNonRec vbndr vexpr)
- $ (vect_case, lift_case)
- }
- where
- vect_scrut_bndr | isDeadBinder bndr = vectBndrNewIn bndr (fsLit "scrut")
- | otherwise = vectBndrIn bndr
-
- alts' = sortBy (\(alt1, _, _) (alt2, _, _) -> cmp alt1 alt2) alts
-
- cmp (DataAlt dc1) (DataAlt dc2) = dataConTag dc1 `compare` dataConTag dc2
- cmp DEFAULT DEFAULT = EQ
- cmp DEFAULT _ = LT
- cmp _ DEFAULT = GT
- cmp _ _ = panic "vectAlgCase/cmp"
-
- proc_alt arity sel _ lty (DataAlt dc, bndrs, body@((fvs_body, _), _))
- = do
- dflags <- getDynFlags
- vect_dc <- maybeV dataConErr (lookupDataCon dc)
- let ntag = dataConTagZ vect_dc
- tag = mkDataConTag dflags vect_dc
- fvs = fvs_body `delDVarSetList` bndrs
-
- sel_tags <- liftM (`App` sel) (builtin (selTags arity))
- lc <- builtin liftingContext
- elems <- builtin (selElements arity ntag)
-
- (vbndrs, vbody)
- <- vectBndrsIn bndrs
- . localV
- $ do
- { binds <- mapM (pack_var (Var lc) sel_tags tag)
- . filter isLocalId
- $ dVarSetElems fvs
- ; traceVt "case alternative:" (ppr . deAnnotate $ body)
- ; (ve, le) <- vectExpr body
- ; return (ve, Case (elems `App` sel) lc lty
- [(DEFAULT, [], (mkLets (concat binds) le))])
- }
- -- empty <- emptyPD vty
- -- return (ve, Case (elems `App` sel) lc lty
- -- [(DEFAULT, [], Let (NonRec flags_var flags_expr)
- -- $ mkLets (concat binds) le),
- -- (LitAlt (mkMachInt 0), [], empty)])
- let (vect_bndrs, lift_bndrs) = unzip vbndrs
- return (vect_dc, vect_bndrs, lift_bndrs, vbody)
- where
- dataConErr = (text "vectAlgCase: data constructor not vectorised" <+> ppr dc)
-
- proc_alt _ _ _ _ _ = panic "vectAlgCase/proc_alt"
-
- mk_vect_alt vect_dc bndrs body = (DataAlt vect_dc, bndrs, body)
-
- -- Pack a variable for a case alternative context *if* the variable is vectorised. If it
- -- isn't, ignore it as scalar variables don't need to be packed.
- pack_var len tags t v
- = do
- { r <- lookupVar_maybe v
- ; case r of
- Just (Local (vv, lv)) ->
- do
- { lv' <- cloneVar lv
- ; expr <- packByTagPD (idType vv) (Var lv) len tags t
- ; updLEnv (\env -> env { local_vars = extendVarEnv (local_vars env) v (vv, lv') })
- ; return [(NonRec lv' expr)]
- }
- _ -> return []
- }
-
-
--- Support to compute information for vectorisation avoidance ------------------
-
--- Annotation for Core AST nodes that describes how they should be handled during vectorisation
--- and especially if vectorisation of the corresponding computation can be avoided.
---
-data VectAvoidInfo = VIParr -- tree contains parallel computations
- | VISimple -- result type is scalar & no parallel subcomputation
- | VIComplex -- any result type, no parallel subcomputation
- | VIEncaps -- tree encapsulated by 'liftSimple'
- | VIDict -- dictionary computation (never parallel)
- deriving (Eq, Show)
-
--- Core expression annotated with free variables and vectorisation-specific information.
---
-type CoreExprWithVectInfo = AnnExpr Id (DVarSet, VectAvoidInfo)
-
--- Yield the type of an annotated core expression.
---
-annExprType :: AnnExpr Var ann -> Type
-annExprType = exprType . deAnnotate
-
--- Project the vectorisation information from an annotated Core expression.
---
-vectAvoidInfoOf :: CoreExprWithVectInfo -> VectAvoidInfo
-vectAvoidInfoOf ((_, vi), _) = vi
-
--- Is this a 'VIParr' node?
---
-isVIParr :: CoreExprWithVectInfo -> Bool
-isVIParr = (== VIParr) . vectAvoidInfoOf
-
--- Is this a 'VIEncaps' node?
---
-isVIEncaps :: CoreExprWithVectInfo -> Bool
-isVIEncaps = (== VIEncaps) . vectAvoidInfoOf
-
--- Is this a 'VIDict' node?
---
-isVIDict :: CoreExprWithVectInfo -> Bool
-isVIDict = (== VIDict) . vectAvoidInfoOf
-
--- 'VIParr' if either argument is 'VIParr'; otherwise, the first argument.
---
-unlessVIParr :: VectAvoidInfo -> VectAvoidInfo -> VectAvoidInfo
-unlessVIParr _ VIParr = VIParr
-unlessVIParr vi _ = vi
-
--- 'VIParr' if either arguments vectorisation information is 'VIParr'; otherwise, the vectorisation
--- information of the first argument is produced.
---
-unlessVIParrExpr :: VectAvoidInfo -> CoreExprWithVectInfo -> VectAvoidInfo
-infixl `unlessVIParrExpr`
-unlessVIParrExpr e1 e2 = e1 `unlessVIParr` vectAvoidInfoOf e2
-
--- Compute Core annotations to determine for which subexpressions we can avoid vectorisation.
---
--- * The first argument is the set of free, local variables whose evaluation may entail parallelism.
---
-vectAvoidInfo :: VarSet -> CoreExprWithFVs -> VM CoreExprWithVectInfo
-vectAvoidInfo pvs ce@(_, AnnVar v)
- = do
- { gpvs <- globalParallelVars
- ; vi <- if v `elemVarSet` pvs || v `elemDVarSet` gpvs
- then return VIParr
- else vectAvoidInfoTypeOf ce
- ; viTrace ce vi []
- ; when (vi == VIParr) $
- traceVt " reason:" $ if v `elemVarSet` pvs then text "local" else
- if v `elemDVarSet` gpvs then text "global" else text "parallel type"
-
- ; return ((fvs, vi), AnnVar v)
- }
- where
- fvs = freeVarsOf ce
-
-vectAvoidInfo _pvs ce@(_, AnnLit lit)
- = do
- { vi <- vectAvoidInfoTypeOf ce
- ; viTrace ce vi []
- ; return ((fvs, vi), AnnLit lit)
- }
- where
- fvs = freeVarsOf ce
-
-vectAvoidInfo pvs ce@(_, AnnApp e1 e2)
- = do
- { ceVI <- vectAvoidInfoTypeOf ce
- ; eVI1 <- vectAvoidInfo pvs e1
- ; eVI2 <- vectAvoidInfo pvs e2
- ; let vi = ceVI `unlessVIParrExpr` eVI1 `unlessVIParrExpr` eVI2
- -- ; viTrace ce vi [eVI1, eVI2]
- ; return ((fvs, vi), AnnApp eVI1 eVI2)
- }
- where
- fvs = freeVarsOf ce
-
-vectAvoidInfo pvs ce@(_, AnnLam var body)
- = do
- { bodyVI <- vectAvoidInfo pvs body
- ; varVI <- vectAvoidInfoType $ varType var
- ; let vi = vectAvoidInfoOf bodyVI `unlessVIParr` varVI
- -- ; viTrace ce vi [bodyVI]
- ; return ((fvs, vi), AnnLam var bodyVI)
- }
- where
- fvs = freeVarsOf ce
-
-vectAvoidInfo pvs ce@(_, AnnLet (AnnNonRec var e) body)
- = do
- { ceVI <- vectAvoidInfoTypeOf ce
- ; eVI <- vectAvoidInfo pvs e
- ; isScalarTy <- isScalar $ varType var
- ; (bodyVI, vi) <- if isVIParr eVI && not isScalarTy
- then do -- binding is parallel
- { bodyVI <- vectAvoidInfo (pvs `extendVarSet` var) body
- ; return (bodyVI, VIParr)
- }
- else do -- binding doesn't affect parallelism
- { bodyVI <- vectAvoidInfo pvs body
- ; return (bodyVI, ceVI `unlessVIParrExpr` bodyVI)
- }
- -- ; viTrace ce vi [eVI, bodyVI]
- ; return ((fvs, vi), AnnLet (AnnNonRec var eVI) bodyVI)
- }
- where
- fvs = freeVarsOf ce
-
-vectAvoidInfo pvs ce@(_, AnnLet (AnnRec bnds) body)
- = do
- { ceVI <- vectAvoidInfoTypeOf ce
- ; bndsVI <- mapM (vectAvoidInfoBnd pvs) bnds
- ; parrBndrs <- map fst <$> filterM isVIParrBnd bndsVI
- ; if not . null $ parrBndrs
- then do -- body may trigger parallelism via at least one binding
- { new_pvs <- filterM ((not <$>) . isScalar . varType) parrBndrs
- ; let extendedPvs = pvs `extendVarSetList` new_pvs
- ; bndsVI <- mapM (vectAvoidInfoBnd extendedPvs) bnds
- ; bodyVI <- vectAvoidInfo extendedPvs body
- -- ; viTrace ce VIParr (map snd bndsVI ++ [bodyVI])
- ; return ((fvs, VIParr), AnnLet (AnnRec bndsVI) bodyVI)
- }
- else do -- demanded bindings cannot trigger parallelism
- { bodyVI <- vectAvoidInfo pvs body
- ; let vi = ceVI `unlessVIParrExpr` bodyVI
- -- ; viTrace ce vi (map snd bndsVI ++ [bodyVI])
- ; return ((fvs, vi), AnnLet (AnnRec bndsVI) bodyVI)
- }
- }
- where
- fvs = freeVarsOf ce
- vectAvoidInfoBnd pvs (var, e) = (var,) <$> vectAvoidInfo pvs e
-
- isVIParrBnd (var, eVI)
- = do
- { isScalarTy <- isScalar (varType var)
- ; return $ isVIParr eVI && not isScalarTy
- }
-
-vectAvoidInfo pvs ce@(_, AnnCase e var ty alts)
- = do
- { ceVI <- vectAvoidInfoTypeOf ce
- ; eVI <- vectAvoidInfo pvs e
- ; altsVI <- mapM (vectAvoidInfoAlt (isVIParr eVI)) alts
- ; let alteVIs = [eVI | (_, _, eVI) <- altsVI]
- vi = foldl unlessVIParrExpr ceVI (eVI:alteVIs) -- NB: same effect as in the paper
- -- ; viTrace ce vi (eVI : alteVIs)
- ; return ((fvs, vi), AnnCase eVI var ty altsVI)
- }
- where
- fvs = freeVarsOf ce
- vectAvoidInfoAlt scrutIsPar (con, bndrs, e)
- = do
- { allScalar <- allScalarVarType bndrs
- ; let altPvs | scrutIsPar && not allScalar = pvs `extendVarSetList` bndrs
- | otherwise = pvs
- ; (con, bndrs,) <$> vectAvoidInfo altPvs e
- }
-
-vectAvoidInfo pvs ce@(_, AnnCast e (fvs_ann, ann))
- = do
- { eVI <- vectAvoidInfo pvs e
- ; return ((fvs, vectAvoidInfoOf eVI), AnnCast eVI ((freeVarsOfAnn fvs_ann, VISimple), ann))
- }
- where
- fvs = freeVarsOf ce
-
-vectAvoidInfo pvs ce@(_, AnnTick tick e)
- = do
- { eVI <- vectAvoidInfo pvs e
- ; return ((fvs, vectAvoidInfoOf eVI), AnnTick tick eVI)
- }
- where
- fvs = freeVarsOf ce
-
-vectAvoidInfo _pvs ce@(_, AnnType ty)
- = return ((fvs, VISimple), AnnType ty)
- where
- fvs = freeVarsOf ce
-
-vectAvoidInfo _pvs ce@(_, AnnCoercion coe)
- = return ((fvs, VISimple), AnnCoercion coe)
- where
- fvs = freeVarsOf ce
-
--- Compute vectorisation avoidance information for a type.
---
-vectAvoidInfoType :: Type -> VM VectAvoidInfo
-vectAvoidInfoType ty
- | isPredTy ty
- = return VIDict
- | Just (arg, res) <- splitFunTy_maybe ty
- = do
- { argVI <- vectAvoidInfoType arg
- ; resVI <- vectAvoidInfoType res
- ; case (argVI, resVI) of
- (VISimple, VISimple) -> return VISimple -- NB: diverts from the paper: scalar functions
- (_ , VIDict) -> return VIDict
- _ -> return $ VIComplex `unlessVIParr` argVI `unlessVIParr` resVI
- }
- | otherwise
- = do
- { parr <- maybeParrTy ty
- ; if parr
- then return VIParr
- else do
- { scalar <- isScalar ty
- ; if scalar
- then return VISimple
- else return VIComplex
- } }
-
--- Compute vectorisation avoidance information for the type of a Core expression (with FVs).
---
-vectAvoidInfoTypeOf :: AnnExpr Var ann -> VM VectAvoidInfo
-vectAvoidInfoTypeOf = vectAvoidInfoType . annExprType
-
--- Checks whether the type might be a parallel array type.
---
-maybeParrTy :: Type -> VM Bool
-maybeParrTy ty
- -- looking through newtypes
- | Just ty' <- coreView ty
- = (== VIParr) <$> vectAvoidInfoType ty'
- -- decompose constructor applications
- | Just (tc, ts) <- splitTyConApp_maybe ty
- = do
- { isParallel <- (tyConName tc `elemNameSet`) <$> globalParallelTyCons
- ; if isParallel
- then return True
- else or <$> mapM maybeParrTy ts
- }
- -- must be a Named ForAllTy because anon ones respond to splitTyConApp_maybe
-maybeParrTy (ForAllTy _ ty) = maybeParrTy ty
-maybeParrTy _ = return False
-
--- Are the types of all variables in the 'Scalar' class or toplevel variables?
---
--- NB: 'liftSimple' does not abstract over toplevel variables.
---
-allScalarVarType :: [Var] -> VM Bool
-allScalarVarType vs = and <$> mapM isScalarOrToplevel vs
- where
- isScalarOrToplevel v | isToplevel v = return True
- | otherwise = isScalar (varType v)
-
--- Are the types of all variables in the set in the 'Scalar' class or toplevel variables?
---
-allScalarVarTypeSet :: DVarSet -> VM Bool
-allScalarVarTypeSet = allScalarVarType . dVarSetElems
-
--- Debugging support
---
-viTrace :: CoreExprWithFVs -> VectAvoidInfo -> [CoreExprWithVectInfo] -> VM ()
-viTrace ce vi vTs
- = traceVt ("vect info: " ++ show vi ++ "[" ++
- (concat $ map ((++ " ") . show . vectAvoidInfoOf) vTs) ++ "]")
- (ppr $ deAnnotate ce)
diff --git a/compiler/vectorise/Vectorise/Generic/Description.hs b/compiler/vectorise/Vectorise/Generic/Description.hs
deleted file mode 100644
index 483e96f712..0000000000
--- a/compiler/vectorise/Vectorise/Generic/Description.hs
+++ /dev/null
@@ -1,294 +0,0 @@
--- |Compute a description of the generic representation that we use for a user defined data type.
---
--- During vectorisation, we generate a PRepr and PA instance for each user defined
--- data type. The PA dictionary contains methods to convert the user type to and
--- from our generic representation. This module computes a description of what
--- that generic representation is.
---
-module Vectorise.Generic.Description
- ( CompRepr(..)
- , ProdRepr(..)
- , ConRepr(..)
- , SumRepr(..)
- , tyConRepr
- , sumReprType
- , compOrigType
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Utils
-import Vectorise.Monad
-import Vectorise.Builtins
-
-import CoreSyn
-import DataCon
-import TyCon
-import Type
-import Control.Monad
-import Outputable
-
-
--- | Describes the generic representation of a data type.
--- If the data type has multiple constructors then we bundle them
--- together into a generic sum type.
-data SumRepr
- = -- | Data type has no data constructors.
- EmptySum
-
- -- | Data type has a single constructor.
- | UnarySum ConRepr
-
- -- | Data type has multiple constructors.
- | Sum { -- | Representation tycon for the sum (eg Sum2)
- repr_sum_tc :: TyCon
-
- -- | PData version of the sum tycon (eg PDataSum2)
- -- This TyCon doesn't appear explicitly in the source program.
- -- See Note [PData TyCons].
- , repr_psum_tc :: TyCon
-
- -- | PDatas version of the sum tycon (eg PDatasSum2)
- , repr_psums_tc :: TyCon
-
- -- | Type of the selector (eg Sel2)
- , repr_sel_ty :: Type
-
- -- | Type of multi-selector (eg Sel2s)
- , repr_sels_ty :: Type
-
- -- | Function to get the length of a Sels of this type.
- , repr_selsLength_v :: CoreExpr
-
- -- | Type of each data constructor.
- , repr_con_tys :: [Type]
-
- -- | Generic representation types of each data constructor.
- , repr_cons :: [ConRepr]
- }
-
-
--- | Describes the representation type of a data constructor.
-data ConRepr
- = ConRepr
- { repr_dc :: DataCon
- , repr_prod :: ProdRepr
- }
-
--- | Describes the representation type of the fields \/ components of a constructor.
--- If the data constructor has multiple fields then we bundle them
--- together into a generic product type.
-data ProdRepr
- = -- | Data constructor has no fields.
- EmptyProd
-
- -- | Data constructor has a single field.
- | UnaryProd CompRepr
-
- -- | Data constructor has several fields.
- | Prod { -- | Representation tycon for the product (eg Tuple2)
- repr_tup_tc :: TyCon
-
- -- | PData version of the product tycon (eg PDataTuple2)
- , repr_ptup_tc :: TyCon
-
- -- | PDatas version of the product tycon (eg PDatasTuple2s)
- -- Not all lifted backends use `PDatas`.
- , repr_ptups_tc :: TyCon
-
- -- | Types of each field.
- , repr_comp_tys :: [Type]
-
- -- | Generic representation types for each field.
- , repr_comps :: [CompRepr]
- }
-
-
--- | Describes the representation type of a data constructor field.
-data CompRepr
- = Keep Type
- CoreExpr -- PR dictionary for the type
- | Wrap Type
-
-
--------------------------------------------------------------------------------
-
--- |Determine the generic representation of a data type, given its tycon.
---
-tyConRepr :: TyCon -> VM SumRepr
-tyConRepr tc
- = sum_repr (tyConDataCons tc)
- where
- -- Build the representation type for a data type with the given constructors.
- -- The representation types for each individual constructor are bundled
- -- together into a generic sum type.
- sum_repr :: [DataCon] -> VM SumRepr
- sum_repr [] = return EmptySum
- sum_repr [con] = liftM UnarySum (con_repr con)
- sum_repr cons
- = do let arity = length cons
- rs <- mapM con_repr cons
- tys <- mapM conReprType rs
-
- -- Get the 'Sum' tycon of this arity (eg Sum2).
- sum_tc <- builtin (sumTyCon arity)
-
- -- Get the 'PData' and 'PDatas' tycons for the sum.
- psum_tc <- pdataReprTyConExact sum_tc
- psums_tc <- pdatasReprTyConExact sum_tc
-
- sel_ty <- builtin (selTy arity)
- sels_ty <- builtin (selsTy arity)
- selsLength_v <- builtin (selsLength arity)
- return $ Sum
- { repr_sum_tc = sum_tc
- , repr_psum_tc = psum_tc
- , repr_psums_tc = psums_tc
- , repr_sel_ty = sel_ty
- , repr_sels_ty = sels_ty
- , repr_selsLength_v = selsLength_v
- , repr_con_tys = tys
- , repr_cons = rs
- }
-
- -- Build the representation type for a single data constructor.
- con_repr con = liftM (ConRepr con) (prod_repr (dataConRepArgTys con))
-
- -- Build the representation type for the fields of a data constructor.
- -- The representation types for each individual field are bundled
- -- together into a generic product type.
- prod_repr :: [Type] -> VM ProdRepr
- prod_repr [] = return EmptyProd
- prod_repr [ty] = liftM UnaryProd (comp_repr ty)
- prod_repr tys
- = do let arity = length tys
- rs <- mapM comp_repr tys
- tys' <- mapM compReprType rs
-
- -- Get the Prod \/ Tuple tycon of this arity (eg Tuple2)
- tup_tc <- builtin (prodTyCon arity)
-
- -- Get the 'PData' and 'PDatas' tycons for the product.
- ptup_tc <- pdataReprTyConExact tup_tc
- ptups_tc <- pdatasReprTyConExact tup_tc
-
- return $ Prod
- { repr_tup_tc = tup_tc
- , repr_ptup_tc = ptup_tc
- , repr_ptups_tc = ptups_tc
- , repr_comp_tys = tys'
- , repr_comps = rs
- }
-
- -- Build the representation type for a single data constructor field.
- comp_repr ty = liftM (Keep ty) (prDictOfReprType ty)
- `orElseV` return (Wrap ty)
-
--- |Yield the type of this sum representation.
---
-sumReprType :: SumRepr -> VM Type
-sumReprType EmptySum = voidType
-sumReprType (UnarySum r) = conReprType r
-sumReprType (Sum { repr_sum_tc = sum_tc, repr_con_tys = tys })
- = return $ mkTyConApp sum_tc tys
-
--- Yield the type of this constructor representation.
---
-conReprType :: ConRepr -> VM Type
-conReprType (ConRepr _ r) = prodReprType r
-
--- Yield the type of of this product representation.
---
-prodReprType :: ProdRepr -> VM Type
-prodReprType EmptyProd = voidType
-prodReprType (UnaryProd r) = compReprType r
-prodReprType (Prod { repr_tup_tc = tup_tc, repr_comp_tys = tys })
- = return $ mkTyConApp tup_tc tys
-
--- Yield the type of this data constructor field \/ component representation.
---
-compReprType :: CompRepr -> VM Type
-compReprType (Keep ty _) = return ty
-compReprType (Wrap ty) = mkWrapType ty
-
--- |Yield the original component type of a data constructor component representation.
---
-compOrigType :: CompRepr -> Type
-compOrigType (Keep ty _) = ty
-compOrigType (Wrap ty) = ty
-
-
--- Outputable instances -------------------------------------------------------
-instance Outputable SumRepr where
- ppr ss
- = case ss of
- EmptySum
- -> text "EmptySum"
-
- UnarySum con
- -> sep [text "UnarySum", ppr con]
-
- Sum sumtc psumtc psumstc selty selsty selsLength contys cons
- -> text "Sum" $+$ braces (nest 4
- $ sep [ text "repr_sum_tc = " <> ppr sumtc
- , text "repr_psum_tc = " <> ppr psumtc
- , text "repr_psums_tc = " <> ppr psumstc
- , text "repr_sel_ty = " <> ppr selty
- , text "repr_sels_ty = " <> ppr selsty
- , text "repr_selsLength_v = " <> ppr selsLength
- , text "repr_con_tys = " <> ppr contys
- , text "repr_cons = " <> ppr cons])
-
-
-instance Outputable ConRepr where
- ppr (ConRepr dc pr)
- = text "ConRepr" $+$ braces (nest 4
- $ sep [ text "repr_dc = " <> ppr dc
- , text "repr_prod = " <> ppr pr])
-
-
-instance Outputable ProdRepr where
- ppr ss
- = case ss of
- EmptyProd
- -> text "EmptyProd"
-
- UnaryProd cr
- -> sep [text "UnaryProd", ppr cr]
-
- Prod tuptcs ptuptcs ptupstcs comptys comps
- -> sep [text "Prod", ppr tuptcs, ppr ptuptcs, ppr ptupstcs, ppr comptys, ppr comps]
-
-
-instance Outputable CompRepr where
- ppr ss
- = case ss of
- Keep t ce
- -> text "Keep" $+$ sep [ppr t, ppr ce]
-
- Wrap t
- -> sep [text "Wrap", ppr t]
-
-
--- Notes ----------------------------------------------------------------------
-{-
-Note [PData TyCons]
-~~~~~~~~~~~~~~~~~~~
-When PData is a type family, the compiler generates a type constructor for each
-instance, which is named after the family and instance type. This type
-constructor does not appear in the source program. Rather, it is implicitly
-defined by the data instance. For example with:
-
- data family PData a
-
- data instance PData (Sum2 a b)
- = PSum2 U.Sel2
- (PData a)
- (PData b)
-
-The type constructor corresponding to the instance will be named 'PDataSum2',
-and this is what we will get in the repr_psum_tc field of SumRepr.Sum.
-
--}
-
diff --git a/compiler/vectorise/Vectorise/Generic/PADict.hs b/compiler/vectorise/Vectorise/Generic/PADict.hs
deleted file mode 100644
index d24f989161..0000000000
--- a/compiler/vectorise/Vectorise/Generic/PADict.hs
+++ /dev/null
@@ -1,128 +0,0 @@
-
-module Vectorise.Generic.PADict
- ( buildPADict
- ) where
-
-import GhcPrelude
-
-import Vectorise.Monad
-import Vectorise.Builtins
-import Vectorise.Generic.Description
-import Vectorise.Generic.PAMethods ( buildPAScAndMethods )
-import Vectorise.Utils
-
-import BasicTypes
-import CoreSyn
-import CoreUtils
-import CoreUnfold
-import Module
-import TyCon
-import CoAxiom
-import Type
-import Id
-import Var
-import Name
-import FastString
-
-
--- |Build the PA dictionary function for some type and hoist it to top level.
---
--- The PA dictionary holds fns that convert values to and from their vectorised representations.
---
--- @Recall the definition:
--- class PR (PRepr a) => PA a where
--- toPRepr :: a -> PRepr a
--- fromPRepr :: PRepr a -> a
--- toArrPRepr :: PData a -> PData (PRepr a)
--- fromArrPRepr :: PData (PRepr a) -> PData a
--- toArrPReprs :: PDatas a -> PDatas (PRepr a)
--- fromArrPReprs :: PDatas (PRepr a) -> PDatas a
---
--- Example:
--- df :: forall a. PR (PRepr a) -> PA a -> PA (T a)
--- df = /\a. \(c:PR (PRepr a)) (d:PA a). MkPA c ($PR_df a d) ($toPRepr a d) ...
--- $dPR_df :: forall a. PA a -> PR (PRepr (T a))
--- $dPR_df = ....
--- $toRepr :: forall a. PA a -> T a -> PRepr (T a)
--- $toPRepr = ...
--- The "..." stuff is filled in by buildPAScAndMethods
--- @
---
-buildPADict
- :: TyCon -- ^ tycon of the type being vectorised.
- -> CoAxiom Unbranched
- -- ^ Coercion between the type and
- -- its vectorised representation.
- -> TyCon -- ^ PData instance tycon
- -> TyCon -- ^ PDatas instance tycon
- -> SumRepr -- ^ representation used for the type being vectorised.
- -> VM Var -- ^ name of the top-level dictionary function.
-
-buildPADict vect_tc prepr_ax pdata_tc pdatas_tc repr
- = polyAbstract tvs $ \args -> -- The args are the dictionaries we lambda abstract over; and they
- -- are put in the envt, so when we need a (PA a) we can find it in
- -- the envt; they don't include the silent superclass args yet
- do { mod <- liftDs getModule
- ; let dfun_name = mkLocalisedOccName mod mkPADFunOcc vect_tc_name
-
- -- The superclass dictionary is a (silent) argument if the tycon is polymorphic...
- ; let mk_super_ty = do { r <- mkPReprType inst_ty
- ; pr_cls <- builtin prClass
- ; return $ mkClassPred pr_cls [r]
- }
- ; super_tys <- sequence [mk_super_ty | not (null tvs)]
- ; super_args <- mapM (newLocalVar (fsLit "pr")) super_tys
- ; let val_args = super_args ++ args
- all_args = tvs ++ val_args
-
- -- ...it is constant otherwise
- ; super_consts <- sequence [prDictOfPReprInstTyCon inst_ty prepr_ax [] | null tvs]
-
- -- Get ids for each of the methods in the dictionary, including superclass
- ; paMethodBuilders <- buildPAScAndMethods
- ; method_ids <- mapM (method val_args dfun_name) paMethodBuilders
-
- -- Expression to build the dictionary.
- ; pa_dc <- builtin paDataCon
- ; let dict = mkLams all_args (mkConApp pa_dc con_args)
- con_args = Type inst_ty
- : map Var super_args -- the superclass dictionary is either
- ++ super_consts -- lambda-bound or constant
- ++ map (method_call val_args) method_ids
-
- -- Build the type of the dictionary function.
- ; pa_cls <- builtin paClass
- ; let dfun_ty = mkInvForAllTys tvs
- $ mkFunTys (map varType val_args)
- (mkClassPred pa_cls [inst_ty])
-
- -- Set the unfolding for the inliner.
- ; raw_dfun <- newExportedVar dfun_name dfun_ty
- ; let dfun_unf = mkDFunUnfolding all_args pa_dc con_args
- dfun = raw_dfun `setIdUnfolding` dfun_unf
- `setInlinePragma` dfunInlinePragma
-
- -- Add the new binding to the top-level environment.
- ; hoistBinding dfun dict
- ; return dfun
- }
- where
- tvs = tyConTyVars vect_tc
- arg_tys = mkTyVarTys tvs
- inst_ty = mkTyConApp vect_tc arg_tys
- vect_tc_name = getName vect_tc
-
- method args dfun_name (name, build)
- = localV
- $ do expr <- build vect_tc prepr_ax pdata_tc pdatas_tc repr
- let body = mkLams (tvs ++ args) expr
- raw_var <- newExportedVar (method_name dfun_name name) (exprType body)
- let var = raw_var
- `setIdUnfolding` mkInlineUnfoldingWithArity
- (length args) body
- `setInlinePragma` alwaysInlinePragma
- hoistBinding var body
- return var
-
- method_call args id = mkApps (Var id) (map Type arg_tys ++ map Var args)
- method_name dfun_name name = mkVarOcc $ occNameString dfun_name ++ ('$' : name)
diff --git a/compiler/vectorise/Vectorise/Generic/PAMethods.hs b/compiler/vectorise/Vectorise/Generic/PAMethods.hs
deleted file mode 100644
index 34163d17f6..0000000000
--- a/compiler/vectorise/Vectorise/Generic/PAMethods.hs
+++ /dev/null
@@ -1,586 +0,0 @@
-
--- | Generate methods for the PA class.
---
--- TODO: there is a large amount of redundancy here between the
--- a, PData a, and PDatas a forms. See if we can factor some of this out.
---
-module Vectorise.Generic.PAMethods
- ( buildPReprTyCon
- , buildPAScAndMethods
- ) where
-
-import GhcPrelude
-
-import Vectorise.Utils
-import Vectorise.Monad
-import Vectorise.Builtins
-import Vectorise.Generic.Description
-import CoreSyn
-import CoreUtils
-import FamInstEnv
-import MkCore ( mkWildCase, mkCoreLet )
-import TyCon
-import CoAxiom
-import Type
-import OccName
-import Coercion
-import MkId
-import FamInst
-import TysPrim( intPrimTy )
-
-import DynFlags
-import FastString
-import MonadUtils
-import Control.Monad
-import Outputable
-
-
-buildPReprTyCon :: TyCon -> TyCon -> SumRepr -> VM FamInst
-buildPReprTyCon orig_tc vect_tc repr
- = do name <- mkLocalisedName mkPReprTyConOcc (tyConName orig_tc)
- rhs_ty <- sumReprType repr
- prepr_tc <- builtin preprTyCon
- let axiom = mkSingleCoAxiom Nominal name tyvars [] prepr_tc instTys rhs_ty
- liftDs $ newFamInst SynFamilyInst axiom
- where
- tyvars = tyConTyVars vect_tc
- instTys = [mkTyConApp vect_tc . mkTyVarTys $ tyConTyVars vect_tc]
-
--- buildPAScAndMethods --------------------------------------------------------
-
--- | This says how to build the PR superclass and methods of PA
--- Recall the definition of the PA class:
---
--- @
--- class class PR (PRepr a) => PA a where
--- toPRepr :: a -> PRepr a
--- fromPRepr :: PRepr a -> a
---
--- toArrPRepr :: PData a -> PData (PRepr a)
--- fromArrPRepr :: PData (PRepr a) -> PData a
---
--- toArrPReprs :: PDatas a -> PDatas (PRepr a)
--- fromArrPReprs :: PDatas (PRepr a) -> PDatas a
--- @
---
-type PAInstanceBuilder
- = TyCon -- ^ Vectorised TyCon
- -> CoAxiom Unbranched
- -- ^ Coercion to the representation TyCon
- -> TyCon -- ^ 'PData' TyCon
- -> TyCon -- ^ 'PDatas' TyCon
- -> SumRepr -- ^ Description of generic representation.
- -> VM CoreExpr -- ^ Instance function.
-
-
-buildPAScAndMethods :: VM [(String, PAInstanceBuilder)]
-buildPAScAndMethods
- = return [ ("toPRepr", buildToPRepr)
- , ("fromPRepr", buildFromPRepr)
- , ("toArrPRepr", buildToArrPRepr)
- , ("fromArrPRepr", buildFromArrPRepr)
- , ("toArrPReprs", buildToArrPReprs)
- , ("fromArrPReprs", buildFromArrPReprs)]
-
-
--- buildToPRepr ---------------------------------------------------------------
--- | Build the 'toRepr' method of the PA class.
-buildToPRepr :: PAInstanceBuilder
-buildToPRepr vect_tc repr_ax _ _ repr
- = do let arg_ty = mkTyConApp vect_tc ty_args
-
- -- Get the representation type of the argument.
- res_ty <- mkPReprType arg_ty
-
- -- Var to bind the argument
- arg <- newLocalVar (fsLit "x") arg_ty
-
- -- Build the expression to convert the argument to the generic representation.
- result <- to_sum (Var arg) arg_ty res_ty repr
-
- return $ Lam arg result
- where
- ty_args = mkTyVarTys (tyConTyVars vect_tc)
-
- wrap_repr_inst = wrapTypeUnbranchedFamInstBody repr_ax ty_args []
-
- -- CoreExp to convert the given argument to the generic representation.
- -- We start by doing a case branch on the possible data constructors.
- to_sum :: CoreExpr -> Type -> Type -> SumRepr -> VM CoreExpr
- to_sum _ _ _ EmptySum
- = do void <- builtin voidVar
- return $ wrap_repr_inst $ Var void
-
- to_sum arg arg_ty res_ty (UnarySum r)
- = do (pat, vars, body) <- con_alt r
- return $ mkWildCase arg arg_ty res_ty
- [(pat, vars, wrap_repr_inst body)]
-
- to_sum arg arg_ty res_ty (Sum { repr_sum_tc = sum_tc
- , repr_con_tys = tys
- , repr_cons = cons })
- = do alts <- mapM con_alt cons
- let alts' = [(pat, vars, wrap_repr_inst
- $ mkConApp sum_con (map Type tys ++ [body]))
- | ((pat, vars, body), sum_con)
- <- zip alts (tyConDataCons sum_tc)]
- return $ mkWildCase arg arg_ty res_ty alts'
-
- con_alt (ConRepr con r)
- = do (vars, body) <- to_prod r
- return (DataAlt con, vars, body)
-
- -- CoreExp to convert data constructor fields to the generic representation.
- to_prod :: ProdRepr -> VM ([Var], CoreExpr)
- to_prod EmptyProd
- = do void <- builtin voidVar
- return ([], Var void)
-
- to_prod (UnaryProd comp)
- = do var <- newLocalVar (fsLit "x") (compOrigType comp)
- body <- to_comp (Var var) comp
- return ([var], body)
-
- to_prod (Prod { repr_tup_tc = tup_tc
- , repr_comp_tys = tys
- , repr_comps = comps })
- = do vars <- newLocalVars (fsLit "x") (map compOrigType comps)
- exprs <- zipWithM to_comp (map Var vars) comps
- let [tup_con] = tyConDataCons tup_tc
- return (vars, mkConApp tup_con (map Type tys ++ exprs))
-
- -- CoreExp to convert a data constructor component to the generic representation.
- to_comp :: CoreExpr -> CompRepr -> VM CoreExpr
- to_comp expr (Keep _ _) = return expr
- to_comp expr (Wrap ty) = wrapNewTypeBodyOfWrap expr ty
-
-
--- buildFromPRepr -------------------------------------------------------------
-
--- |Build the 'fromPRepr' method of the PA class.
---
-buildFromPRepr :: PAInstanceBuilder
-buildFromPRepr vect_tc repr_ax _ _ repr
- = do
- arg_ty <- mkPReprType res_ty
- arg <- newLocalVar (fsLit "x") arg_ty
-
- result <- from_sum (unwrapTypeUnbranchedFamInstScrut repr_ax ty_args [] (Var arg))
- repr
- return $ Lam arg result
- where
- ty_args = mkTyVarTys (tyConTyVars vect_tc)
- res_ty = mkTyConApp vect_tc ty_args
-
- from_sum _ EmptySum
- = do dummy <- builtin fromVoidVar
- return $ Var dummy `App` Type res_ty
-
- from_sum expr (UnarySum r) = from_con expr r
- from_sum expr (Sum { repr_sum_tc = sum_tc
- , repr_con_tys = tys
- , repr_cons = cons })
- = do vars <- newLocalVars (fsLit "x") tys
- es <- zipWithM from_con (map Var vars) cons
- return $ mkWildCase expr (exprType expr) res_ty
- [(DataAlt con, [var], e)
- | (con, var, e) <- zip3 (tyConDataCons sum_tc) vars es]
-
- from_con expr (ConRepr con r)
- = from_prod expr (mkConApp con $ map Type ty_args) r
-
- from_prod _ con EmptyProd = return con
- from_prod expr con (UnaryProd r)
- = do e <- from_comp expr r
- return $ con `App` e
-
- from_prod expr con (Prod { repr_tup_tc = tup_tc
- , repr_comp_tys = tys
- , repr_comps = comps
- })
- = do vars <- newLocalVars (fsLit "y") tys
- es <- zipWithM from_comp (map Var vars) comps
- let [tup_con] = tyConDataCons tup_tc
- return $ mkWildCase expr (exprType expr) res_ty
- [(DataAlt tup_con, vars, con `mkApps` es)]
-
- from_comp expr (Keep _ _) = return expr
- from_comp expr (Wrap ty) = unwrapNewTypeBodyOfWrap expr ty
-
-
--- buildToArrRepr -------------------------------------------------------------
-
--- |Build the 'toArrRepr' method of the PA class.
---
-buildToArrPRepr :: PAInstanceBuilder
-buildToArrPRepr vect_tc repr_co pdata_tc _ r
- = do arg_ty <- mkPDataType el_ty
- res_ty <- mkPDataType =<< mkPReprType el_ty
- arg <- newLocalVar (fsLit "xs") arg_ty
-
- pdata_co <- mkBuiltinCo pdataTyCon
- let co = mkAppCo pdata_co
- $ mkSymCo
- $ mkUnbranchedAxInstCo Nominal repr_co ty_args []
-
- scrut = unwrapFamInstScrut pdata_tc ty_args (Var arg)
-
- (vars, result) <- to_sum r
-
- return . Lam arg
- $ mkWildCase scrut (mkTyConApp pdata_tc ty_args) res_ty
- [(DataAlt pdata_dc, vars, mkCast result co)]
- where
- ty_args = mkTyVarTys $ tyConTyVars vect_tc
- el_ty = mkTyConApp vect_tc ty_args
- [pdata_dc] = tyConDataCons pdata_tc
-
- to_sum ss
- = case ss of
- EmptySum -> builtin pvoidVar >>= \pvoid -> return ([], Var pvoid)
- UnarySum r -> to_con r
- Sum{}
- -> do let psum_tc = repr_psum_tc ss
- let [psum_con] = tyConDataCons psum_tc
- (vars, exprs) <- mapAndUnzipM to_con (repr_cons ss)
- sel <- newLocalVar (fsLit "sel") (repr_sel_ty ss)
- return ( sel : concat vars
- , wrapFamInstBody psum_tc (repr_con_tys ss)
- $ mkConApp psum_con
- $ map Type (repr_con_tys ss) ++ (Var sel : exprs))
-
- to_prod ss
- = case ss of
- EmptyProd -> builtin pvoidVar >>= \pvoid -> return ([], Var pvoid)
- UnaryProd r
- -> do pty <- mkPDataType (compOrigType r)
- var <- newLocalVar (fsLit "x") pty
- expr <- to_comp (Var var) r
- return ([var], expr)
- Prod{}
- -> do let [ptup_con] = tyConDataCons (repr_ptup_tc ss)
- ptys <- mapM (mkPDataType . compOrigType) (repr_comps ss)
- vars <- newLocalVars (fsLit "x") ptys
- exprs <- zipWithM to_comp (map Var vars) (repr_comps ss)
- return ( vars
- , wrapFamInstBody (repr_ptup_tc ss) (repr_comp_tys ss)
- $ mkConApp ptup_con
- $ map Type (repr_comp_tys ss) ++ exprs)
-
- to_con (ConRepr _ r) = to_prod r
-
- to_comp expr (Keep _ _) = return expr
- to_comp expr (Wrap ty) = wrapNewTypeBodyOfPDataWrap expr ty
-
-
--- buildFromArrPRepr ----------------------------------------------------------
-
--- |Build the 'fromArrPRepr' method for the PA class.
---
-buildFromArrPRepr :: PAInstanceBuilder
-buildFromArrPRepr vect_tc repr_co pdata_tc _ r
- = do arg_ty <- mkPDataType =<< mkPReprType el_ty
- res_ty <- mkPDataType el_ty
- arg <- newLocalVar (fsLit "xs") arg_ty
-
- pdata_co <- mkBuiltinCo pdataTyCon
- let co = mkAppCo pdata_co
- $ mkUnbranchedAxInstCo Nominal repr_co var_tys []
-
- let scrut = mkCast (Var arg) co
-
- let mk_result args
- = wrapFamInstBody pdata_tc var_tys
- $ mkConApp pdata_con
- $ map Type var_tys ++ args
-
- (expr, _) <- fixV $ \ ~(_, args) ->
- from_sum res_ty (mk_result args) scrut r
-
- return $ Lam arg expr
- where
- var_tys = mkTyVarTys $ tyConTyVars vect_tc
- el_ty = mkTyConApp vect_tc var_tys
- [pdata_con] = tyConDataCons pdata_tc
-
- from_sum res_ty res expr ss
- = case ss of
- EmptySum -> return (res, [])
- UnarySum r -> from_con res_ty res expr r
- Sum {}
- -> do let psum_tc = repr_psum_tc ss
- let [psum_con] = tyConDataCons psum_tc
- sel <- newLocalVar (fsLit "sel") (repr_sel_ty ss)
- ptys <- mapM mkPDataType (repr_con_tys ss)
- vars <- newLocalVars (fsLit "xs") ptys
- (res', args) <- fold from_con res_ty res (map Var vars) (repr_cons ss)
- let scrut = unwrapFamInstScrut psum_tc (repr_con_tys ss) expr
- let body = mkWildCase scrut (exprType scrut) res_ty
- [(DataAlt psum_con, sel : vars, res')]
- return (body, Var sel : args)
-
- from_prod res_ty res expr ss
- = case ss of
- EmptyProd -> return (res, [])
- UnaryProd r -> from_comp res_ty res expr r
- Prod {}
- -> do let ptup_tc = repr_ptup_tc ss
- let [ptup_con] = tyConDataCons ptup_tc
- ptys <- mapM mkPDataType (repr_comp_tys ss)
- vars <- newLocalVars (fsLit "ys") ptys
- (res', args) <- fold from_comp res_ty res (map Var vars) (repr_comps ss)
- let scrut = unwrapFamInstScrut ptup_tc (repr_comp_tys ss) expr
- let body = mkWildCase scrut (exprType scrut) res_ty
- [(DataAlt ptup_con, vars, res')]
- return (body, args)
-
- from_con res_ty res expr (ConRepr _ r) = from_prod res_ty res expr r
-
- from_comp _ res expr (Keep _ _) = return (res, [expr])
- from_comp _ res expr (Wrap ty) = do { expr' <- unwrapNewTypeBodyOfPDataWrap expr ty
- ; return (res, [expr'])
- }
-
- fold f res_ty res exprs rs
- = foldrM f' (res, []) (zip exprs rs)
- where
- f' (expr, r) (res, args)
- = do (res', args') <- f res_ty res expr r
- return (res', args' ++ args)
-
-
--- buildToArrPReprs -----------------------------------------------------------
--- | Build the 'toArrPReprs' instance for the PA class.
--- This converts a PData of elements into the generic representation.
-buildToArrPReprs :: PAInstanceBuilder
-buildToArrPReprs vect_tc repr_co _ pdatas_tc r
- = do
- -- The argument type of the instance.
- -- eg: 'PDatas (Tree a b)'
- arg_ty <- mkPDatasType el_ty
-
- -- The result type.
- -- eg: 'PDatas (PRepr (Tree a b))'
- res_ty <- mkPDatasType =<< mkPReprType el_ty
-
- -- Variable to bind the argument to the instance
- -- eg: (xss :: PDatas (Tree a b))
- varg <- newLocalVar (fsLit "xss") arg_ty
-
- -- Coercion to case between the (PRepr a) type and its instance.
- pdatas_co <- mkBuiltinCo pdatasTyCon
- let co = mkAppCo pdatas_co
- $ mkSymCo
- $ mkUnbranchedAxInstCo Nominal repr_co ty_args []
-
- let scrut = unwrapFamInstScrut pdatas_tc ty_args (Var varg)
- (vars, result) <- to_sum r
-
- return $ Lam varg
- $ mkWildCase scrut (mkTyConApp pdatas_tc ty_args) res_ty
- [(DataAlt pdatas_dc, vars, mkCast result co)]
-
- where
- -- The element type of the argument.
- -- eg: 'Tree a b'.
- ty_args = mkTyVarTys $ tyConTyVars vect_tc
- el_ty = mkTyConApp vect_tc ty_args
-
- -- PDatas data constructor
- [pdatas_dc] = tyConDataCons pdatas_tc
-
- to_sum ss
- = case ss of
- -- We can't convert data types with no data.
- -- See Note: [Empty PDatas].
- EmptySum -> do dflags <- getDynFlags
- return ([], errorEmptyPDatas dflags el_ty)
- UnarySum r -> do dflags <- getDynFlags
- to_con (errorEmptyPDatas dflags el_ty) r
-
- Sum{}
- -> do let psums_tc = repr_psums_tc ss
- let [psums_con] = tyConDataCons psums_tc
- sels <- newLocalVar (fsLit "sels") (repr_sels_ty ss)
-
- -- Take the number of selectors to serve as the length of
- -- and PDatas Void arrays in the product. See Note [Empty PDatas].
- let xSums = App (repr_selsLength_v ss) (Var sels)
-
- xSums_var <- newLocalVar (fsLit "xsum") intPrimTy
-
- (vars, exprs) <- mapAndUnzipM (to_con xSums_var) (repr_cons ss)
- return ( sels : concat vars
- , wrapFamInstBody psums_tc (repr_con_tys ss)
- $ mkCoreLet (NonRec xSums_var xSums)
- -- mkCoreLet ensures that the let/app invariant holds
- $ mkConApp psums_con
- $ map Type (repr_con_tys ss) ++ (Var sels : exprs))
-
- to_prod xSums ss
- = case ss of
- EmptyProd
- -> do pvoids <- builtin pvoidsVar
- return ([], App (Var pvoids) (Var xSums) )
-
- UnaryProd r
- -> do pty <- mkPDatasType (compOrigType r)
- var <- newLocalVar (fsLit "x") pty
- expr <- to_comp (Var var) r
- return ([var], expr)
-
- Prod{}
- -> do let [ptups_con] = tyConDataCons (repr_ptups_tc ss)
- ptys <- mapM (mkPDatasType . compOrigType) (repr_comps ss)
- vars <- newLocalVars (fsLit "x") ptys
- exprs <- zipWithM to_comp (map Var vars) (repr_comps ss)
- return ( vars
- , wrapFamInstBody (repr_ptups_tc ss) (repr_comp_tys ss)
- $ mkConApp ptups_con
- $ map Type (repr_comp_tys ss) ++ exprs)
-
- to_con xSums (ConRepr _ r)
- = to_prod xSums r
-
- to_comp expr (Keep _ _) = return expr
- to_comp expr (Wrap ty) = wrapNewTypeBodyOfPDatasWrap expr ty
-
-
--- buildFromArrPReprs ---------------------------------------------------------
-buildFromArrPReprs :: PAInstanceBuilder
-buildFromArrPReprs vect_tc repr_co _ pdatas_tc r
- = do
- -- The argument type of the instance.
- -- eg: 'PDatas (PRepr (Tree a b))'
- arg_ty <- mkPDatasType =<< mkPReprType el_ty
-
- -- The result type.
- -- eg: 'PDatas (Tree a b)'
- res_ty <- mkPDatasType el_ty
-
- -- Variable to bind the argument to the instance
- -- eg: (xss :: PDatas (PRepr (Tree a b)))
- varg <- newLocalVar (fsLit "xss") arg_ty
-
- -- Build the coercion between PRepr and the instance type
- pdatas_co <- mkBuiltinCo pdatasTyCon
- let co = mkAppCo pdatas_co
- $ mkUnbranchedAxInstCo Nominal repr_co var_tys []
-
- let scrut = mkCast (Var varg) co
-
- let mk_result args
- = wrapFamInstBody pdatas_tc var_tys
- $ mkConApp pdatas_con
- $ map Type var_tys ++ args
-
- (expr, _) <- fixV $ \ ~(_, args) ->
- from_sum res_ty (mk_result args) scrut r
-
- return $ Lam varg expr
- where
- -- The element type of the argument.
- -- eg: 'Tree a b'.
- ty_args = mkTyVarTys $ tyConTyVars vect_tc
- el_ty = mkTyConApp vect_tc ty_args
-
- var_tys = mkTyVarTys $ tyConTyVars vect_tc
- [pdatas_con] = tyConDataCons pdatas_tc
-
- from_sum res_ty res expr ss
- = case ss of
- -- We can't convert data types with no data.
- -- See Note: [Empty PDatas].
- EmptySum -> do dflags <- getDynFlags
- return (res, errorEmptyPDatas dflags el_ty)
- UnarySum r -> from_con res_ty res expr r
-
- Sum {}
- -> do let psums_tc = repr_psums_tc ss
- let [psums_con] = tyConDataCons psums_tc
- sel <- newLocalVar (fsLit "sels") (repr_sels_ty ss)
- ptys <- mapM mkPDatasType (repr_con_tys ss)
- vars <- newLocalVars (fsLit "xs") ptys
- (res', args) <- fold from_con res_ty res (map Var vars) (repr_cons ss)
- let scrut = unwrapFamInstScrut psums_tc (repr_con_tys ss) expr
- let body = mkWildCase scrut (exprType scrut) res_ty
- [(DataAlt psums_con, sel : vars, res')]
- return (body, Var sel : args)
-
- from_prod res_ty res expr ss
- = case ss of
- EmptyProd -> return (res, [])
- UnaryProd r -> from_comp res_ty res expr r
- Prod {}
- -> do let ptups_tc = repr_ptups_tc ss
- let [ptups_con] = tyConDataCons ptups_tc
- ptys <- mapM mkPDatasType (repr_comp_tys ss)
- vars <- newLocalVars (fsLit "ys") ptys
- (res', args) <- fold from_comp res_ty res (map Var vars) (repr_comps ss)
- let scrut = unwrapFamInstScrut ptups_tc (repr_comp_tys ss) expr
- let body = mkWildCase scrut (exprType scrut) res_ty
- [(DataAlt ptups_con, vars, res')]
- return (body, args)
-
- from_con res_ty res expr (ConRepr _ r)
- = from_prod res_ty res expr r
-
- from_comp _ res expr (Keep _ _) = return (res, [expr])
- from_comp _ res expr (Wrap ty) = do { expr' <- unwrapNewTypeBodyOfPDatasWrap expr ty
- ; return (res, [expr'])
- }
-
- fold f res_ty res exprs rs
- = foldrM f' (res, []) (zip exprs rs)
- where
- f' (expr, r) (res, args)
- = do (res', args') <- f res_ty res expr r
- return (res', args' ++ args)
-
-
--- Notes ----------------------------------------------------------------------
-{-
-Note [Empty PDatas]
-~~~~~~~~~~~~~~~~~~~
-We don't support "empty" data types like the following:
-
- data Empty0
- data Empty1 = MkEmpty1
- data Empty2 = MkEmpty2 Empty0
- ...
-
-There is no parallel data associcated with these types, so there is no where
-to store the length of the PDatas array with our standard representation.
-
-Enumerations like the following are ok:
- data Bool = True | False
-
-The native and generic representations are:
- type instance (PDatas Bool) = VPDs:Bool Sels2
- type instance (PDatas (Repr Bool)) = PSum2s Sels2 (PDatas Void) (PDatas Void)
-
-To take the length of a (PDatas Bool) we take the length of the contained Sels2.
-When converting a (PDatas Bool) to a (PDatas (Repr Bool)) we use this length to
-initialise the two (PDatas Void) arrays.
-
-However, with this:
- data Empty1 = MkEmpty1
-
-The native and generic representations would be:
- type instance (PDatas Empty1) = VPDs:Empty1
- type instance (PDatas (Repr Empty1)) = PVoids Int
-
-The 'Int' argument of PVoids is supposed to store the length of the PDatas
-array. When converting the (PDatas Empty1) to a (PDatas (Repr Empty1)) we
-need to come up with a value for it, but there isn't one.
-
-To fix this we'd need to add an Int field to VPDs:Empty1 as well, but that's
-too much hassle and there's no point running a parallel computation on no
-data anyway.
--}
-errorEmptyPDatas :: DynFlags -> Type -> a
-errorEmptyPDatas dflags tc
- = cantVectorise dflags "Vectorise.PAMethods"
- $ vcat [ text "Cannot vectorise data type with no parallel data " <> quotes (ppr tc)
- , text "Data types to be vectorised must contain at least one constructor"
- , text "with at least one field." ]
diff --git a/compiler/vectorise/Vectorise/Generic/PData.hs b/compiler/vectorise/Vectorise/Generic/PData.hs
deleted file mode 100644
index 29e6bc86ed..0000000000
--- a/compiler/vectorise/Vectorise/Generic/PData.hs
+++ /dev/null
@@ -1,178 +0,0 @@
-
--- | Build instance tycons for the PData and PDatas type families.
---
--- TODO: the PData and PDatas cases are very similar.
--- We should be able to factor out the common parts.
-module Vectorise.Generic.PData
- ( buildPDataTyCon
- , buildPDatasTyCon )
-where
-
-import GhcPrelude
-
-import Vectorise.Monad
-import Vectorise.Builtins
-import Vectorise.Generic.Description
-import Vectorise.Utils
-import Vectorise.Env( GlobalEnv( global_fam_inst_env ) )
-
-import BasicTypes ( SourceText(..) )
-import BuildTyCl
-import DataCon
-import TyCon
-import Type
-import FamInst
-import FamInstEnv
-import TcMType
-import Name
-import Util
-import MonadUtils
-import Control.Monad
-
-
--- buildPDataTyCon ------------------------------------------------------------
--- | Build the PData instance tycon for a given type constructor.
-buildPDataTyCon :: TyCon -> TyCon -> SumRepr -> VM FamInst
-buildPDataTyCon orig_tc vect_tc repr
- = fixV $ \fam_inst ->
- do let repr_tc = dataFamInstRepTyCon fam_inst
- name' <- mkLocalisedName mkPDataTyConOcc orig_name
- rhs <- buildPDataTyConRhs orig_name vect_tc repr_tc repr
- pdata <- builtin pdataTyCon
- buildDataFamInst name' pdata vect_tc rhs
- where
- orig_name = tyConName orig_tc
-
-buildDataFamInst :: Name -> TyCon -> TyCon -> AlgTyConRhs -> VM FamInst
-buildDataFamInst name' fam_tc vect_tc rhs
- = do { axiom_name <- mkDerivedName mkInstTyCoOcc name'
-
- ; (_, tyvars') <- liftDs $ freshenTyVarBndrs tyvars
- ; let ax = mkSingleCoAxiom Representational axiom_name tyvars' [] fam_tc pat_tys rep_ty
- tys' = mkTyVarTys tyvars'
- rep_ty = mkTyConApp rep_tc tys'
- pat_tys = [mkTyConApp vect_tc tys']
- rep_tc = mkAlgTyCon name'
- (mkTyConBindersPreferAnon tyvars' liftedTypeKind)
- liftedTypeKind
- (map (const Nominal) tyvars')
- Nothing
- [] -- no stupid theta
- rhs
- (DataFamInstTyCon ax fam_tc pat_tys)
- False -- not GADT syntax
- ; liftDs $ newFamInst (DataFamilyInst rep_tc) ax }
- where
- tyvars = tyConTyVars vect_tc
-
-buildPDataTyConRhs :: Name -> TyCon -> TyCon -> SumRepr -> VM AlgTyConRhs
-buildPDataTyConRhs orig_name vect_tc repr_tc repr
- = do data_con <- buildPDataDataCon orig_name vect_tc repr_tc repr
- return $ mkDataTyConRhs [data_con]
-
-
-buildPDataDataCon :: Name -> TyCon -> TyCon -> SumRepr -> VM DataCon
-buildPDataDataCon orig_name vect_tc repr_tc repr
- = do let tvs = tyConTyVars vect_tc
- dc_name <- mkLocalisedName mkPDataDataConOcc orig_name
- comp_tys <- mkSumTys repr_sel_ty mkPDataType repr
- fam_envs <- readGEnv global_fam_inst_env
- rep_nm <- liftDs $ newTyConRepName dc_name
- let univ_tvbs = mkTyVarBinders Specified tvs
- tag_map = mkTyConTagMap repr_tc
- liftDs $ buildDataCon fam_envs dc_name
- False -- not infix
- rep_nm
- (map (const no_bang) comp_tys)
- (Just $ map (const HsLazy) comp_tys)
- [] -- no field labels
- tvs
- [] -- no existentials
- univ_tvbs
- [] -- no eq spec
- [] -- no context
- comp_tys
- (mkFamilyTyConApp repr_tc (mkTyVarTys tvs))
- repr_tc
- tag_map
- where
- no_bang = HsSrcBang NoSourceText NoSrcUnpack NoSrcStrict
-
-
--- buildPDatasTyCon -----------------------------------------------------------
--- | Build the PDatas instance tycon for a given type constructor.
-buildPDatasTyCon :: TyCon -> TyCon -> SumRepr -> VM FamInst
-buildPDatasTyCon orig_tc vect_tc repr
- = fixV $ \fam_inst ->
- do let repr_tc = dataFamInstRepTyCon fam_inst
- name' <- mkLocalisedName mkPDatasTyConOcc orig_name
- rhs <- buildPDatasTyConRhs orig_name vect_tc repr_tc repr
- pdatas <- builtin pdatasTyCon
- buildDataFamInst name' pdatas vect_tc rhs
- where
- orig_name = tyConName orig_tc
-
-buildPDatasTyConRhs :: Name -> TyCon -> TyCon -> SumRepr -> VM AlgTyConRhs
-buildPDatasTyConRhs orig_name vect_tc repr_tc repr
- = do data_con <- buildPDatasDataCon orig_name vect_tc repr_tc repr
- return $ mkDataTyConRhs [data_con]
-
-
-buildPDatasDataCon :: Name -> TyCon -> TyCon -> SumRepr -> VM DataCon
-buildPDatasDataCon orig_name vect_tc repr_tc repr
- = do let tvs = tyConTyVars vect_tc
- dc_name <- mkLocalisedName mkPDatasDataConOcc orig_name
-
- comp_tys <- mkSumTys repr_sels_ty mkPDatasType repr
- fam_envs <- readGEnv global_fam_inst_env
- rep_nm <- liftDs $ newTyConRepName dc_name
- let univ_tvbs = mkTyVarBinders Specified tvs
- tag_map = mkTyConTagMap repr_tc
- liftDs $ buildDataCon fam_envs dc_name
- False -- not infix
- rep_nm
- (map (const no_bang) comp_tys)
- (Just $ map (const HsLazy) comp_tys)
- [] -- no field labels
- tvs
- [] -- no existentials
- univ_tvbs
- [] -- no eq spec
- [] -- no context
- comp_tys
- (mkFamilyTyConApp repr_tc (mkTyVarTys tvs))
- repr_tc
- tag_map
- where
- no_bang = HsSrcBang NoSourceText NoSrcUnpack NoSrcStrict
-
-
--- Utils ----------------------------------------------------------------------
--- | Flatten a SumRepr into a list of data constructor types.
-mkSumTys
- :: (SumRepr -> Type)
- -> (Type -> VM Type)
- -> SumRepr
- -> VM [Type]
-
-mkSumTys repr_selX_ty mkTc repr
- = sum_tys repr
- where
- sum_tys EmptySum = return []
- sum_tys (UnarySum r) = con_tys r
- sum_tys d@(Sum { repr_cons = cons })
- = liftM (repr_selX_ty d :) (concatMapM con_tys cons)
-
- con_tys (ConRepr _ r) = prod_tys r
-
- prod_tys EmptyProd = return []
- prod_tys (UnaryProd r) = liftM singleton (comp_ty r)
- prod_tys (Prod { repr_comps = comps }) = mapM comp_ty comps
-
- comp_ty r = mkTc (compOrigType r)
-
-{-
-mk_fam_inst :: TyCon -> TyCon -> (TyCon, [Type])
-mk_fam_inst fam_tc arg_tc
- = (fam_tc, [mkTyConApp arg_tc . mkTyVarTys $ tyConTyVars arg_tc])
--}
diff --git a/compiler/vectorise/Vectorise/Monad.hs b/compiler/vectorise/Vectorise/Monad.hs
deleted file mode 100644
index bcfb8deadf..0000000000
--- a/compiler/vectorise/Vectorise/Monad.hs
+++ /dev/null
@@ -1,196 +0,0 @@
-module Vectorise.Monad (
- module Vectorise.Monad.Base,
- module Vectorise.Monad.Naming,
- module Vectorise.Monad.Local,
- module Vectorise.Monad.Global,
- module Vectorise.Monad.InstEnv,
- initV,
-
- -- * Builtins
- liftBuiltinDs,
- builtin,
- builtins,
-
- -- * Variables
- lookupVar,
- lookupVar_maybe,
- addGlobalParallelVar,
- addGlobalParallelTyCon,
-) where
-
-import GhcPrelude
-
-import Vectorise.Monad.Base
-import Vectorise.Monad.Naming
-import Vectorise.Monad.Local
-import Vectorise.Monad.Global
-import Vectorise.Monad.InstEnv
-import Vectorise.Builtins
-import Vectorise.Env
-
-import CoreSyn
-import TcRnMonad
-import DsMonad
-import HscTypes hiding ( MonadThings(..) )
-import DynFlags
-import InstEnv
-import Class
-import TyCon
-import NameSet
-import VarSet
-import VarEnv
-import Var
-import Id
-import Name
-import ErrUtils
-import Outputable
-import Module
-
-import Control.Monad (join)
-
--- |Run a vectorisation computation.
---
-initV :: HscEnv
- -> ModGuts
- -> VectInfo
- -> VM a
- -> IO (Maybe (VectInfo, a))
-initV hsc_env guts info thing_inside
- = do { dumpIfVtTrace "Incoming VectInfo" (ppr info)
-
- ; (_, res) <- initDsWithModGuts hsc_env guts go
- ; case join res of
- Nothing
- -> dumpIfVtTrace "Vectorisation FAILED!" empty
- Just (info', _)
- -> dumpIfVtTrace "Outgoing VectInfo" (ppr info')
-
- ; return $ join res
- }
- where
- dflags = hsc_dflags hsc_env
-
- dumpIfVtTrace = dumpIfSet_dyn dflags Opt_D_dump_vt_trace
-
- bindsToIds (NonRec v _) = [v]
- bindsToIds (Rec binds) = map fst binds
-
- ids = concatMap bindsToIds (mg_binds guts)
-
- go
- = do { -- set up tables of builtin entities
- ; builtins <- initBuiltins
- ; builtin_vars <- initBuiltinVars builtins
-
- -- set up class and type family envrionments
- ; eps <- liftIO $ hscEPS hsc_env
- ; let famInstEnvs = (eps_fam_inst_env eps, mg_fam_inst_env guts)
- instEnvs = InstEnvs (eps_inst_env eps)
- (mg_inst_env guts)
- (mkModuleSet (dep_orphs (mg_deps guts)))
- builtin_pas = initClassDicts instEnvs (paClass builtins) -- grab all 'PA' and..
- builtin_prs = initClassDicts instEnvs (prClass builtins) -- ..'PR' class instances
-
- -- construct the initial global environment
- ; let genv = extendImportedVarsEnv builtin_vars
- . setPAFunsEnv builtin_pas
- . setPRFunsEnv builtin_prs
- $ initGlobalEnv (gopt Opt_VectorisationAvoidance dflags)
- info (mg_vect_decls guts) instEnvs famInstEnvs
-
- -- perform vectorisation
- ; r <- runVM thing_inside builtins genv emptyLocalEnv
- ; case r of
- Yes genv _ x -> return $ Just (new_info genv, x)
- No reason -> do { unqual <- mkPrintUnqualifiedDs
- ; liftIO $
- printOutputForUser dflags unqual $
- mkDumpDoc "Warning: vectorisation failure:" reason
- ; return Nothing
- }
- }
-
- new_info genv = modVectInfo genv ids (mg_tcs guts) (mg_vect_decls guts) info
-
- -- For a given DPH class, produce a mapping from type constructor (in head position) to the
- -- instance dfun for that type constructor and class. (DPH class instances cannot overlap in
- -- head constructors.)
- --
- initClassDicts :: InstEnvs -> Class -> [(Name, Var)]
- initClassDicts insts cls = map find $ classInstances insts cls
- where
- find i | [Just tc] <- instanceRoughTcs i = (tc, instanceDFunId i)
- | otherwise = pprPanic invalidInstance (ppr i)
-
- invalidInstance = "Invalid DPH instance (overlapping in head constructor)"
-
--- Builtins -------------------------------------------------------------------
-
--- |Lift a desugaring computation using the `Builtins` into the vectorisation monad.
---
-liftBuiltinDs :: (Builtins -> DsM a) -> VM a
-liftBuiltinDs p = VM $ \bi genv lenv -> do { x <- p bi; return (Yes genv lenv x)}
-
--- |Project something from the set of builtins.
---
-builtin :: (Builtins -> a) -> VM a
-builtin f = VM $ \bi genv lenv -> return (Yes genv lenv (f bi))
-
--- |Lift a function using the `Builtins` into the vectorisation monad.
---
-builtins :: (a -> Builtins -> b) -> VM (a -> b)
-builtins f = VM $ \bi genv lenv -> return (Yes genv lenv (`f` bi))
-
-
--- Var ------------------------------------------------------------------------
-
--- |Lookup the vectorised, and if local, also the lifted version of a variable.
---
--- * If it's in the global environment we get the vectorised version.
--- * If it's in the local environment we get both the vectorised and lifted version.
---
-lookupVar :: Var -> VM (Scope Var (Var, Var))
-lookupVar v
- = do { mb_res <- lookupVar_maybe v
- ; case mb_res of
- Just x -> return x
- Nothing ->
- do dflags <- getDynFlags
- dumpVar dflags v
- }
-
-lookupVar_maybe :: Var -> VM (Maybe (Scope Var (Var, Var)))
-lookupVar_maybe v
- = do { r <- readLEnv $ \env -> lookupVarEnv (local_vars env) v
- ; case r of
- Just e -> return $ Just (Local e)
- Nothing -> fmap Global <$> (readGEnv $ \env -> lookupVarEnv (global_vars env) v)
- }
-
-dumpVar :: DynFlags -> Var -> a
-dumpVar dflags var
- | Just _ <- isClassOpId_maybe var
- = cantVectorise dflags "ClassOpId not vectorised:" (ppr var)
- | otherwise
- = cantVectorise dflags "Variable not vectorised:" (ppr var)
-
-
--- Global parallel entities ----------------------------------------------------
-
--- |Mark the given variable as parallel — i.e., executing the associated code might involve
--- parallel array computations.
---
-addGlobalParallelVar :: Var -> VM ()
-addGlobalParallelVar var
- = do { traceVt "addGlobalParallelVar" (ppr var)
- ; updGEnv $ \env -> env{global_parallel_vars = extendDVarSet (global_parallel_vars env) var}
- }
-
--- |Mark the given type constructor as parallel — i.e., its values might embed parallel arrays.
---
-addGlobalParallelTyCon :: TyCon -> VM ()
-addGlobalParallelTyCon tycon
- = do { traceVt "addGlobalParallelTyCon" (ppr tycon)
- ; updGEnv $ \env ->
- env{global_parallel_tycons = extendNameSet (global_parallel_tycons env) (tyConName tycon)}
- }
diff --git a/compiler/vectorise/Vectorise/Monad/Base.hs b/compiler/vectorise/Vectorise/Monad/Base.hs
deleted file mode 100644
index eb648710a9..0000000000
--- a/compiler/vectorise/Vectorise/Monad/Base.hs
+++ /dev/null
@@ -1,245 +0,0 @@
--- |The Vectorisation monad.
-
-module Vectorise.Monad.Base (
- -- * The Vectorisation Monad
- VResult(..),
- VM(..),
-
- -- * Lifting
- liftDs,
-
- -- * Error Handling
- cantVectorise,
- maybeCantVectorise,
- maybeCantVectoriseM,
-
- -- * Debugging
- emitVt, traceVt, dumpOptVt, dumpVt,
-
- -- * Control
- noV, traceNoV,
- ensureV, traceEnsureV,
- onlyIfV,
- tryV, tryErrV,
- maybeV, traceMaybeV,
- orElseV, orElseErrV,
- fixV,
-) where
-
-import GhcPrelude
-
-import Vectorise.Builtins
-import Vectorise.Env
-
-import DsMonad
-import TcRnMonad
-import ErrUtils
-import Outputable
-import DynFlags
-
-import Control.Monad
-
-
--- The Vectorisation Monad ----------------------------------------------------
-
--- |Vectorisation can either succeed with new envionment and a value, or return with failure
--- (including a description of the reason for failure).
---
-data VResult a
- = Yes GlobalEnv LocalEnv a
- | No SDoc
-
-newtype VM a
- = VM { runVM :: Builtins -> GlobalEnv -> LocalEnv -> DsM (VResult a) }
-
-instance Monad VM where
- VM p >>= f = VM $ \bi genv lenv -> do
- r <- p bi genv lenv
- case r of
- Yes genv' lenv' x -> runVM (f x) bi genv' lenv'
- No reason -> return $ No reason
-
-instance Applicative VM where
- pure x = VM $ \_ genv lenv -> return (Yes genv lenv x)
- (<*>) = ap
-
-instance Functor VM where
- fmap = liftM
-
-instance MonadIO VM where
- liftIO = liftDs . liftIO
-
-instance HasDynFlags VM where
- getDynFlags = liftDs getDynFlags
-
--- Lifting --------------------------------------------------------------------
-
--- |Lift a desugaring computation into the vectorisation monad.
---
-liftDs :: DsM a -> VM a
-liftDs p = VM $ \_ genv lenv -> do { x <- p; return (Yes genv lenv x) }
-
-
--- Error Handling -------------------------------------------------------------
-
--- |Throw a `pgmError` saying we can't vectorise something.
---
-cantVectorise :: DynFlags -> String -> SDoc -> a
-cantVectorise dflags s d = pgmError
- . showSDoc dflags
- $ vcat [text "*** Vectorisation error ***",
- nest 4 $ sep [text s, nest 4 d]]
-
--- |Like `fromJust`, but `pgmError` on Nothing.
---
-maybeCantVectorise :: DynFlags -> String -> SDoc -> Maybe a -> a
-maybeCantVectorise dflags s d Nothing = cantVectorise dflags s d
-maybeCantVectorise _ _ _ (Just x) = x
-
--- |Like `maybeCantVectorise` but in a `Monad`.
---
-maybeCantVectoriseM :: (Monad m, HasDynFlags m)
- => String -> SDoc -> m (Maybe a) -> m a
-maybeCantVectoriseM s d p
- = do
- r <- p
- case r of
- Just x -> return x
- Nothing ->
- do dflags <- getDynFlags
- cantVectorise dflags s d
-
-
--- Debugging ------------------------------------------------------------------
-
--- |Output a trace message if -ddump-vt-trace is active.
---
-emitVt :: String -> SDoc -> VM ()
-emitVt herald doc
- = liftDs $ do
- dflags <- getDynFlags
- liftIO . printOutputForUser dflags alwaysQualify $
- hang (text herald) 2 doc
-
--- |Output a trace message if -ddump-vt-trace is active.
---
-traceVt :: String -> SDoc -> VM ()
-traceVt herald doc
- = liftDs $ traceOptIf Opt_D_dump_vt_trace $ hang (text herald) 2 doc
-
--- |Dump the given program conditionally.
---
-dumpOptVt :: DumpFlag -> String -> SDoc -> VM ()
-dumpOptVt flag header doc
- = do { b <- liftDs $ doptM flag
- ; if b
- then dumpVt header doc
- else return ()
- }
-
--- |Dump the given program unconditionally.
---
-dumpVt :: String -> SDoc -> VM ()
-dumpVt header doc
- = do { unqual <- liftDs mkPrintUnqualifiedDs
- ; dflags <- liftDs getDynFlags
- ; liftIO $ printOutputForUser dflags unqual (mkDumpDoc header doc)
- }
-
-
--- Control --------------------------------------------------------------------
-
--- |Return some result saying we've failed.
---
-noV :: SDoc -> VM a
-noV reason = VM $ \_ _ _ -> return $ No reason
-
--- |Like `traceNoV` but also emit some trace message to stderr.
---
-traceNoV :: String -> SDoc -> VM a
-traceNoV s d = pprTrace s d $ noV d
-
--- |If `True` then carry on, otherwise fail.
---
-ensureV :: SDoc -> Bool -> VM ()
-ensureV reason False = noV reason
-ensureV _reason True = return ()
-
--- |Like `ensureV` but if we fail then emit some trace message to stderr.
---
-traceEnsureV :: String -> SDoc -> Bool -> VM ()
-traceEnsureV s d False = traceNoV s d
-traceEnsureV _ _ True = return ()
-
--- |If `True` then return the first argument, otherwise fail.
---
-onlyIfV :: SDoc -> Bool -> VM a -> VM a
-onlyIfV reason b p = ensureV reason b >> p
-
--- |Try some vectorisation computaton.
---
--- If it succeeds then return `Just` the result; otherwise, return `Nothing` after emitting a
--- failure message.
---
-tryErrV :: VM a -> VM (Maybe a)
-tryErrV (VM p) = VM $ \bi genv lenv ->
- do
- r <- p bi genv lenv
- case r of
- Yes genv' lenv' x -> return (Yes genv' lenv' (Just x))
- No reason -> do { unqual <- mkPrintUnqualifiedDs
- ; dflags <- getDynFlags
- ; liftIO $
- printInfoForUser dflags unqual $
- text "Warning: vectorisation failure:" <+> reason
- ; return (Yes genv lenv Nothing)
- }
-
--- |Try some vectorisation computaton.
---
--- If it succeeds then return `Just` the result; otherwise, return `Nothing` without emitting a
--- failure message.
---
-tryV :: VM a -> VM (Maybe a)
-tryV (VM p) = VM $ \bi genv lenv ->
- do
- r <- p bi genv lenv
- case r of
- Yes genv' lenv' x -> return (Yes genv' lenv' (Just x))
- No _reason -> return (Yes genv lenv Nothing)
-
--- |If `Just` then return the value, otherwise fail.
---
-maybeV :: SDoc -> VM (Maybe a) -> VM a
-maybeV reason p = maybe (noV reason) return =<< p
-
--- |Like `maybeV` but emit a message to stderr if we fail.
---
-traceMaybeV :: String -> SDoc -> VM (Maybe a) -> VM a
-traceMaybeV s d p = maybe (traceNoV s d) return =<< p
-
--- |Try the first computation,
---
--- * if it succeeds then take the returned value,
--- * if it fails then run the second computation instead while emitting a failure message.
---
-orElseErrV :: VM a -> VM a -> VM a
-orElseErrV p q = maybe q return =<< tryErrV p
-
--- |Try the first computation,
---
--- * if it succeeds then take the returned value,
--- * if it fails then run the second computation instead without emitting a failure message.
---
-orElseV :: VM a -> VM a -> VM a
-orElseV p q = maybe q return =<< tryV p
-
--- |Fixpoint in the vectorisation monad.
---
-fixV :: (a -> VM a) -> VM a
-fixV f = VM (\bi genv lenv -> fixDs $ \r -> runVM (f (unYes r)) bi genv lenv )
- where
- -- NOTE: It is essential that we are lazy in r above so do not replace
- -- calls to this function by an explicit case.
- unYes (Yes _ _ x) = x
- unYes (No reason) = pprPanic "Vectorise.Monad.Base.fixV: no result" reason
diff --git a/compiler/vectorise/Vectorise/Monad/Global.hs b/compiler/vectorise/Vectorise/Monad/Global.hs
deleted file mode 100644
index 9abeb59dcb..0000000000
--- a/compiler/vectorise/Vectorise/Monad/Global.hs
+++ /dev/null
@@ -1,239 +0,0 @@
--- Operations on the global state of the vectorisation monad.
-
-module Vectorise.Monad.Global (
- readGEnv,
- setGEnv,
- updGEnv,
-
- -- * Configuration
- isVectAvoidanceAggressive,
-
- -- * Vars
- defGlobalVar, undefGlobalVar,
-
- -- * Vectorisation declarations
- lookupVectDecl,
-
- -- * Scalars
- globalParallelVars, globalParallelTyCons,
-
- -- * TyCons
- lookupTyCon,
- defTyConName, defTyCon, globalVectTyCons,
-
- -- * Datacons
- lookupDataCon,
- defDataCon,
-
- -- * PA Dictionaries
- lookupTyConPA,
- defTyConPAs,
-
- -- * PR Dictionaries
- lookupTyConPR
-) where
-
-import GhcPrelude
-
-import Vectorise.Monad.Base
-import Vectorise.Env
-
-import CoreSyn
-import Type
-import TyCon
-import DataCon
-import DynFlags
-import NameEnv
-import NameSet
-import Name
-import VarEnv
-import VarSet
-import Var as Var
-import Outputable
-
-
--- Global Environment ---------------------------------------------------------
-
--- |Project something from the global environment.
---
-readGEnv :: (GlobalEnv -> a) -> VM a
-readGEnv f = VM $ \_ genv lenv -> return (Yes genv lenv (f genv))
-
--- |Set the value of the global environment.
---
-setGEnv :: GlobalEnv -> VM ()
-setGEnv genv = VM $ \_ _ lenv -> return (Yes genv lenv ())
-
--- |Update the global environment using the provided function.
---
-updGEnv :: (GlobalEnv -> GlobalEnv) -> VM ()
-updGEnv f = VM $ \_ genv lenv -> return (Yes (f genv) lenv ())
-
-
--- Configuration --------------------------------------------------------------
-
--- |Should we avoid as much vectorisation as possible?
---
--- Set by '-f[no]-vectorisation-avoidance'
---
-isVectAvoidanceAggressive :: VM Bool
-isVectAvoidanceAggressive = readGEnv global_vect_avoid
-
-
--- Vars -----------------------------------------------------------------------
-
--- |Add a mapping between a global var and its vectorised version to the state.
---
-defGlobalVar :: Var -> Var -> VM ()
-defGlobalVar v v'
- = do { traceVt "add global var mapping:" (ppr v <+> text "-->" <+> ppr v')
-
- -- check for duplicate vectorisation
- ; currentDef <- readGEnv $ \env -> lookupVarEnv (global_vars env) v
- ; case currentDef of
- Just old_v' ->
- do dflags <- getDynFlags
- cantVectorise dflags "Variable is already vectorised:" $
- ppr v <+> moduleOf v old_v'
- Nothing -> return ()
-
- ; updGEnv $ \env -> env { global_vars = extendVarEnv (global_vars env) v v' }
- }
- where
- moduleOf var var' | var == var'
- = text "vectorises to itself"
- | Just mod <- nameModule_maybe (Var.varName var')
- = text "in module" <+> ppr mod
- | otherwise
- = text "in the current module"
-
--- |Remove the mapping of a variable in the vectorisation map.
---
-undefGlobalVar :: Var -> VM ()
-undefGlobalVar v
- = do
- { traceVt "REMOVING global var mapping:" (ppr v)
- ; updGEnv $ \env -> env { global_vars = delVarEnv (global_vars env) v }
- }
-
-
--- Vectorisation declarations -------------------------------------------------
-
--- |Check whether a variable has a vectorisation declaration.
---
--- The first component of the result indicates whether the variable has a 'NOVECTORISE' declaration.
--- The second component contains the given type and expression in case of a 'VECTORISE' declaration.
---
-lookupVectDecl :: Var -> VM (Bool, Maybe (Type, CoreExpr))
-lookupVectDecl var
- = readGEnv $ \env ->
- case lookupVarEnv (global_vect_decls env) var of
- Nothing -> (False, Nothing)
- Just Nothing -> (True, Nothing)
- Just vectDecl -> (False, vectDecl)
-
-
--- Parallel entities -----------------------------------------------------------
-
--- |Get the set of global parallel variables.
---
-globalParallelVars :: VM DVarSet
-globalParallelVars = readGEnv global_parallel_vars
-
--- |Get the set of all parallel type constructors (those that may embed parallelism) including both
--- both those parallel type constructors declared in an imported module and those declared in the
--- current module.
---
-globalParallelTyCons :: VM NameSet
-globalParallelTyCons = readGEnv global_parallel_tycons
-
-
--- TyCons ---------------------------------------------------------------------
-
--- |Determine the vectorised version of a `TyCon`. The vectorisation map in the global environment
--- contains a vectorised version if the original `TyCon` embeds any parallel arrays.
---
-lookupTyCon :: TyCon -> VM (Maybe TyCon)
-lookupTyCon tc
- = readGEnv $ \env -> lookupNameEnv (global_tycons env) (tyConName tc)
-
--- |Add a mapping between plain and vectorised `TyCon`s to the global environment.
---
--- The second argument is only to enable tracing for (mutually) recursively defined type
--- constructors, where we /must not/ pull at the vectorised type constructors (because that would
--- pull too early at the recursive knot).
---
-defTyConName :: TyCon -> Name -> TyCon -> VM ()
-defTyConName tc nameOfTc' tc'
- = do { traceVt "add global tycon mapping:" (ppr tc <+> text "-->" <+> ppr nameOfTc')
-
- -- check for duplicate vectorisation
- ; currentDef <- readGEnv $ \env -> lookupNameEnv (global_tycons env) (tyConName tc)
- ; case currentDef of
- Just old_tc' ->
- do dflags <- getDynFlags
- cantVectorise dflags "Type constructor or class is already vectorised:" $
- ppr tc <+> moduleOf tc old_tc'
- Nothing -> return ()
-
- ; updGEnv $ \env ->
- env { global_tycons = extendNameEnv (global_tycons env) (tyConName tc) tc' }
- }
- where
- moduleOf tc tc' | tc == tc'
- = text "vectorises to itself"
- | Just mod <- nameModule_maybe (tyConName tc')
- = text "in module" <+> ppr mod
- | otherwise
- = text "in the current module"
-
--- |Add a mapping between plain and vectorised `TyCon`s to the global environment.
---
-defTyCon :: TyCon -> TyCon -> VM ()
-defTyCon tc tc' = defTyConName tc (tyConName tc') tc'
-
--- |Get the set of all vectorised type constructors.
---
-globalVectTyCons :: VM (NameEnv TyCon)
-globalVectTyCons = readGEnv global_tycons
-
-
--- DataCons -------------------------------------------------------------------
-
--- |Lookup the vectorised version of a `DataCon` from the global environment.
---
-lookupDataCon :: DataCon -> VM (Maybe DataCon)
-lookupDataCon dc
- | isTupleTyCon (dataConTyCon dc)
- = return (Just dc)
- | otherwise
- = readGEnv $ \env -> lookupNameEnv (global_datacons env) (dataConName dc)
-
--- |Add the mapping between plain and vectorised `DataCon`s to the global environment.
---
-defDataCon :: DataCon -> DataCon -> VM ()
-defDataCon dc dc' = updGEnv $ \env ->
- env { global_datacons = extendNameEnv (global_datacons env) (dataConName dc) dc' }
-
-
--- 'PA' dictionaries ------------------------------------------------------------
-
--- |Lookup the 'PA' dfun of a vectorised type constructor in the global environment.
---
-lookupTyConPA :: TyCon -> VM (Maybe Var)
-lookupTyConPA tc
- = readGEnv $ \env -> lookupNameEnv (global_pa_funs env) (tyConName tc)
-
--- |Associate vectorised type constructors with the dfun of their 'PA' instances in the global
--- environment.
---
-defTyConPAs :: [(TyCon, Var)] -> VM ()
-defTyConPAs ps = updGEnv $ \env ->
- env { global_pa_funs = extendNameEnvList (global_pa_funs env)
- [(tyConName tc, pa) | (tc, pa) <- ps] }
-
-
--- PR Dictionaries ------------------------------------------------------------
-
-lookupTyConPR :: TyCon -> VM (Maybe Var)
-lookupTyConPR tc = readGEnv $ \env -> lookupNameEnv (global_pr_funs env) (tyConName tc)
diff --git a/compiler/vectorise/Vectorise/Monad/InstEnv.hs b/compiler/vectorise/Vectorise/Monad/InstEnv.hs
deleted file mode 100644
index 68d70a46b6..0000000000
--- a/compiler/vectorise/Vectorise/Monad/InstEnv.hs
+++ /dev/null
@@ -1,82 +0,0 @@
-{-# LANGUAGE CPP #-}
-
-module Vectorise.Monad.InstEnv
- ( existsInst
- , lookupInst
- , lookupFamInst
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Monad.Global
-import Vectorise.Monad.Base
-import Vectorise.Env
-
-import DynFlags
-import FamInstEnv
-import InstEnv
-import Class
-import Type
-import TyCon
-import Outputable
-import Util
-
-
-#include "HsVersions.h"
-
-
--- Check whether a unique class instance for a given class and type arguments exists.
---
-existsInst :: Class -> [Type] -> VM Bool
-existsInst cls tys
- = do { instEnv <- readGEnv global_inst_env
- ; return $ either (const False) (const True) (lookupUniqueInstEnv instEnv cls tys)
- }
-
--- Look up the dfun of a class instance.
---
--- The match must be unique —i.e., match exactly one instance— but the
--- type arguments used for matching may be more specific than those of
--- the class instance declaration. The found class instances must not have
--- any type variables in the instance context that do not appear in the
--- instances head (i.e., no flexi vars); for details for what this means,
--- see the docs at InstEnv.lookupInstEnv.
---
-lookupInst :: Class -> [Type] -> VM (DFunId, [Type])
-lookupInst cls tys
- = do { instEnv <- readGEnv global_inst_env
- ; case lookupUniqueInstEnv instEnv cls tys of
- Right (inst, inst_tys) -> return (instanceDFunId inst, inst_tys)
- Left err ->
- do dflags <- getDynFlags
- cantVectorise dflags "Vectorise.Monad.InstEnv.lookupInst:" err
- }
-
--- Look up a family instance.
---
--- The match must be unique - ie, match exactly one instance - but the
--- type arguments used for matching may be more specific than those of
--- the family instance declaration.
---
--- Return the family instance and its type instance. For example, if we have
---
--- lookupFamInst 'T' '[Int]' yields (':R42T', 'Int')
---
--- then we have a coercion (ie, type instance of family instance coercion)
---
--- :Co:R42T Int :: T [Int] ~ :R42T Int
---
--- which implies that :R42T was declared as 'data instance T [a]'.
---
-lookupFamInst :: TyCon -> [Type] -> VM FamInstMatch
-lookupFamInst tycon tys
- = ASSERT( isOpenFamilyTyCon tycon )
- do { instEnv <- readGEnv global_fam_inst_env
- ; case lookupFamInstEnv instEnv tycon tys of
- [match] -> return match
- _other ->
- do dflags <- getDynFlags
- cantVectorise dflags "Vectorise.Monad.InstEnv.lookupFamInst: not found: "
- (ppr $ mkTyConApp tycon tys)
- }
diff --git a/compiler/vectorise/Vectorise/Monad/Local.hs b/compiler/vectorise/Vectorise/Monad/Local.hs
deleted file mode 100644
index 1f0da7ebd2..0000000000
--- a/compiler/vectorise/Vectorise/Monad/Local.hs
+++ /dev/null
@@ -1,102 +0,0 @@
-module Vectorise.Monad.Local
- ( readLEnv
- , setLEnv
- , updLEnv
- , localV
- , closedV
- , getBindName
- , inBind
- , lookupTyVarPA
- , defLocalTyVar
- , defLocalTyVarWithPA
- , localTyVars
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Monad.Base
-import Vectorise.Env
-
-import CoreSyn
-import Name
-import VarEnv
-import Var
-import FastString
-
--- Local Environment ----------------------------------------------------------
-
--- |Project something from the local environment.
---
-readLEnv :: (LocalEnv -> a) -> VM a
-readLEnv f = VM $ \_ genv lenv -> return (Yes genv lenv (f lenv))
-
--- |Set the local environment.
---
-setLEnv :: LocalEnv -> VM ()
-setLEnv lenv = VM $ \_ genv _ -> return (Yes genv lenv ())
-
--- |Update the environment using the provided function.
---
-updLEnv :: (LocalEnv -> LocalEnv) -> VM ()
-updLEnv f = VM $ \_ genv lenv -> return (Yes genv (f lenv) ())
-
--- |Perform a computation in its own local environment.
--- This does not alter the environment of the current state.
---
-localV :: VM a -> VM a
-localV p
- = do
- { env <- readLEnv id
- ; x <- p
- ; setLEnv env
- ; return x
- }
-
--- |Perform a computation in an empty local environment.
---
-closedV :: VM a -> VM a
-closedV p
- = do
- { env <- readLEnv id
- ; setLEnv (emptyLocalEnv { local_bind_name = local_bind_name env })
- ; x <- p
- ; setLEnv env
- ; return x
- }
-
--- |Get the name of the local binding currently being vectorised.
---
-getBindName :: VM FastString
-getBindName = readLEnv local_bind_name
-
--- |Run a vectorisation computation in a local environment,
--- with this id set as the current binding.
---
-inBind :: Id -> VM a -> VM a
-inBind id p
- = do updLEnv $ \env -> env { local_bind_name = occNameFS (getOccName id) }
- p
-
--- |Lookup a PA tyvars from the local environment.
-lookupTyVarPA :: Var -> VM (Maybe CoreExpr)
-lookupTyVarPA tv
- = readLEnv $ \env -> lookupVarEnv (local_tyvar_pa env) tv
-
--- |Add a tyvar to the local environment.
-defLocalTyVar :: TyVar -> VM ()
-defLocalTyVar tv = updLEnv $ \env ->
- env { local_tyvars = tv : local_tyvars env
- , local_tyvar_pa = local_tyvar_pa env `delVarEnv` tv
- }
-
--- |Add mapping between a tyvar and pa dictionary to the local environment.
-defLocalTyVarWithPA :: TyVar -> CoreExpr -> VM ()
-defLocalTyVarWithPA tv pa = updLEnv $ \env ->
- env { local_tyvars = tv : local_tyvars env
- , local_tyvar_pa = extendVarEnv (local_tyvar_pa env) tv pa
- }
-
--- |Get the set of tyvars from the local environment.
-localTyVars :: VM [TyVar]
-localTyVars = readLEnv (reverse . local_tyvars)
diff --git a/compiler/vectorise/Vectorise/Monad/Naming.hs b/compiler/vectorise/Vectorise/Monad/Naming.hs
deleted file mode 100644
index b1a8cb4092..0000000000
--- a/compiler/vectorise/Vectorise/Monad/Naming.hs
+++ /dev/null
@@ -1,132 +0,0 @@
--- |Computations in the vectorisation monad concerned with naming and fresh variable generation.
-
-module Vectorise.Monad.Naming
- ( mkLocalisedName
- , mkDerivedName
- , mkVectId
- , cloneVar
- , newExportedVar
- , newLocalVar
- , newLocalVars
- , newDummyVar
- , newTyVar
- , newCoVar
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Monad.Base
-
-import DsMonad
-import TcType
-import Type
-import Var
-import Module
-import Name
-import SrcLoc
-import MkId
-import Id
-import IdInfo( IdDetails(VanillaId) )
-import FastString
-
-import Control.Monad
-
-
--- Naming ---------------------------------------------------------------------
-
--- |Create a localised variant of a name, using the provided function to transform its `OccName`.
---
--- If the name external, encode the original name's module into the new 'OccName'. The result is
--- always an internal system name.
---
-mkLocalisedName :: (Maybe String -> OccName -> OccName) -> Name -> VM Name
-mkLocalisedName mk_occ name
- = do { mod <- liftDs getModule
- ; u <- liftDs newUnique
- ; let occ_name = mkLocalisedOccName mod mk_occ name
-
- new_name | isExternalName name = mkExternalName u mod occ_name (nameSrcSpan name)
- | otherwise = mkSystemName u occ_name
-
- ; return new_name }
-
-mkDerivedName :: (OccName -> OccName) -> Name -> VM Name
--- Similar to mkLocalisedName, but assumes the
--- incoming name is from this module.
--- Works on External names only
-mkDerivedName mk_occ name
- = do { u <- liftDs newUnique
- ; return (mkExternalName u (nameModule name)
- (mk_occ (nameOccName name))
- (nameSrcSpan name)) }
-
--- |Produce the vectorised variant of an `Id` with the given vectorised type, while taking care that
--- vectorised dfun ids must be dfuns again.
---
--- Force the new name to be a system name and, if the original was an external name, disambiguate
--- the new name with the module name of the original.
---
-mkVectId :: Id -> Type -> VM Id
-mkVectId id ty
- = do { name <- mkLocalisedName mkVectOcc (getName id)
- ; let id' | isDFunId id = MkId.mkDictFunId name tvs theta cls tys
- | isExportedId id = Id.mkExportedLocalId VanillaId name ty
- | otherwise = Id.mkLocalIdOrCoVar name ty
- ; return id'
- }
- where
- -- Decompose a dictionary function signature: \forall tvs. theta -> cls tys
- -- NB: We do *not* use closures '(:->)' for vectorised predicate abstraction as dictionary
- -- functions are always fully applied.
- (tvs, theta, pty) = tcSplitSigmaTy ty
- (cls, tys) = tcSplitDFunHead pty
-
--- |Make a fresh instance of this var, with a new unique.
---
-cloneVar :: Var -> VM Var
-cloneVar var = liftM (setIdUnique var) (liftDs newUnique)
-
--- |Make a fresh exported variable with the given type.
---
-newExportedVar :: OccName -> Type -> VM Var
-newExportedVar occ_name ty
- = do mod <- liftDs getModule
- u <- liftDs newUnique
-
- let name = mkExternalName u mod occ_name noSrcSpan
-
- return $ Id.mkExportedLocalId VanillaId name ty
-
--- |Make a fresh local variable with the given type.
--- The variable's name is formed using the given string as the prefix.
---
-newLocalVar :: FastString -> Type -> VM Var
-newLocalVar fs ty
- = do u <- liftDs newUnique
- return $ mkSysLocalOrCoVar fs u ty
-
--- |Make several fresh local variables with the given types.
--- The variable's names are formed using the given string as the prefix.
---
-newLocalVars :: FastString -> [Type] -> VM [Var]
-newLocalVars fs = mapM (newLocalVar fs)
-
--- |Make a new local dummy variable.
---
-newDummyVar :: Type -> VM Var
-newDummyVar = newLocalVar (fsLit "vv")
-
--- |Make a fresh type variable with the given kind.
--- The variable's name is formed using the given string as the prefix.
---
-newTyVar :: FastString -> Kind -> VM Var
-newTyVar fs k
- = do u <- liftDs newUnique
- return $ mkTyVar (mkSysTvName u fs) k
-
--- |Make a fresh coercion variable with the given kind.
-newCoVar :: FastString -> Kind -> VM Var
-newCoVar fs k
- = do u <- liftDs newUnique
- return $ mkCoVar (mkSystemVarName u fs) k
diff --git a/compiler/vectorise/Vectorise/Type/Classify.hs b/compiler/vectorise/Vectorise/Type/Classify.hs
deleted file mode 100644
index 5532c40ee1..0000000000
--- a/compiler/vectorise/Vectorise/Type/Classify.hs
+++ /dev/null
@@ -1,131 +0,0 @@
--- Extract from a list of type constructors those (1) which need to be vectorised and (2) those
--- that could be, but need not be vectorised (as a scalar representation is sufficient and more
--- efficient). The type constructors that cannot be vectorised will be dropped.
---
--- A type constructor will only be vectorised if it is
---
--- (1) a data type constructor, with vanilla data constructors (i.e., data constructors admitted by
--- Haskell 98) and
--- (2) at least one of the type constructors that appears in its definition is also vectorised.
---
--- If (1) is met, but not (2), the type constructor may appear in vectorised code, but there is no
--- need to vectorise that type constructor itself. This holds, for example, for all enumeration
--- types. As '([::])' is being vectorised, any type constructor whose definition involves
--- '([::])', either directly or indirectly, will be vectorised.
-
-module Vectorise.Type.Classify
- ( classifyTyCons
- )
-where
-
-import GhcPrelude
-
-import NameSet
-import UniqSet
-import UniqFM
-import DataCon
-import TyCon
-import TyCoRep
-import qualified Type
-import PrelNames
-import Digraph
-
--- |From a list of type constructors, extract those that can be vectorised, returning them in two
--- sets, where the first result list /must be/ vectorised and the second result list /need not be/
--- vectorised. The third result list are those type constructors that we cannot convert (either
--- because they use language extensions or because they dependent on type constructors for which
--- no vectorised version is available).
---
--- NB: In order to be able to vectorise a type constructor, we require members of the depending set
--- (i.e., those type constructors that the current one depends on) to be vectorised only if they
--- are also parallel (i.e., appear in the second argument to the function).
---
--- The first argument determines the /conversion status/ of external type constructors as follows:
---
--- * tycons which have converted versions are mapped to 'True'
--- * tycons which are not changed by vectorisation are mapped to 'False'
--- * tycons which haven't been converted (because they can't or weren't vectorised) are not
--- elements of the map
---
-classifyTyCons :: UniqFM Bool -- ^type constructor vectorisation status
- -> NameSet -- ^tycons involving parallel arrays
- -> [TyCon] -- ^type constructors that need to be classified
- -> ( [TyCon] -- to be converted
- , [TyCon] -- need not be converted (but could be)
- , [TyCon] -- involve parallel arrays (whether converted or not)
- , [TyCon] -- can't be converted
- )
-classifyTyCons convStatus parTyCons tcs = classify [] [] [] [] convStatus parTyCons (tyConGroups tcs)
- where
- classify conv keep par novect _ _ [] = (conv, keep, par, novect)
- classify conv keep par novect cs pts ((tcs, ds) : rs)
- | can_convert && must_convert
- = classify (tcs ++ conv) keep (par ++ tcs_par) novect (cs `addListToUFM` [(tc, True) | tc <- tcs]) pts' rs
- | can_convert
- = classify conv (tcs ++ keep) (par ++ tcs_par) novect (cs `addListToUFM` [(tc, False) | tc <- tcs]) pts' rs
- | otherwise
- = classify conv keep (par ++ tcs_par) (tcs ++ novect) cs pts' rs
- where
- refs = ds `delListFromUniqSet` tcs
-
- -- the tycons that directly or indirectly depend on parallel arrays
- tcs_par | uniqSetAny ((`elemNameSet` parTyCons) . tyConName) refs = tcs
- | otherwise = []
-
- pts' = pts `extendNameSetList` map tyConName tcs_par
-
- can_convert = (isEmptyUniqSet (filterUniqSet ((`elemNameSet` pts) . tyConName) (refs `uniqSetMinusUFM` cs))
- && all convertable tcs)
- || isShowClass tcs
- must_convert = anyUFM id (intersectUFM_C const cs (getUniqSet refs))
- && (not . isShowClass $ tcs)
-
- -- We currently admit Haskell 2011-style data and newtype declarations as well as type
- -- constructors representing classes.
- convertable tc
- = (isDataTyCon tc || isNewTyCon tc) && all isVanillaDataCon (tyConDataCons tc)
- || isClassTyCon tc
-
- -- !!!FIXME: currently we allow 'Show' in vectorised code without actually providing a
- -- vectorised definition (to be able to vectorise 'Num')
- isShowClass [tc] = tyConName tc == showClassName
- isShowClass _ = False
-
--- Used to group type constructors into mutually dependent groups.
---
-type TyConGroup = ([TyCon], UniqSet TyCon)
-
--- Compute mutually recursive groups of tycons in topological order.
---
-tyConGroups :: [TyCon] -> [TyConGroup]
-tyConGroups tcs = map mk_grp (stronglyConnCompFromEdgedVerticesUniq edges)
- where
- edges :: [ Node TyCon (TyCon, UniqSet TyCon) ]
- edges = [DigraphNode (tc, ds) tc (nonDetEltsUniqSet ds) | tc <- tcs
- , let ds = tyConsOfTyCon tc]
- -- It's OK to use nonDetEltsUniqSet here as
- -- stronglyConnCompFromEdgedVertices is still deterministic even
- -- if the edges are in nondeterministic order as explained in
- -- Note [Deterministic SCC] in Digraph.
-
- mk_grp (AcyclicSCC (tc, ds)) = ([tc], ds)
- mk_grp (CyclicSCC els) = (tcs, unionManyUniqSets dss)
- where
- (tcs, dss) = unzip els
-
--- |Collect the set of TyCons used by the representation of some data type.
---
-tyConsOfTyCon :: TyCon -> UniqSet TyCon
-tyConsOfTyCon = tyConsOfTypes . concatMap dataConRepArgTys . tyConDataCons
-
--- |Collect the set of TyCons that occur in these types.
---
-tyConsOfTypes :: [Type] -> UniqSet TyCon
-tyConsOfTypes = unionManyUniqSets . map tyConsOfType
-
--- |Collect the set of TyCons that occur in this type.
---
-tyConsOfType :: Type -> UniqSet TyCon
-tyConsOfType ty = filterUniqSet not_tuple_or_unlifted $ Type.tyConsOfType ty
- where not_tuple_or_unlifted tc = not (isUnliftedTyCon tc || isTupleTyCon tc)
-
diff --git a/compiler/vectorise/Vectorise/Type/Env.hs b/compiler/vectorise/Vectorise/Type/Env.hs
deleted file mode 100644
index a70e166aa2..0000000000
--- a/compiler/vectorise/Vectorise/Type/Env.hs
+++ /dev/null
@@ -1,457 +0,0 @@
-{-# LANGUAGE CPP #-}
-
--- Vectorise a modules type and class declarations.
---
--- This produces new type constructors and family instances top be included in the module toplevel
--- as well as bindings for worker functions, dfuns, and the like.
-
-module Vectorise.Type.Env (
- vectTypeEnv,
-) where
-
-#include "HsVersions.h"
-
-import GhcPrelude
-
-import Vectorise.Env
-import Vectorise.Vect
-import Vectorise.Monad
-import Vectorise.Builtins
-import Vectorise.Type.TyConDecl
-import Vectorise.Type.Classify
-import Vectorise.Generic.PADict
-import Vectorise.Generic.PAMethods
-import Vectorise.Generic.PData
-import Vectorise.Generic.Description
-import Vectorise.Utils
-
-import CoreSyn
-import CoreUtils
-import CoreUnfold
-import DataCon
-import TyCon
-import CoAxiom
-import Type
-import FamInstEnv
-import Id
-import MkId
-import NameEnv
-import NameSet
-import UniqFM
-import OccName
-import Unique
-
-import Util
-import Outputable
-import DynFlags
-import FastString
-import MonadUtils
-
-import Control.Monad
-import Data.Maybe
-import Data.List
-
-
--- Note [Pragmas to vectorise tycons]
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
--- All imported type constructors that are not mapped to a vectorised type in the vectorisation map
--- (possibly because the defining module was not compiled with vectorisation) may be used in scalar
--- code encapsulated in vectorised code. If a such a type constructor 'T' is a member of the
--- 'Scalar' class (and hence also of 'PData' and 'PRepr'), it may also be used in vectorised code,
--- where 'T' represents itself, but the representation of 'T' still remains opaque in vectorised
--- code (i.e., it can only be used in scalar code).
---
--- An example is the treatment of 'Int'. 'Int's can be used in vectorised code and remain unchanged
--- by vectorisation. However, the representation of 'Int' by the 'I#' data constructor wrapping an
--- 'Int#' is not exposed in vectorised code. Instead, computations involving the representation need
--- to be confined to scalar code.
---
--- VECTORISE pragmas for type constructors cover four different flavours of vectorising data type
--- constructors:
---
--- (1) Data type constructor 'T' that together with its constructors 'Cn' may be used in vectorised
--- code, where 'T' and the 'Cn' are automatically vectorised in the same manner as data types
--- declared in a vectorised module. This includes the case where the vectoriser determines that
--- the original representation of 'T' may be used in vectorised code (as it does not embed any
--- parallel arrays.) This case is for type constructors that are *imported* from a non-
--- vectorised module, but that we want to use with full vectorisation support.
---
--- An example is the treatment of 'Ordering' and '[]'. The former remains unchanged by
--- vectorisation, whereas the latter is fully vectorised.
---
--- 'PData' and 'PRepr' instances are automatically generated by the vectoriser.
---
--- Type constructors declared with {-# VECTORISE type T #-} are treated in this manner.
---
--- (2) Data type constructor 'T' that may be used in vectorised code, where 'T' is represented by an
--- explicitly given 'Tv', but the representation of 'T' is opaque in vectorised code (i.e., the
--- constructors of 'T' may not occur in vectorised code).
---
--- An example is the treatment of '[::]'. The type '[::]' can be used in vectorised code and is
--- vectorised to 'PArray'. However, the representation of '[::]' is not exposed in vectorised
--- code. Instead, computations involving the representation need to be confined to scalar code.
---
--- 'PData' and 'PRepr' instances need to be explicitly supplied for 'T' (they are not generated
--- by the vectoriser).
---
--- Type constructors declared with {-# VECTORISE type T = Tv #-} are treated in this manner
--- manner. (The vectoriser never treats a type constructor automatically in this manner.)
---
--- (3) Data type constructor 'T' that does not contain any parallel arrays and has explicitly
--- provided 'PData' and 'PRepr' instances (and maybe also a 'Scalar' instance), which together
--- with the type's constructors 'Cn' may be used in vectorised code. The type 'T' and its
--- constructors 'Cn' are represented by themselves in vectorised code.
---
--- An example is 'Bool', which is represented by itself in vectorised code (as it cannot embed
--- any parallel arrays). However, we do not want any automatic generation of class and family
--- instances, which is why Case (1) does not apply.
---
--- 'PData' and 'PRepr' instances need to be explicitly supplied for 'T' (they are not generated
--- by the vectoriser).
---
--- Type constructors declared with {-# VECTORISE SCALAR type T #-} are treated in this manner.
---
--- (4) Data type constructor 'T' that does not contain any parallel arrays and that, in vectorised
--- code, is represented by an explicitly given 'Tv', but the representation of 'T' is opaque in
--- vectorised code and 'T' is regarded to be scalar — i.e., it may be used in encapsulated
--- scalar subcomputations.
---
--- An example is the treatment of '(->)'. Types '(->)' can be used in vectorised code and are
--- vectorised to '(:->)'. However, the representation of '(->)' is not exposed in vectorised
--- code. Instead, computations involving the representation need to be confined to scalar code
--- and may be part of encapsulated scalar computations.
---
--- 'PData' and 'PRepr' instances need to be explicitly supplied for 'T' (they are not generated
--- by the vectoriser).
---
--- Type constructors declared with {-# VECTORISE SCALAR type T = Tv #-} are treated in this
--- manner. (The vectoriser never treats a type constructor automatically in this manner.)
---
--- In addition, we have also got a single pragma form for type classes: {-# VECTORISE class C #-}.
--- It implies that the class type constructor may be used in vectorised code together with its data
--- constructor. We generally produce a vectorised version of the data type and data constructor.
--- We do not generate 'PData' and 'PRepr' instances for class type constructors. This pragma is the
--- default for all type classes declared in a vectorised module, but the pragma can also be used
--- explitly on imported classes.
-
--- Note [Vectorising classes]
--- ~~~~~~~~~~~~~~~~~~~~~~~~~~
---
--- We vectorise classes essentially by just vectorising their desugared Core representation, but we
--- do generate a 'Class' structure along the way (see 'Vectorise.Type.TyConDecl.vectTyConDecl').
---
--- Here is an example illustrating the mapping — assume
---
--- class Num a where
--- (+) :: a -> a -> a
---
--- It desugars to
---
--- data Num a = D:Num { (+) :: a -> a -> a }
---
--- which we vectorise to
---
--- data V:Num a = D:V:Num { ($v+) :: PArray a :-> PArray a :-> PArray a }
---
--- while adding the following entries to the vectorisation map:
---
--- tycon : Num --> V:Num
--- datacon: D:Num --> D:V:Num
--- var : (+) --> ($v+)
-
--- |Vectorise type constructor including class type constructors.
---
-vectTypeEnv :: [TyCon] -- Type constructors defined in this module
- -> [CoreVect] -- All 'VECTORISE [SCALAR] type' declarations in this module
- -> [CoreVect] -- All 'VECTORISE class' declarations in this module
- -> VM ( [TyCon] -- old TyCons ++ new TyCons
- , [FamInst] -- New type family instances.
- , [(Var, CoreExpr)]) -- New top level bindings.
-vectTypeEnv tycons vectTypeDecls vectClassDecls
- = do { traceVt "** vectTypeEnv" $ ppr tycons
-
- ; let -- {-# VECTORISE type T -#} (ONLY the imported tycons)
- impVectTyCons = ( [tycon | VectType False tycon Nothing <- vectTypeDecls]
- ++ [tycon | VectClass tycon <- vectClassDecls])
- \\ tycons
-
- -- {-# VECTORISE type T = Tv -#} (imported & local tycons with an /RHS/)
- vectTyConsWithRHS = [ (tycon, rhs)
- | VectType False tycon (Just rhs) <- vectTypeDecls]
-
- -- {-# VECTORISE SCALAR type T = Tv -#} (imported & local tycons with an /RHS/)
- scalarTyConsWithRHS = [ (tycon, rhs)
- | VectType True tycon (Just rhs) <- vectTypeDecls]
-
- -- {-# VECTORISE SCALAR type T -#} (imported & local /scalar/ tycons without an RHS)
- scalarTyConsNoRHS = [tycon | VectType True tycon Nothing <- vectTypeDecls]
-
- -- Check that is not a VECTORISE SCALAR tycon nor VECTORISE tycons with explicit rhs?
- vectSpecialTyConNames = mkNameSet . map tyConName $
- scalarTyConsNoRHS ++
- map fst (vectTyConsWithRHS ++ scalarTyConsWithRHS)
- notVectSpecialTyCon tc = not $ (tyConName tc) `elemNameSet` vectSpecialTyConNames
-
- -- Build a map containing all vectorised type constructor. If the vectorised type
- -- constructor differs from the original one, then it is mapped to 'True'; if they are
- -- both the same, then it maps to 'False'.
- ; vectTyCons <- globalVectTyCons
- ; let vectTyConBase = mapUFM_Directly isDistinct vectTyCons -- 'True' iff tc /= V[[tc]]
- isDistinct u tc = u /= getUnique tc
- vectTyConFlavour = vectTyConBase
- `plusNameEnv`
- mkNameEnv [ (tyConName tycon, True)
- | (tycon, _) <- vectTyConsWithRHS ++ scalarTyConsWithRHS]
- `plusNameEnv`
- mkNameEnv [ (tyConName tycon, False) -- original representation
- | tycon <- scalarTyConsNoRHS]
-
-
- -- Split the list of 'TyCons' into the ones (1) that we must vectorise and those (2)
- -- that we could, but don't need to vectorise. Type constructors that are not data
- -- type constructors or use non-Haskell98 features are being dropped. They may not
- -- appear in vectorised code. (We also drop the local type constructors appearing in a
- -- VECTORISE SCALAR pragma or a VECTORISE pragma with an explicit right-hand side, as
- -- these are being handled separately. NB: Some type constructors may be marked SCALAR
- -- /and/ have an explicit right-hand side.)
- --
- -- Furthermore, 'par_tcs' are those type constructors (converted or not) whose
- -- definition, directly or indirectly, depends on parallel arrays. Finally, 'drop_tcs'
- -- are all type constructors that cannot be vectorised.
- ; parallelTyCons <- (`extendNameSetList` map (tyConName . fst) vectTyConsWithRHS) <$>
- globalParallelTyCons
- ; let maybeVectoriseTyCons = filter notVectSpecialTyCon tycons ++ impVectTyCons
- (conv_tcs, keep_tcs, par_tcs, drop_tcs)
- = classifyTyCons vectTyConFlavour parallelTyCons maybeVectoriseTyCons
-
- ; traceVt " known parallel : " $ ppr parallelTyCons
- ; traceVt " VECT SCALAR : " $ ppr (scalarTyConsNoRHS ++ map fst scalarTyConsWithRHS)
- ; traceVt " VECT [class] : " $ ppr impVectTyCons
- ; traceVt " VECT with rhs : " $ ppr (map fst (vectTyConsWithRHS ++ scalarTyConsWithRHS))
- ; traceVt " -- after classification (local and VECT [class] tycons) --" Outputable.empty
- ; traceVt " reuse : " $ ppr keep_tcs
- ; traceVt " convert : " $ ppr conv_tcs
-
- -- warn the user about unvectorised type constructors
- ; let explanation = text "(They use unsupported language extensions"
- $$ text "or depend on type constructors that are" <+>
- text "not vectorised)"
- drop_tcs_nosyn = filter (not . isTypeFamilyTyCon) .
- filter (not . isTypeSynonymTyCon) $ drop_tcs
- ; unless (null drop_tcs_nosyn) $
- emitVt "Warning: cannot vectorise these type constructors:" $
- pprQuotedList drop_tcs_nosyn $$ explanation
-
- ; mapM_ addParallelTyConAndCons $ par_tcs ++ map fst vectTyConsWithRHS
-
- ; let mapping =
- -- Type constructors that we found we don't need to vectorise and those
- -- declared VECTORISE SCALAR /without/ an explicit right-hand side, use the same
- -- representation in both unvectorised and vectorised code; they are not
- -- abstract.
- [(tycon, tycon, False) | tycon <- keep_tcs ++ scalarTyConsNoRHS]
- -- We do the same for type constructors declared VECTORISE SCALAR /without/
- -- an explicit right-hand side
- ++ [(tycon, vTycon, True) | (tycon, vTycon) <- vectTyConsWithRHS ++ scalarTyConsWithRHS]
- ; syn_tcs <- catMaybes <$> mapM defTyConDataCons mapping
-
- -- Vectorise all the data type declarations that we can and must vectorise (enter the
- -- type and data constructors into the vectorisation map on-the-fly.)
- ; new_tcs <- vectTyConDecls conv_tcs
-
- ; let dumpTc tc vTc = traceVt "---" (ppr tc <+> text "::" <+> ppr (dataConSig tc) $$
- ppr vTc <+> text "::" <+> ppr (dataConSig vTc))
- dataConSig tc | Just dc <- tyConSingleDataCon_maybe tc = dataConRepType dc
- | otherwise = panic "dataConSig"
- ; zipWithM_ dumpTc (filter isClassTyCon conv_tcs) (filter isClassTyCon new_tcs)
-
- -- We don't need new representation types for dictionary constructors. The constructors
- -- are always fully applied, and we don't need to lift them to arrays as a dictionary
- -- of a particular type always has the same value.
- ; let orig_tcs = filter (not . isClassTyCon) $ keep_tcs ++ conv_tcs
- vect_tcs = filter (not . isClassTyCon) $ keep_tcs ++ new_tcs
-
- -- Build 'PRepr' and 'PData' instance type constructors and family instances for all
- -- type constructors with vectorised representations.
- ; reprs <- mapM tyConRepr vect_tcs
- ; repr_fis <- zipWith3M buildPReprTyCon orig_tcs vect_tcs reprs
- ; pdata_fis <- zipWith3M buildPDataTyCon orig_tcs vect_tcs reprs
- ; pdatas_fis <- zipWith3M buildPDatasTyCon orig_tcs vect_tcs reprs
-
- ; let fam_insts = repr_fis ++ pdata_fis ++ pdatas_fis
- repr_axs = map famInstAxiom repr_fis
- pdata_tcs = famInstsRepTyCons pdata_fis
- pdatas_tcs = famInstsRepTyCons pdatas_fis
-
- ; updGEnv $ extendFamEnv fam_insts
-
- -- Generate workers for the vectorised data constructors, dfuns for the 'PA' instances of
- -- the vectorised type constructors, and associate the type constructors with their dfuns
- -- in the global environment. We get back the dfun bindings (which we will subsequently
- -- inject into the modules toplevel).
- ; (_, binds) <- fixV $ \ ~(dfuns, _) ->
- do { defTyConPAs (zipLazy vect_tcs dfuns)
-
- -- Query the 'PData' instance type constructors for type constructors that have a
- -- VECTORISE SCALAR type pragma without an explicit right-hand side (this is Item
- -- (3) of "Note [Pragmas to vectorise tycons]" above).
- ; pdata_scalar_tcs <- mapM pdataReprTyConExact scalarTyConsNoRHS
-
- -- Build workers for all vectorised data constructors (except abstract ones)
- ; sequence_ $
- zipWith3 vectDataConWorkers (orig_tcs ++ scalarTyConsNoRHS)
- (vect_tcs ++ scalarTyConsNoRHS)
- (pdata_tcs ++ pdata_scalar_tcs)
-
- -- Build a 'PA' dictionary for all type constructors (except abstract ones & those
- -- defined with an explicit right-hand side where the dictionary is user-supplied)
- ; dfuns <- sequence $
- zipWith4 buildTyConPADict
- vect_tcs
- repr_axs
- pdata_tcs
- pdatas_tcs
-
- ; binds <- takeHoisted
- ; return (dfuns, binds)
- }
-
- -- Return the vectorised variants of type constructors as well as the generated instance
- -- type constructors, family instances, and dfun bindings.
- ; return ( new_tcs ++ pdata_tcs ++ pdatas_tcs ++ syn_tcs
- , fam_insts, binds)
- }
- where
- addParallelTyConAndCons tycon
- = do
- { addGlobalParallelTyCon tycon
- ; mapM_ addGlobalParallelVar [ id | dc <- tyConDataCons tycon
- , AnId id <- dataConImplicitTyThings dc ]
- -- Ignoring the promoted tycon; hope that's ok
- }
-
- -- Add a mapping from the original to vectorised type constructor to the vectorisation map.
- -- Unless the type constructor is abstract, also mappings from the original's data constructors
- -- to the vectorised type's data constructors.
- --
- -- We have three cases: (1) original and vectorised type constructor are the same, (2) the
- -- name of the vectorised type constructor is canonical (as prescribed by 'mkVectTyConOcc'), or
- -- (3) the name is not canonical. In the third case, we additionally introduce a type synonym
- -- with the canonical name that is set equal to the non-canonical name (so that we find the
- -- right type constructor when reading vectorisation information from interface files).
- --
- defTyConDataCons (origTyCon, vectTyCon, isAbstract)
- = do
- { canonName <- mkLocalisedName mkVectTyConOcc origName
- ; if origName == vectName -- Case (1)
- || vectName == canonName -- Case (2)
- then do
- { defTyCon origTyCon vectTyCon -- T --> vT
- ; defDataCons -- Ci --> vCi
- ; return Nothing
- }
- else do -- Case (3)
- { let synTyCon = mkSyn canonName (mkTyConTy vectTyCon) -- type S = vT
- ; defTyCon origTyCon synTyCon -- T --> S
- ; defDataCons -- Ci --> vCi
- ; return $ Just synTyCon
- }
- }
- where
- origName = tyConName origTyCon
- vectName = tyConName vectTyCon
-
- mkSyn canonName ty = buildSynTyCon canonName [] (typeKind ty) [] ty
-
- defDataCons
- | isAbstract = return ()
- | otherwise
- = do { MASSERT(tyConDataCons origTyCon `equalLength` tyConDataCons vectTyCon)
- ; zipWithM_ defDataCon (tyConDataCons origTyCon) (tyConDataCons vectTyCon)
- }
-
-
--- Helpers --------------------------------------------------------------------
-
-buildTyConPADict :: TyCon -> CoAxiom Unbranched -> TyCon -> TyCon -> VM Var
-buildTyConPADict vect_tc prepr_ax pdata_tc pdatas_tc
- = tyConRepr vect_tc >>= buildPADict vect_tc prepr_ax pdata_tc pdatas_tc
-
--- Produce a custom-made worker for the data constructors of a vectorised data type. This includes
--- all data constructors that may be used in vectorised code — i.e., all data constructors of data
--- types with 'VECTORISE [SCALAR] type' pragmas with an explicit right-hand side. Also adds a mapping
--- from the original to vectorised worker into the vectorisation map.
---
--- FIXME: It's not nice that we need create a special worker after the data constructors has
--- already been constructed. Also, I don't think the worker is properly added to the data
--- constructor. Seems messy.
-vectDataConWorkers :: TyCon -> TyCon -> TyCon -> VM ()
-vectDataConWorkers orig_tc vect_tc arr_tc
- = do { traceVt "Building vectorised worker for datatype" (ppr orig_tc)
-
- ; bs <- sequence
- . zipWith3 def_worker (tyConDataCons orig_tc) rep_tys
- $ zipWith4 mk_data_con (tyConDataCons vect_tc)
- rep_tys
- (inits rep_tys)
- (tail $ tails rep_tys)
- ; mapM_ (uncurry hoistBinding) bs
- }
- where
- tyvars = tyConTyVars vect_tc
- var_tys = mkTyVarTys tyvars
- ty_args = map Type var_tys
- res_ty = mkTyConApp vect_tc var_tys
-
- cons = tyConDataCons vect_tc
- arity = length cons
- [arr_dc] = tyConDataCons arr_tc
-
- rep_tys = map dataConRepArgTys $ tyConDataCons vect_tc
-
- mk_data_con con tys pre post
- = do dflags <- getDynFlags
- liftM2 (,) (vect_data_con con)
- (lift_data_con tys pre post (mkDataConTag dflags con))
-
- sel_replicate len tag
- | arity > 1 = do
- rep <- builtin (selReplicate arity)
- return [rep `mkApps` [len, tag]]
-
- | otherwise = return []
-
- vect_data_con con = return $ mkConApp con ty_args
- lift_data_con tys pre_tys post_tys tag
- = do
- len <- builtin liftingContext
- args <- mapM (newLocalVar (fsLit "xs"))
- =<< mapM mkPDataType tys
-
- sel <- sel_replicate (Var len) tag
-
- pre <- mapM emptyPD (concat pre_tys)
- post <- mapM emptyPD (concat post_tys)
-
- return . mkLams (len : args)
- . wrapFamInstBody arr_tc var_tys
- . mkConApp arr_dc
- $ ty_args ++ sel ++ pre ++ map Var args ++ post
-
- def_worker data_con arg_tys mk_body
- = do
- arity <- polyArity tyvars
- body <- closedV
- . inBind orig_worker
- . polyAbstract tyvars $ \args ->
- liftM (mkLams (tyvars ++ args) . vectorised)
- $ buildClosures tyvars [] [] arg_tys res_ty mk_body
-
- raw_worker <- mkVectId orig_worker (exprType body)
- let vect_worker = raw_worker `setIdUnfolding`
- mkInlineUnfoldingWithArity arity body
- defGlobalVar orig_worker vect_worker
- return (vect_worker, body)
- where
- orig_worker = dataConWorkId data_con
diff --git a/compiler/vectorise/Vectorise/Type/TyConDecl.hs b/compiler/vectorise/Vectorise/Type/TyConDecl.hs
deleted file mode 100644
index 4f1831e399..0000000000
--- a/compiler/vectorise/Vectorise/Type/TyConDecl.hs
+++ /dev/null
@@ -1,223 +0,0 @@
-
-module Vectorise.Type.TyConDecl (
- vectTyConDecls
-) where
-
-import GhcPrelude
-
-import Vectorise.Type.Type
-import Vectorise.Monad
-import Vectorise.Env( GlobalEnv( global_fam_inst_env ) )
-import BuildTyCl( TcMethInfo, buildClass, buildDataCon, newTyConRepName )
-import OccName
-import Class
-import Type
-import TyCon
-import DataCon
-import DynFlags
-import BasicTypes( DefMethSpec(..) )
-import SrcLoc( SrcSpan, noSrcSpan )
-import Var
-import Name
-import Outputable
-import Util
-import Control.Monad
-
-
--- |Vectorise some (possibly recursively defined) type constructors.
---
-vectTyConDecls :: [TyCon] -> VM [TyCon]
-vectTyConDecls tcs = fixV $ \tcs' ->
- do { names' <- mapM (mkLocalisedName mkVectTyConOcc . tyConName) tcs
- ; mapM_ (uncurry (uncurry defTyConName)) (tcs `zip` names' `zipLazy` tcs')
- ; zipWithM vectTyConDecl tcs names'
- }
-
--- |Vectorise a single type constructor.
---
-vectTyConDecl :: TyCon -> Name -> VM TyCon
-vectTyConDecl tycon name'
-
- -- Type constructor representing a type class
- | Just cls <- tyConClass_maybe tycon
- = do { unless (null $ classATs cls) $
- do dflags <- getDynFlags
- cantVectorise dflags "Associated types are not yet supported" (ppr cls)
-
- -- vectorise superclass constraint (types)
- ; theta' <- mapM vectType (classSCTheta cls)
-
- -- vectorise method selectors
- ; let opItems = classOpItems cls
- Just datacon = tyConSingleDataCon_maybe tycon
- argTys = dataConRepArgTys datacon -- all selector types
- opTys = drop (length argTys - length opItems) argTys -- only method types
- ; methods' <- sequence [ vectMethod id meth ty | ((id, meth), ty) <- zip opItems opTys]
-
- -- construct the vectorised class (this also creates the class type constructors and its
- -- data constructor)
- --
- -- NB: 'buildClass' attaches new quantifiers and dictionaries to the method types
- ; cls' <- liftDs $
- buildClass
- name' -- new name: "V:Class"
- (tyConBinders tycon) -- keep original kind
- (map (const Nominal) (tyConRoles tycon)) -- all role are N for safety
- (snd . classTvsFds $ cls) -- keep the original functional dependencies
- (Just (
- theta', -- superclasses
- [], -- no associated types (for the moment)
- methods', -- method info
- (classMinimalDef cls))) -- Inherit minimal complete definition from cls
-
- -- the original dictionary constructor must map to the vectorised one
- ; let tycon' = classTyCon cls'
- Just datacon = tyConSingleDataCon_maybe tycon
- Just datacon' = tyConSingleDataCon_maybe tycon'
- ; defDataCon datacon datacon'
-
- -- the original superclass and methods selectors must map to the vectorised ones
- ; let selIds = classAllSelIds cls
- selIds' = classAllSelIds cls'
- ; zipWithM_ defGlobalVar selIds selIds'
-
- -- return the type constructor of the vectorised class
- ; return tycon'
- }
-
- -- Regular algebraic type constructor — for now, Haskell 2011-style only
- | isAlgTyCon tycon
- = do { unless (all isVanillaDataCon (tyConDataCons tycon)) $
- do dflags <- getDynFlags
- cantVectorise dflags "Currently only Haskell 2011 datatypes are supported" (ppr tycon)
-
- -- vectorise the data constructor of the class tycon
- ; rhs' <- vectAlgTyConRhs tycon (algTyConRhs tycon)
-
- -- keep the original GADT flags
- ; let gadt_flag = isGadtSyntaxTyCon tycon
-
- -- build the vectorised type constructor
- ; tc_rep_name <- mkDerivedName mkTyConRepOcc name'
- ; return $ mkAlgTyCon
- name' -- new name
- (tyConBinders tycon)
- (tyConResKind tycon) -- keep original kind
- (map (const Nominal) (tyConRoles tycon)) -- all roles are N for safety
- Nothing
- [] -- no stupid theta
- rhs' -- new constructor defs
- (VanillaAlgTyCon tc_rep_name)
- gadt_flag -- whether in GADT syntax
- }
-
- -- some other crazy thing that we don't handle
- | otherwise
- = do dflags <- getDynFlags
- cantVectorise dflags "Can't vectorise exotic type constructor" (ppr tycon)
-
--- |Vectorise a class method. (Don't enter it into the vectorisation map yet.)
---
-vectMethod :: Id -> DefMethInfo -> Type -> VM TcMethInfo
-vectMethod id defMeth ty
- = do { -- Vectorise the method type.
- ; ty' <- vectType ty
-
- -- Create a name for the vectorised method.
- ; id' <- mkVectId id ty'
-
- ; return (Var.varName id', ty', defMethSpecOfDefMeth defMeth)
- }
-
--- | Convert a `DefMethInfo` to a `DefMethSpec`, which discards the name field in
--- the `DefMeth` constructor of the `DefMeth`.
-defMethSpecOfDefMeth :: DefMethInfo -> Maybe (DefMethSpec (SrcSpan, Type))
-defMethSpecOfDefMeth Nothing = Nothing
-defMethSpecOfDefMeth (Just (_, VanillaDM)) = Just VanillaDM
-defMethSpecOfDefMeth (Just (_, GenericDM ty)) = Just (GenericDM (noSrcSpan, ty))
-
--- |Vectorise the RHS of an algebraic type.
---
-vectAlgTyConRhs :: TyCon -> AlgTyConRhs -> VM AlgTyConRhs
-vectAlgTyConRhs tc (AbstractTyCon {})
- = do dflags <- getDynFlags
- cantVectorise dflags "Can't vectorise imported abstract type" (ppr tc)
-vectAlgTyConRhs _tc (DataTyCon { data_cons = data_cons
- , data_cons_size = data_cons_size
- , is_enum = is_enum
- })
- = do { data_cons' <- mapM vectDataCon data_cons
- ; zipWithM_ defDataCon data_cons data_cons'
- ; return $ DataTyCon { data_cons = data_cons'
- , data_cons_size = data_cons_size
- , is_enum = is_enum
- }
- }
-
-vectAlgTyConRhs tc (TupleTyCon { data_con = con })
- = vectAlgTyConRhs tc (mkDataTyConRhs [con])
- -- I'm not certain this is what you want to do for tuples,
- -- but it's the behaviour we had before I refactored the
- -- representation of AlgTyConRhs to add tuples
-
-vectAlgTyConRhs tc (SumTyCon { data_cons = cons
- , data_cons_size = data_cons_size })
- = -- FIXME (osa): I'm pretty sure this is broken.. TupleTyCon case is probably
- -- also broken when the tuple is unboxed.
- vectAlgTyConRhs tc (DataTyCon { data_cons = cons
- , data_cons_size = data_cons_size
- , is_enum = all (((==) 0) . dataConRepArity) cons })
-
-vectAlgTyConRhs tc (NewTyCon {})
- = do dflags <- getDynFlags
- cantVectorise dflags noNewtypeErr (ppr tc)
- where
- noNewtypeErr = "Vectorisation of newtypes not supported yet; please use a 'data' declaration"
-
--- |Vectorise a data constructor by vectorising its argument and return types..
---
-vectDataCon :: DataCon -> VM DataCon
-vectDataCon dc
- | not . null $ ex_tvs
- = do dflags <- getDynFlags
- cantVectorise dflags "Can't vectorise constructor with existential type variables yet" (ppr dc)
- | not . null $ eq_spec
- = do dflags <- getDynFlags
- cantVectorise dflags "Can't vectorise constructor with equality context yet" (ppr dc)
- | not . null $ dataConFieldLabels dc
- = do dflags <- getDynFlags
- cantVectorise dflags "Can't vectorise constructor with labelled fields yet" (ppr dc)
- | not . null $ theta
- = do dflags <- getDynFlags
- cantVectorise dflags "Can't vectorise constructor with constraint context yet" (ppr dc)
- | otherwise
- = do { name' <- mkLocalisedName mkVectDataConOcc name
- ; tycon' <- vectTyCon tycon
- ; arg_tys <- mapM vectType rep_arg_tys
- ; let ret_ty = mkFamilyTyConApp tycon' (mkTyVarTys univ_tvs)
- ; fam_envs <- readGEnv global_fam_inst_env
- ; rep_nm <- liftDs $ newTyConRepName name'
- ; let tag_map = mkTyConTagMap tycon'
- ; liftDs $ buildDataCon fam_envs
- name'
- (dataConIsInfix dc) -- infix if the original is
- rep_nm
- (dataConSrcBangs dc) -- strictness as original constructor
- (Just $ dataConImplBangs dc)
- [] -- no labelled fields for now
- univ_tvs -- universally quantified vars
- [] -- no existential tvs for now
- user_bndrs
- [] -- no equalities for now
- [] -- no context for now
- arg_tys -- argument types
- ret_ty -- return type
- tycon' -- representation tycon
- tag_map
- }
- where
- name = dataConName dc
- rep_arg_tys = dataConRepArgTys dc
- tycon = dataConTyCon dc
- (univ_tvs, ex_tvs, eq_spec, theta, _arg_tys, _res_ty) = dataConFullSig dc
- user_bndrs = dataConUserTyVarBinders dc
diff --git a/compiler/vectorise/Vectorise/Type/Type.hs b/compiler/vectorise/Vectorise/Type/Type.hs
deleted file mode 100644
index 270f130123..0000000000
--- a/compiler/vectorise/Vectorise/Type/Type.hs
+++ /dev/null
@@ -1,87 +0,0 @@
--- Apply the vectorisation transformation to types. This is the \mathcal{L}_t scheme in HtM.
-
-module Vectorise.Type.Type
- ( vectTyCon
- , vectAndLiftType
- , vectType
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Utils
-import Vectorise.Monad
-import Vectorise.Builtins
-import TcType
-import Type
-import TyCoRep
-import TyCon
-import Control.Monad
-import Data.Maybe
-import Outputable
-
--- |Vectorise a type constructor. Unless there is a vectorised version (stripped of embedded
--- parallel arrays), the vectorised version is the same as the original.
---
-vectTyCon :: TyCon -> VM TyCon
-vectTyCon tc = maybe tc id <$> lookupTyCon tc
-
--- |Produce the vectorised and lifted versions of a type.
---
--- NB: Here we are limited to properly handle predicates at the toplevel only. Anything embedded
--- in what is called the 'body_ty' below will end up as an argument to the type family 'PData'.
---
-vectAndLiftType :: Type -> VM (Type, Type)
-vectAndLiftType ty | Just ty' <- coreView ty = vectAndLiftType ty'
-vectAndLiftType ty
- = do { padicts <- liftM catMaybes $ mapM paDictArgType tyvars
- ; vmono_ty <- vectType mono_ty
- ; lmono_ty <- mkPDataType vmono_ty
- ; return (abstractType tyvars (padicts ++ theta) vmono_ty,
- abstractType tyvars (padicts ++ theta) lmono_ty)
- }
- where
- (tyvars, phiTy) = splitForAllTys ty
- (theta, mono_ty) = tcSplitPhiTy phiTy
-
--- |Vectorise a type.
---
--- For each quantified var we need to add a PA dictionary out the front of the type.
--- So forall a. C a => a -> a
--- turns into forall a. PA a => Cv a => a :-> a
---
-vectType :: Type -> VM Type
-vectType ty
- | Just ty' <- coreView ty
- = vectType ty'
-vectType (TyVarTy tv) = return $ TyVarTy tv
-vectType (LitTy l) = return $ LitTy l
-vectType (AppTy ty1 ty2) = AppTy <$> vectType ty1 <*> vectType ty2
-vectType (TyConApp tc tys) = TyConApp <$> vectTyCon tc <*> mapM vectType tys
-vectType (FunTy ty1 ty2)
- | isPredTy ty1
- = mkFunTy <$> vectType ty1 <*> vectType ty2 -- don't build a closure for dictionary abstraction
- | otherwise
- = TyConApp <$> builtin closureTyCon <*> mapM vectType [ty1, ty2]
-vectType ty@(ForAllTy {})
- = do { -- strip off consecutive foralls
- ; let (tyvars, tyBody) = splitForAllTys ty
-
- -- vectorise the body
- ; vtyBody <- vectType tyBody
-
- -- make a PA dictionary for each of the type variables
- ; dictsPA <- liftM catMaybes $ mapM paDictArgType tyvars
-
- -- add the PA dictionaries after the foralls
- ; return $ abstractType tyvars dictsPA vtyBody
- }
-vectType ty@(CastTy {})
- = pprSorry "Vectorise.Type.Type.vectType: CastTy" (ppr ty)
-vectType ty@(CoercionTy {})
- = pprSorry "Vectorise.Type.Type.vectType: CoercionTy" (ppr ty)
-
--- |Add quantified vars and dictionary parameters to the front of a type.
---
-abstractType :: [TyVar] -> [Type] -> Type -> Type
-abstractType tyvars dicts = mkInvForAllTys tyvars . mkFunTys dicts
diff --git a/compiler/vectorise/Vectorise/Utils.hs b/compiler/vectorise/Vectorise/Utils.hs
deleted file mode 100644
index 6467bf9e7a..0000000000
--- a/compiler/vectorise/Vectorise/Utils.hs
+++ /dev/null
@@ -1,167 +0,0 @@
-module Vectorise.Utils (
- module Vectorise.Utils.Base,
- module Vectorise.Utils.Closure,
- module Vectorise.Utils.Hoisting,
- module Vectorise.Utils.PADict,
- module Vectorise.Utils.Poly,
-
- -- * Annotated Exprs
- collectAnnTypeArgs,
- collectAnnDictArgs,
- collectAnnTypeBinders,
- collectAnnValBinders,
- isAnnTypeArg,
-
- -- * PD Functions
- replicatePD, emptyPD, packByTagPD,
- combinePD, liftPD,
-
- -- * Scalars
- isScalar, zipScalars, scalarClosure,
-
- -- * Naming
- newLocalVar
-) where
-
-import GhcPrelude
-
-import Vectorise.Utils.Base
-import Vectorise.Utils.Closure
-import Vectorise.Utils.Hoisting
-import Vectorise.Utils.PADict
-import Vectorise.Utils.Poly
-import Vectorise.Monad
-import Vectorise.Builtins
-import CoreSyn
-import CoreUtils
-import Id
-import Type
-import Control.Monad
-
-
--- Annotated Exprs ------------------------------------------------------------
-
-collectAnnTypeArgs :: AnnExpr b ann -> (AnnExpr b ann, [Type])
-collectAnnTypeArgs expr = go expr []
- where
- go (_, AnnApp f (_, AnnType ty)) tys = go f (ty : tys)
- go e tys = (e, tys)
-
-collectAnnDictArgs :: AnnExpr Var ann -> (AnnExpr Var ann, [AnnExpr Var ann])
-collectAnnDictArgs expr = go expr []
- where
- go e@(_, AnnApp f arg) dicts
- | isPredTy . exprType . deAnnotate $ arg = go f (arg : dicts)
- | otherwise = (e, dicts)
- go e dicts = (e, dicts)
-
-collectAnnTypeBinders :: AnnExpr Var ann -> ([Var], AnnExpr Var ann)
-collectAnnTypeBinders expr = go [] expr
- where
- go bs (_, AnnLam b e) | isTyVar b = go (b : bs) e
- go bs e = (reverse bs, e)
-
--- |Collect all consecutive value binders that are not dictionaries.
---
-collectAnnValBinders :: AnnExpr Var ann -> ([Var], AnnExpr Var ann)
-collectAnnValBinders expr = go [] expr
- where
- go bs (_, AnnLam b e) | isId b
- && (not . isPredTy . idType $ b) = go (b : bs) e
- go bs e = (reverse bs, e)
-
-isAnnTypeArg :: AnnExpr b ann -> Bool
-isAnnTypeArg (_, AnnType _) = True
-isAnnTypeArg _ = False
-
-
--- PD "Parallel Data" Functions -----------------------------------------------
---
--- Given some data that has a PA dictionary, we can convert it to its
--- representation type, perform some operation on the data, then convert it back.
---
--- In the DPH backend, the types of these functions are defined
--- in dph-common/D.A.P.Lifted/PArray.hs
---
-
--- |An empty array of the given type.
---
-emptyPD :: Type -> VM CoreExpr
-emptyPD = paMethod emptyPDVar emptyPD_PrimVar
-
--- |Produce an array containing copies of a given element.
---
-replicatePD :: CoreExpr -- ^ Number of copies in the resulting array.
- -> CoreExpr -- ^ Value to replicate.
- -> VM CoreExpr
-replicatePD len x
- = liftM (`mkApps` [len,x])
- $ paMethod replicatePDVar replicatePD_PrimVar (exprType x)
-
--- |Select some elements from an array that correspond to a particular tag value and pack them into a new
--- array.
---
--- > packByTagPD Int# [:23, 42, 95, 50, 27, 49:] 3 [:1, 2, 1, 2, 3, 2:] 2
--- > ==> [:42, 50, 49:]
---
-packByTagPD :: Type -- ^ Element type.
- -> CoreExpr -- ^ Source array.
- -> CoreExpr -- ^ Length of resulting array.
- -> CoreExpr -- ^ Tag values of elements in source array.
- -> CoreExpr -- ^ The tag value for the elements to select.
- -> VM CoreExpr
-packByTagPD ty xs len tags t
- = liftM (`mkApps` [xs, len, tags, t])
- (paMethod packByTagPDVar packByTagPD_PrimVar ty)
-
--- |Combine some arrays based on a selector. The selector says which source array to choose for each
--- element of the resulting array.
---
-combinePD :: Type -- ^ Element type
- -> CoreExpr -- ^ Length of resulting array
- -> CoreExpr -- ^ Selector.
- -> [CoreExpr] -- ^ Arrays to combine.
- -> VM CoreExpr
-combinePD ty len sel xs
- = liftM (`mkApps` (len : sel : xs))
- (paMethod (combinePDVar n) (combinePD_PrimVar n) ty)
- where
- n = length xs
-
--- |Like `replicatePD` but use the lifting context in the vectoriser state.
---
-liftPD :: CoreExpr -> VM CoreExpr
-liftPD x
- = do
- lc <- builtin liftingContext
- replicatePD (Var lc) x
-
-
--- Scalars --------------------------------------------------------------------
-
-isScalar :: Type -> VM Bool
-isScalar ty
- = do
- { scalar <- builtin scalarClass
- ; existsInst scalar [ty]
- }
-
-zipScalars :: [Type] -> Type -> VM CoreExpr
-zipScalars arg_tys res_ty
- = do
- { scalar <- builtin scalarClass
- ; (dfuns, _) <- mapAndUnzipM (\ty -> lookupInst scalar [ty]) ty_args
- ; zipf <- builtin (scalarZip $ length arg_tys)
- ; return $ Var zipf `mkTyApps` ty_args `mkApps` map Var dfuns
- }
- where
- ty_args = arg_tys ++ [res_ty]
-
-scalarClosure :: [Type] -> Type -> CoreExpr -> CoreExpr -> VM CoreExpr
-scalarClosure arg_tys res_ty scalar_fun array_fun
- = do
- { ctr <- builtin (closureCtrFun $ length arg_tys)
- ; pas <- mapM paDictOfType (init arg_tys)
- ; return $ Var ctr `mkTyApps` (arg_tys ++ [res_ty])
- `mkApps` (pas ++ [scalar_fun, array_fun])
- }
diff --git a/compiler/vectorise/Vectorise/Utils/Base.hs b/compiler/vectorise/Vectorise/Utils/Base.hs
deleted file mode 100644
index 72ee0bed1e..0000000000
--- a/compiler/vectorise/Vectorise/Utils/Base.hs
+++ /dev/null
@@ -1,261 +0,0 @@
-{-# LANGUAGE CPP #-}
-
-module Vectorise.Utils.Base
- ( voidType
- , newLocalVVar
-
- , mkDataConTag
- , mkWrapType
- , mkClosureTypes
- , mkPReprType
- , mkPDataType, mkPDatasType
- , splitPrimTyCon
- , mkBuiltinCo
-
- , wrapNewTypeBodyOfWrap
- , unwrapNewTypeBodyOfWrap
- , wrapNewTypeBodyOfPDataWrap
- , unwrapNewTypeBodyOfPDataWrap
- , wrapNewTypeBodyOfPDatasWrap
- , unwrapNewTypeBodyOfPDatasWrap
-
- , pdataReprTyCon
- , pdataReprTyConExact
- , pdatasReprTyConExact
- , pdataUnwrapScrut
-
- , preprFamInst
-) where
-
-import GhcPrelude
-
-import Vectorise.Monad
-import Vectorise.Vect
-import Vectorise.Builtins
-
-import CoreSyn
-import CoreUtils
-import FamInstEnv
-import Coercion
-import Type
-import TyCon
-import DataCon
-import MkId
-import DynFlags
-import FastString
-
-#include "HsVersions.h"
-
--- Simple Types ---------------------------------------------------------------
-
-voidType :: VM Type
-voidType = mkBuiltinTyConApp voidTyCon []
-
-
--- Name Generation ------------------------------------------------------------
-
-newLocalVVar :: FastString -> Type -> VM VVar
-newLocalVVar fs vty
- = do
- lty <- mkPDataType vty
- vv <- newLocalVar fs vty
- lv <- newLocalVar fs lty
- return (vv,lv)
-
-
--- Constructors ---------------------------------------------------------------
-
-mkDataConTag :: DynFlags -> DataCon -> CoreExpr
-mkDataConTag dflags = mkIntLitInt dflags . dataConTagZ
-
-
--- Type Construction ----------------------------------------------------------
-
--- |Make an application of the 'Wrap' type constructor.
---
-mkWrapType :: Type -> VM Type
-mkWrapType ty = mkBuiltinTyConApp wrapTyCon [ty]
-
--- |Make an application of the closure type constructor.
---
-mkClosureTypes :: [Type] -> Type -> VM Type
-mkClosureTypes = mkBuiltinTyConApps closureTyCon
-
--- |Make an application of the 'PRepr' type constructor.
---
-mkPReprType :: Type -> VM Type
-mkPReprType ty = mkBuiltinTyConApp preprTyCon [ty]
-
--- | Make an application of the 'PData' tycon to some argument.
---
-mkPDataType :: Type -> VM Type
-mkPDataType ty = mkBuiltinTyConApp pdataTyCon [ty]
-
--- | Make an application of the 'PDatas' tycon to some argument.
---
-mkPDatasType :: Type -> VM Type
-mkPDatasType ty = mkBuiltinTyConApp pdatasTyCon [ty]
-
--- Make an application of a builtin type constructor to some arguments.
---
-mkBuiltinTyConApp :: (Builtins -> TyCon) -> [Type] -> VM Type
-mkBuiltinTyConApp get_tc tys
- = do { tc <- builtin get_tc
- ; return $ mkTyConApp tc tys
- }
-
--- Make a cascading application of a builtin type constructor.
---
-mkBuiltinTyConApps :: (Builtins -> TyCon) -> [Type] -> Type -> VM Type
-mkBuiltinTyConApps get_tc tys ty
- = do { tc <- builtin get_tc
- ; return $ foldr (mk tc) ty tys
- }
- where
- mk tc ty1 ty2 = mkTyConApp tc [ty1,ty2]
-
-
--- Type decomposition ---------------------------------------------------------
-
--- |Checks if a type constructor is defined in 'GHC.Prim' (e.g., 'Int#'); if so, returns it.
---
-splitPrimTyCon :: Type -> Maybe TyCon
-splitPrimTyCon ty
- | Just (tycon, []) <- splitTyConApp_maybe ty
- , isPrimTyCon tycon
- = Just tycon
- | otherwise = Nothing
-
-
--- Coercion Construction -----------------------------------------------------
-
--- |Make a representational coercion to some builtin type.
---
-mkBuiltinCo :: (Builtins -> TyCon) -> VM Coercion
-mkBuiltinCo get_tc
- = do { tc <- builtin get_tc
- ; return $ mkTyConAppCo Representational tc []
- }
-
-
--- Wrapping and unwrapping the 'Wrap' newtype ---------------------------------
-
--- |Apply the constructor wrapper of the 'Wrap' /newtype/.
---
-wrapNewTypeBodyOfWrap :: CoreExpr -> Type -> VM CoreExpr
-wrapNewTypeBodyOfWrap e ty
- = do { wrap_tc <- builtin wrapTyCon
- ; return $ wrapNewTypeBody wrap_tc [ty] e
- }
-
--- |Strip the constructor wrapper of the 'Wrap' /newtype/.
---
-unwrapNewTypeBodyOfWrap :: CoreExpr -> Type -> VM CoreExpr
-unwrapNewTypeBodyOfWrap e ty
- = do { wrap_tc <- builtin wrapTyCon
- ; return $ unwrapNewTypeBody wrap_tc [ty] e
- }
-
--- |Apply the constructor wrapper of the 'PData' /newtype/ instance of 'Wrap'.
---
-wrapNewTypeBodyOfPDataWrap :: CoreExpr -> Type -> VM CoreExpr
-wrapNewTypeBodyOfPDataWrap e ty
- = do { wrap_tc <- builtin wrapTyCon
- ; pwrap_tc <- pdataReprTyConExact wrap_tc
- ; return $ wrapNewTypeBody pwrap_tc [ty] e
- }
-
--- |Strip the constructor wrapper of the 'PData' /newtype/ instance of 'Wrap'.
---
-unwrapNewTypeBodyOfPDataWrap :: CoreExpr -> Type -> VM CoreExpr
-unwrapNewTypeBodyOfPDataWrap e ty
- = do { wrap_tc <- builtin wrapTyCon
- ; pwrap_tc <- pdataReprTyConExact wrap_tc
- ; return $ unwrapNewTypeBody pwrap_tc [ty] (unwrapFamInstScrut pwrap_tc [ty] e)
- }
-
--- |Apply the constructor wrapper of the 'PDatas' /newtype/ instance of 'Wrap'.
---
-wrapNewTypeBodyOfPDatasWrap :: CoreExpr -> Type -> VM CoreExpr
-wrapNewTypeBodyOfPDatasWrap e ty
- = do { wrap_tc <- builtin wrapTyCon
- ; pwrap_tc <- pdatasReprTyConExact wrap_tc
- ; return $ wrapNewTypeBody pwrap_tc [ty] e
- }
-
--- |Strip the constructor wrapper of the 'PDatas' /newtype/ instance of 'Wrap'.
---
-unwrapNewTypeBodyOfPDatasWrap :: CoreExpr -> Type -> VM CoreExpr
-unwrapNewTypeBodyOfPDatasWrap e ty
- = do { wrap_tc <- builtin wrapTyCon
- ; pwrap_tc <- pdatasReprTyConExact wrap_tc
- ; return $ unwrapNewTypeBody pwrap_tc [ty] (unwrapFamInstScrut pwrap_tc [ty] e)
- }
-
-
--- 'PData' representation types ----------------------------------------------
-
--- |Get the representation tycon of the 'PData' data family for a given type.
---
--- This tycon does not appear explicitly in the source program — see Note [PData TyCons] in
--- 'Vectorise.Generic.Description':
---
--- @pdataReprTyCon {Sum2} = {PDataSum2}@
---
--- The type for which we look up a 'PData' instance may be more specific than the type in the
--- instance declaration. In that case the second component of the result will be more specific than
--- a set of distinct type variables.
---
-pdataReprTyCon :: Type -> VM (TyCon, [Type])
-pdataReprTyCon ty
- = do
- { FamInstMatch { fim_instance = famInst
- , fim_tys = tys } <- builtin pdataTyCon >>= (`lookupFamInst` [ty])
- ; return (dataFamInstRepTyCon famInst, tys)
- }
-
--- |Get the representation tycon of the 'PData' data family for a given type constructor.
---
--- For example, for a binary type constructor 'T', we determine the representation type constructor
--- for 'PData (T a b)'.
---
-pdataReprTyConExact :: TyCon -> VM TyCon
-pdataReprTyConExact tycon
- = do { -- look up the representation tycon; if there is a match at all, it will be exact
- ; -- (i.e.,' _tys' will be distinct type variables)
- ; (ptycon, _tys) <- pdataReprTyCon (tycon `mkTyConApp` mkTyVarTys (tyConTyVars tycon))
- ; return ptycon
- }
-
--- |Get the representation tycon of the 'PDatas' data family for a given type constructor.
---
--- For example, for a binary type constructor 'T', we determine the representation type constructor
--- for 'PDatas (T a b)'.
---
-pdatasReprTyConExact :: TyCon -> VM TyCon
-pdatasReprTyConExact tycon
- = do { -- look up the representation tycon; if there is a match at all, it will be exact
- ; (FamInstMatch { fim_instance = ptycon }) <- pdatasReprTyCon (tycon `mkTyConApp` mkTyVarTys (tyConTyVars tycon))
- ; return $ dataFamInstRepTyCon ptycon
- }
- where
- pdatasReprTyCon ty = builtin pdatasTyCon >>= (`lookupFamInst` [ty])
-
--- |Unwrap a 'PData' representation scrutinee.
---
-pdataUnwrapScrut :: VExpr -> VM (CoreExpr, CoreExpr, DataCon)
-pdataUnwrapScrut (ve, le)
- = do { (tc, arg_tys) <- pdataReprTyCon ty
- ; let [dc] = tyConDataCons tc
- ; return (ve, unwrapFamInstScrut tc arg_tys le, dc)
- }
- where
- ty = exprType ve
-
-
--- 'PRepr' representation types ----------------------------------------------
-
--- |Get the representation tycon of the 'PRepr' type family for a given type.
---
-preprFamInst :: Type -> VM FamInstMatch
-preprFamInst ty = builtin preprTyCon >>= (`lookupFamInst` [ty])
diff --git a/compiler/vectorise/Vectorise/Utils/Closure.hs b/compiler/vectorise/Vectorise/Utils/Closure.hs
deleted file mode 100644
index 49ef127975..0000000000
--- a/compiler/vectorise/Vectorise/Utils/Closure.hs
+++ /dev/null
@@ -1,163 +0,0 @@
--- |Utils concerning closure construction and application.
-
-module Vectorise.Utils.Closure
- ( mkClosure
- , mkClosureApp
- , buildClosures
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Builtins
-import Vectorise.Vect
-import Vectorise.Monad
-import Vectorise.Utils.Base
-import Vectorise.Utils.PADict
-import Vectorise.Utils.Hoisting
-
-import CoreSyn
-import Type
-import MkCore
-import CoreUtils
-import TyCon
-import DataCon
-import MkId
-import TysWiredIn
-import BasicTypes( Boxity(..) )
-import FastString
-
-
--- |Make a closure.
---
-mkClosure :: Type -- ^ Type of the argument.
- -> Type -- ^ Type of the result.
- -> Type -- ^ Type of the environment.
- -> VExpr -- ^ The function to apply.
- -> VExpr -- ^ The environment to use.
- -> VM VExpr
-mkClosure arg_ty res_ty env_ty (vfn,lfn) (venv,lenv)
- = do dict <- paDictOfType env_ty
- mkv <- builtin closureVar
- mkl <- builtin liftedClosureVar
- return (Var mkv `mkTyApps` [arg_ty, res_ty, env_ty] `mkApps` [dict, vfn, lfn, venv],
- Var mkl `mkTyApps` [arg_ty, res_ty, env_ty] `mkApps` [dict, vfn, lfn, lenv])
-
--- |Make a closure application.
---
-mkClosureApp :: Type -- ^ Type of the argument.
- -> Type -- ^ Type of the result.
- -> VExpr -- ^ Closure to apply.
- -> VExpr -- ^ Argument to use.
- -> VM VExpr
-mkClosureApp arg_ty res_ty (vclo, lclo) (varg, larg)
- = do vapply <- builtin applyVar
- lapply <- builtin liftedApplyVar
- lc <- builtin liftingContext
- return (Var vapply `mkTyApps` [arg_ty, res_ty] `mkApps` [vclo, varg],
- Var lapply `mkTyApps` [arg_ty, res_ty] `mkApps` [Var lc, lclo, larg])
-
--- |Build a set of 'n' closures corresponding to an 'n'-ary vectorised function. The length of
--- the list of types of arguments determines the arity.
---
--- In addition to a set of type variables, a set of value variables is passed during closure
--- /construction/. In contrast, the closure environment and the arguments are passed during closure
--- application.
---
-buildClosures :: [TyVar] -- ^ Type variables passed during closure construction.
- -> [Var] -- ^ Variables passed during closure construction.
- -> [VVar] -- ^ Variables in the environment.
- -> [Type] -- ^ Type of the arguments.
- -> Type -- ^ Type of result.
- -> VM VExpr
- -> VM VExpr
-buildClosures _tvs _vars _env [] _res_ty mk_body
- = mk_body
-buildClosures tvs vars env [arg_ty] res_ty mk_body
- = buildClosure tvs vars env arg_ty res_ty mk_body
-buildClosures tvs vars env (arg_ty : arg_tys) res_ty mk_body
- = do { res_ty' <- mkClosureTypes arg_tys res_ty
- ; arg <- newLocalVVar (fsLit "x") arg_ty
- ; buildClosure tvs vars env arg_ty res_ty'
- . hoistPolyVExpr tvs vars (Inline (length env + 1))
- $ do { lc <- builtin liftingContext
- ; clo <- buildClosures tvs vars (env ++ [arg]) arg_tys res_ty mk_body
- ; return $ vLams lc (env ++ [arg]) clo
- }
- }
-
--- Build a closure taking one extra argument during closure application.
---
--- (clo <x1,...,xn> <f,f^>, aclo (Arr lc xs1 ... xsn) <f,f^>)
--- where
--- f = \env v -> case env of <x1,...,xn> -> e x1 ... xn v
--- f^ = \env v -> case env of Arr l xs1 ... xsn -> e^ l x1 ... xn v
---
--- In addition to a set of type variables, a set of value variables is passed during closure
--- /construction/. In contrast, the closure environment and the closure argument are passed during
--- closure application.
---
-buildClosure :: [TyVar] -- ^Type variables passed during closure construction.
- -> [Var] -- ^Variables passed during closure construction.
- -> [VVar] -- ^Variables in the environment.
- -> Type -- ^Type of the closure argument.
- -> Type -- ^Type of the result.
- -> VM VExpr
- -> VM VExpr
-buildClosure tvs vars vvars arg_ty res_ty mk_body
- = do { (env_ty, env, bind) <- buildEnv vvars
- ; env_bndr <- newLocalVVar (fsLit "env") env_ty
- ; arg_bndr <- newLocalVVar (fsLit "arg") arg_ty
-
- -- generate the closure function as a hoisted binding
- ; fn <- hoistPolyVExpr tvs vars (Inline 2) $
- do { lc <- builtin liftingContext
- ; body <- mk_body
- ; return . vLams lc [env_bndr, arg_bndr]
- $ bind (vVar env_bndr)
- (vVarApps lc body (vvars ++ [arg_bndr]))
- }
-
- ; mkClosure arg_ty res_ty env_ty fn env
- }
-
--- Build the environment for a single closure.
---
-buildEnv :: [VVar] -> VM (Type, VExpr, VExpr -> VExpr -> VExpr)
-buildEnv []
- = do
- ty <- voidType
- void <- builtin voidVar
- pvoid <- builtin pvoidVar
- return (ty, vVar (void, pvoid), \_ body -> body)
-buildEnv [v]
- = return (vVarType v, vVar v,
- \env body -> vLet (vNonRec v env) body)
-buildEnv vs
- = do (lenv_tc, lenv_tyargs) <- pdataReprTyCon ty
-
- let venv_con = tupleDataCon Boxed (length vs)
- [lenv_con] = tyConDataCons lenv_tc
-
- venv = mkCoreTup (map Var vvs)
- lenv = Var (dataConWrapId lenv_con)
- `mkTyApps` lenv_tyargs
- `mkApps` map Var lvs
-
- vbind env body = mkWildCase env ty (exprType body)
- [(DataAlt venv_con, vvs, body)]
-
- lbind env body =
- let scrut = unwrapFamInstScrut lenv_tc lenv_tyargs env
- in
- mkWildCase scrut (exprType scrut) (exprType body)
- [(DataAlt lenv_con, lvs, body)]
-
- bind (venv, lenv) (vbody, lbody) = (vbind venv vbody,
- lbind lenv lbody)
-
- return (ty, (venv, lenv), bind)
- where
- (vvs, lvs) = unzip vs
- tys = map vVarType vs
- ty = mkBoxedTupleTy tys
diff --git a/compiler/vectorise/Vectorise/Utils/Hoisting.hs b/compiler/vectorise/Vectorise/Utils/Hoisting.hs
deleted file mode 100644
index e1d208590d..0000000000
--- a/compiler/vectorise/Vectorise/Utils/Hoisting.hs
+++ /dev/null
@@ -1,98 +0,0 @@
-module Vectorise.Utils.Hoisting
- ( Inline(..)
- , addInlineArity
- , inlineMe
-
- , hoistBinding
- , hoistExpr
- , hoistVExpr
- , hoistPolyVExpr
- , takeHoisted
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Monad
-import Vectorise.Env
-import Vectorise.Vect
-import Vectorise.Utils.Poly
-
-import CoreSyn
-import CoreUtils
-import CoreUnfold
-import Type
-import Id
-import BasicTypes (Arity)
-import FastString
-import Control.Monad
-
--- Inline ---------------------------------------------------------------------
-
--- |Records whether we should inline a particular binding.
---
-data Inline
- = Inline Arity
- | DontInline
-
--- |Add to the arity contained within an `Inline`, if any.
---
-addInlineArity :: Inline -> Int -> Inline
-addInlineArity (Inline m) n = Inline (m+n)
-addInlineArity DontInline _ = DontInline
-
--- |Says to always inline a binding.
---
-inlineMe :: Inline
-inlineMe = Inline 0
-
-
--- Hoisting --------------------------------------------------------------------
-
-hoistBinding :: Var -> CoreExpr -> VM ()
-hoistBinding v e = updGEnv $ \env ->
- env { global_bindings = (v,e) : global_bindings env }
-
-hoistExpr :: FastString -> CoreExpr -> Inline -> VM Var
-hoistExpr fs expr inl
- = do
- var <- mk_inline `liftM` newLocalVar fs (exprType expr)
- hoistBinding var expr
- return var
- where
- mk_inline var = case inl of
- Inline arity -> var `setIdUnfolding`
- mkInlineUnfoldingWithArity arity expr
- DontInline -> var
-
-hoistVExpr :: VExpr -> Inline -> VM VVar
-hoistVExpr (ve, le) inl
- = do
- fs <- getBindName
- vv <- hoistExpr ('v' `consFS` fs) ve inl
- lv <- hoistExpr ('l' `consFS` fs) le (addInlineArity inl 1)
- return (vv, lv)
-
--- |Hoist a polymorphic vectorised expression into a new top-level binding (representing a closure
--- function).
---
--- The hoisted expression is parameterised by (1) a set of type variables and (2) a set of value
--- variables that are passed as conventional type and value arguments. The latter is implicitly
--- extended by the set of 'PA' dictionaries required for the type variables.
---
-hoistPolyVExpr :: [TyVar] -> [Var] -> Inline -> VM VExpr -> VM VExpr
-hoistPolyVExpr tvs vars inline p
- = do { inline' <- addInlineArity inline . (+ length vars) <$> polyArity tvs
- ; expr <- closedV . polyAbstract tvs $ \args ->
- mapVect (mkLams $ tvs ++ args ++ vars) <$> p
- ; fn <- hoistVExpr expr inline'
- ; let varArgs = varsToCoreExprs vars
- ; mapVect (\e -> e `mkApps` varArgs) <$> polyVApply (vVar fn) (mkTyVarTys tvs)
- }
-
-takeHoisted :: VM [(Var, CoreExpr)]
-takeHoisted
- = do
- env <- readGEnv id
- setGEnv $ env { global_bindings = [] }
- return $ global_bindings env
diff --git a/compiler/vectorise/Vectorise/Utils/PADict.hs b/compiler/vectorise/Vectorise/Utils/PADict.hs
deleted file mode 100644
index 1176b78e54..0000000000
--- a/compiler/vectorise/Vectorise/Utils/PADict.hs
+++ /dev/null
@@ -1,232 +0,0 @@
-module Vectorise.Utils.PADict (
- paDictArgType,
- paDictOfType,
- paMethod,
- prDictOfReprType,
- prDictOfPReprInstTyCon
-) where
-
-import GhcPrelude
-
-import Vectorise.Monad
-import Vectorise.Builtins
-import Vectorise.Utils.Base
-
-import CoreSyn
-import CoreUtils
-import FamInstEnv
-import Coercion
-import Type
-import TyCoRep
-import TyCon
-import CoAxiom
-import Var
-import Outputable
-import DynFlags
-import FastString
-import Util
-import Control.Monad
-
-
--- |Construct the PA argument type for the tyvar. For the tyvar (v :: *) it's
--- just PA v. For (v :: (* -> *) -> *) it's
---
--- > forall (a :: * -> *). (forall (b :: *). PA b -> PA (a b)) -> PA (v a)
---
-paDictArgType :: TyVar -> VM (Maybe Type)
-paDictArgType tv = go (mkTyVarTy tv) (tyVarKind tv)
- where
- go ty (FunTy k1 k2)
- = do
- tv <- if isCoercionType k1
- then newCoVar (fsLit "c") k1
- else newTyVar (fsLit "a") k1
- mty1 <- go (mkTyVarTy tv) k1
- case mty1 of
- Just ty1 -> do
- mty2 <- go (mkAppTy ty (mkTyVarTy tv)) k2
- return $ fmap (mkInvForAllTy tv . mkFunTy ty1) mty2
- Nothing -> go ty k2
-
- go ty k
- | isLiftedTypeKind k
- = do
- pa_cls <- builtin paClass
- return $ Just $ mkClassPred pa_cls [ty]
-
- go _ _ = return Nothing
-
-
--- |Get the PA dictionary for some type
---
-paDictOfType :: Type -> VM CoreExpr
-paDictOfType ty
- = paDictOfTyApp ty_fn ty_args
- where
- (ty_fn, ty_args) = splitAppTys ty
-
- paDictOfTyApp :: Type -> [Type] -> VM CoreExpr
- paDictOfTyApp ty_fn ty_args
- | Just ty_fn' <- coreView ty_fn
- = paDictOfTyApp ty_fn' ty_args
-
- -- for type variables, look up the dfun and apply to the PA dictionaries
- -- of the type arguments
- paDictOfTyApp (TyVarTy tv) ty_args
- = do
- { dfun <- maybeCantVectoriseM "No PA dictionary for type variable"
- (ppr tv <+> text "in" <+> ppr ty)
- $ lookupTyVarPA tv
- ; dicts <- mapM paDictOfType ty_args
- ; return $ dfun `mkTyApps` ty_args `mkApps` dicts
- }
-
- -- for tycons, we also need to apply the dfun to the PR dictionary of
- -- the representation type if the tycon is polymorphic
- paDictOfTyApp (TyConApp tc []) ty_args
- = do
- { dfun <- maybeCantVectoriseM noPADictErr (ppr tc <+> text "in" <+> ppr ty)
- $ lookupTyConPA tc
- ; super <- super_dict tc ty_args
- ; dicts <- mapM paDictOfType ty_args
- ; return $ Var dfun `mkTyApps` ty_args `mkApps` super `mkApps` dicts
- }
- where
- noPADictErr = "No PA dictionary for type constructor (did you import 'Data.Array.Parallel'?)"
-
- super_dict _ [] = return []
- super_dict tycon ty_args
- = do
- { pr <- prDictOfPReprInst (TyConApp tycon ty_args)
- ; return [pr]
- }
-
- paDictOfTyApp _ _ = getDynFlags >>= failure
-
- failure dflags = cantVectorise dflags "Can't construct PA dictionary for type" (ppr ty)
-
--- |Produce code that refers to a method of the 'PA' class.
---
-paMethod :: (Builtins -> Var) -> (TyCon -> Builtins -> Var) -> Type -> VM CoreExpr
-paMethod _ query ty
- | Just tycon <- splitPrimTyCon ty -- Is 'ty' from 'GHC.Prim' (e.g., 'Int#')?
- = liftM Var $ builtin (query tycon)
-paMethod method _ ty
- = do
- { fn <- builtin method
- ; dict <- paDictOfType ty
- ; return $ mkApps (Var fn) [Type ty, dict]
- }
-
--- |Given a type @ty@, return the PR dictionary for @PRepr ty@.
---
-prDictOfPReprInst :: Type -> VM CoreExpr
-prDictOfPReprInst ty
- = do
- { (FamInstMatch { fim_instance = prepr_fam, fim_tys = prepr_args })
- <- preprFamInst ty
- ; prDictOfPReprInstTyCon ty (famInstAxiom prepr_fam) prepr_args
- }
-
--- |Given a type @ty@, its PRepr synonym tycon and its type arguments,
--- return the PR @PRepr ty@. Suppose we have:
---
--- > type instance PRepr (T a1 ... an) = t
---
--- which is internally translated into
---
--- > type :R:PRepr a1 ... an = t
---
--- and the corresponding coercion. Then,
---
--- > prDictOfPReprInstTyCon (T a1 ... an) :R:PRepr u1 ... un = PR (T u1 ... un)
---
--- Note that @ty@ is only used for error messages
---
-prDictOfPReprInstTyCon :: Type -> CoAxiom Unbranched -> [Type] -> VM CoreExpr
-prDictOfPReprInstTyCon _ty prepr_ax prepr_args
- = do
- let rhs = mkUnbranchedAxInstRHS prepr_ax prepr_args []
- dict <- prDictOfReprType' rhs
- pr_co <- mkBuiltinCo prTyCon
- let co = mkAppCo pr_co
- $ mkSymCo
- $ mkUnbranchedAxInstCo Nominal prepr_ax prepr_args []
- return $ mkCast dict co
-
--- |Get the PR dictionary for a type. The argument must be a representation
--- type.
---
-prDictOfReprType :: Type -> VM CoreExpr
-prDictOfReprType ty
- | Just (tycon, tyargs) <- splitTyConApp_maybe ty
- = do
- prepr <- builtin preprTyCon
- if tycon == prepr
- then do
- let [ty'] = tyargs
- pa <- paDictOfType ty'
- sel <- builtin paPRSel
- return $ Var sel `App` Type ty' `App` pa
- else do
- -- a representation tycon must have a PR instance
- dfun <- maybeV (text "look up PR dictionary for" <+> ppr tycon) $
- lookupTyConPR tycon
- prDFunApply dfun tyargs
-
- | otherwise
- = do
- -- it is a tyvar or an application of a tyvar
- -- determine the PR dictionary from its PA dictionary
- --
- -- NOTE: This assumes that PRepr t ~ t is for all representation types
- -- t
- --
- -- FIXME: This doesn't work for kinds other than * at the moment. We'd
- -- have to simply abstract the term over the missing type arguments.
- pa <- paDictOfType ty
- prsel <- builtin paPRSel
- return $ Var prsel `mkApps` [Type ty, pa]
-
-prDictOfReprType' :: Type -> VM CoreExpr
-prDictOfReprType' ty = prDictOfReprType ty `orElseV`
- do dflags <- getDynFlags
- cantVectorise dflags "No PR dictionary for representation type"
- (ppr ty)
-
--- | Apply a tycon's PR dfun to dictionary arguments (PR or PA) corresponding
--- to the argument types.
-prDFunApply :: Var -> [Type] -> VM CoreExpr
-prDFunApply dfun tys
- | Just [] <- ctxs -- PR (a :-> b) doesn't have a context
- = return $ Var dfun `mkTyApps` tys
-
- | Just tycons <- ctxs
- , tycons `equalLength` tys
- = do
- pa <- builtin paTyCon
- pr <- builtin prTyCon
- dflags <- getDynFlags
- args <- zipWithM (dictionary dflags pa pr) tys tycons
- return $ Var dfun `mkTyApps` tys `mkApps` args
-
- | otherwise = do dflags <- getDynFlags
- invalid dflags
- where
- -- the dfun's contexts - if its type is (PA a, PR b) => PR (C a b) then
- -- ctxs is Just [PA, PR]
- ctxs = fmap (map fst)
- $ sequence
- $ map splitTyConApp_maybe
- $ fst
- $ splitFunTys
- $ snd
- $ splitForAllTys
- $ varType dfun
-
- dictionary dflags pa pr ty tycon
- | tycon == pa = paDictOfType ty
- | tycon == pr = prDictOfReprType ty
- | otherwise = invalid dflags
-
- invalid dflags = cantVectorise dflags "Invalid PR dfun type" (ppr (varType dfun) <+> ppr tys)
diff --git a/compiler/vectorise/Vectorise/Utils/Poly.hs b/compiler/vectorise/Vectorise/Utils/Poly.hs
deleted file mode 100644
index 6d7a4112da..0000000000
--- a/compiler/vectorise/Vectorise/Utils/Poly.hs
+++ /dev/null
@@ -1,74 +0,0 @@
--- |Auxiliary functions to vectorise type abstractions.
-
-module Vectorise.Utils.Poly
- ( polyAbstract
- , polyApply
- , polyVApply
- , polyArity
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Vect
-import Vectorise.Monad
-import Vectorise.Utils.PADict
-import CoreSyn
-import Type
-import FastString
-import Control.Monad
-
-
--- Vectorisation of type arguments -------------------------------------------------------------
-
--- |Vectorise under the 'PA' dictionary variables corresponding to a set of type arguments.
---
--- The dictionary variables are new local variables that are entered into the local vectorisation
--- map.
---
--- The purpose of this function is to introduce the additional 'PA' dictionary arguments that are
--- needed when vectorising type abstractions.
---
-polyAbstract :: [TyVar] -> ([Var] -> VM a) -> VM a
-polyAbstract tvs p
- = localV
- $ do { mdicts <- mapM mk_dict_var tvs
- ; zipWithM_ (\tv -> maybe (defLocalTyVar tv)
- (defLocalTyVarWithPA tv . Var)) tvs mdicts
- ; p (mk_args mdicts)
- }
- where
- mk_dict_var tv
- = do { r <- paDictArgType tv
- ; case r of
- Just ty -> liftM Just (newLocalVar (fsLit "dPA") ty)
- Nothing -> return Nothing
- }
-
- mk_args mdicts = [dict | Just dict <- mdicts]
-
--- |Determine the number of 'PA' dictionary arguments required for a set of type variables (depends
--- on their kinds).
---
-polyArity :: [TyVar] -> VM Int
-polyArity tvs
- = do { tys <- mapM paDictArgType tvs
- ; return $ length [() | Just _ <- tys]
- }
-
--- |Apply a expression to its type arguments as well as 'PA' dictionaries for these type arguments.
---
-polyApply :: CoreExpr -> [Type] -> VM CoreExpr
-polyApply expr tys
- = do { dicts <- mapM paDictOfType tys
- ; return $ expr `mkTyApps` tys `mkApps` dicts
- }
-
--- |Apply a vectorised expression to a set of type arguments together with 'PA' dictionaries for
--- these type arguments.
---
-polyVApply :: VExpr -> [Type] -> VM VExpr
-polyVApply expr tys
- = do { dicts <- mapM paDictOfType tys
- ; return $ mapVect (\e -> e `mkTyApps` tys `mkApps` dicts) expr
- }
diff --git a/compiler/vectorise/Vectorise/Var.hs b/compiler/vectorise/Vectorise/Var.hs
deleted file mode 100644
index b107354899..0000000000
--- a/compiler/vectorise/Vectorise/Var.hs
+++ /dev/null
@@ -1,103 +0,0 @@
-{-# LANGUAGE TupleSections #-}
-
--- |Vectorise variables and literals.
-
-module Vectorise.Var
- ( vectBndr
- , vectBndrNew
- , vectBndrIn
- , vectBndrNewIn
- , vectBndrsIn
- , vectVar
- , vectConst
- )
-where
-
-import GhcPrelude
-
-import Vectorise.Utils
-import Vectorise.Monad
-import Vectorise.Env
-import Vectorise.Vect
-import Vectorise.Type.Type
-import CoreSyn
-import Type
-import VarEnv
-import Id
-import FastString
-
--- Binders ----------------------------------------------------------------------------------------
-
--- |Vectorise a binder variable, along with its attached type.
---
-vectBndr :: Var -> VM VVar
-vectBndr v
- = do (vty, lty) <- vectAndLiftType (idType v)
- let vv = v `Id.setIdType` vty
- lv = v `Id.setIdType` lty
-
- updLEnv (mapTo vv lv)
-
- return (vv, lv)
- where
- mapTo vv lv env = env { local_vars = extendVarEnv (local_vars env) v (vv, lv) }
-
--- |Vectorise a binder variable, along with its attached type, but give the result a new name.
---
-vectBndrNew :: Var -> FastString -> VM VVar
-vectBndrNew v fs
- = do vty <- vectType (idType v)
- vv <- newLocalVVar fs vty
- updLEnv (upd vv)
- return vv
- where
- upd vv env = env { local_vars = extendVarEnv (local_vars env) v vv }
-
--- |Vectorise a binder then run a computation with that binder in scope.
---
-vectBndrIn :: Var -> VM a -> VM (VVar, a)
-vectBndrIn v p
- = localV
- $ do vv <- vectBndr v
- x <- p
- return (vv, x)
-
--- |Vectorise a binder, give it a new name, then run a computation with that binder in scope.
---
-vectBndrNewIn :: Var -> FastString -> VM a -> VM (VVar, a)
-vectBndrNewIn v fs p
- = localV
- $ do vv <- vectBndrNew v fs
- x <- p
- return (vv, x)
-
--- |Vectorise some binders, then run a computation with them in scope.
---
-vectBndrsIn :: [Var] -> VM a -> VM ([VVar], a)
-vectBndrsIn vs p
- = localV
- $ do vvs <- mapM vectBndr vs
- x <- p
- return (vvs, x)
-
-
--- Variables --------------------------------------------------------------------------------------
-
--- |Vectorise a variable, producing the vectorised and lifted versions.
---
-vectVar :: Var -> VM VExpr
-vectVar var
- = do { vVar <- lookupVar var
- ; case vVar of
- Local (vv, lv) -> return (Var vv, Var lv) -- local variables have a vect & lifted version
- Global vv -> vectConst (Var vv) -- global variables get replicated
- }
-
-
--- Constants --------------------------------------------------------------------------------------
-
--- |Constants are lifted by replication along the integer context in the `VM` state for the number
--- of elements in the result array.
---
-vectConst :: CoreExpr -> VM VExpr
-vectConst c = (c,) <$> liftPD c
diff --git a/compiler/vectorise/Vectorise/Vect.hs b/compiler/vectorise/Vectorise/Vect.hs
deleted file mode 100644
index 1b0e57167c..0000000000
--- a/compiler/vectorise/Vectorise/Vect.hs
+++ /dev/null
@@ -1,128 +0,0 @@
--- |Simple vectorised constructors and projections.
---
-module Vectorise.Vect
- ( Vect, VVar, VExpr, VBind
-
- , vectorised
- , lifted
- , mapVect
-
- , vVarType
- , vNonRec
- , vRec
- , vVar
- , vType
- , vTick
- , vLet
- , vLams
- , vVarApps
- , vCaseDEFAULT
- )
-where
-
-import GhcPrelude
-
-import CoreSyn
-import Type ( Type )
-import Var
-
--- |Contains the vectorised and lifted versions of some thing.
---
-type Vect a = (a,a)
-type VVar = Vect Var
-type VExpr = Vect CoreExpr
-type VBind = Vect CoreBind
-
--- |Get the vectorised version of a thing.
---
-vectorised :: Vect a -> a
-vectorised = fst
-
--- |Get the lifted version of a thing.
---
-lifted :: Vect a -> a
-lifted = snd
-
--- |Apply some function to both the vectorised and lifted versions of a thing.
---
-mapVect :: (a -> b) -> Vect a -> Vect b
-mapVect f (x, y) = (f x, f y)
-
--- |Combine vectorised and lifted versions of two things componentwise.
---
-zipWithVect :: (a -> b -> c) -> Vect a -> Vect b -> Vect c
-zipWithVect f (x1, y1) (x2, y2) = (f x1 x2, f y1 y2)
-
--- |Get the type of a vectorised variable.
---
-vVarType :: VVar -> Type
-vVarType = varType . vectorised
-
--- |Wrap a vectorised variable as a vectorised expression.
---
-vVar :: VVar -> VExpr
-vVar = mapVect Var
-
--- |Wrap a vectorised type as a vectorised expression.
---
-vType :: Type -> VExpr
-vType ty = (Type ty, Type ty)
-
--- |Make a vectorised note.
---
-vTick :: Tickish Id -> VExpr -> VExpr
-vTick = mapVect . Tick
-
--- |Make a vectorised non-recursive binding.
---
-vNonRec :: VVar -> VExpr -> VBind
-vNonRec = zipWithVect NonRec
-
--- |Make a vectorised recursive binding.
---
-vRec :: [VVar] -> [VExpr] -> VBind
-vRec vs es = (Rec (zip vvs ves), Rec (zip lvs les))
- where
- (vvs, lvs) = unzip vs
- (ves, les) = unzip es
-
--- |Make a vectorised let expression.
---
-vLet :: VBind -> VExpr -> VExpr
-vLet = zipWithVect Let
-
--- |Make a vectorised lambda abstraction.
---
--- The lifted version also binds the lifting context 'lc'.
---
-vLams :: Var -- ^ Var bound to the lifting context.
- -> [VVar] -- ^ Parameter vars for the abstraction.
- -> VExpr -- ^ Body of the abstraction.
- -> VExpr
-vLams lc vs (ve, le)
- = (mkLams vvs ve, mkLams (lc:lvs) le)
- where
- (vvs, lvs) = unzip vs
-
--- |Apply an expression to a set of argument variables.
---
--- The lifted version is also applied to the variable of the lifting context.
---
-vVarApps :: Var -> VExpr -> [VVar] -> VExpr
-vVarApps lc (ve, le) vvs
- = (ve `mkVarApps` vs, le `mkVarApps` (lc : ls))
- where
- (vs, ls) = unzip vvs
-
-
-vCaseDEFAULT :: VExpr -- scrutinee
- -> VVar -- bnder
- -> Type -- type of vectorised version
- -> Type -- type of lifted version
- -> VExpr -- body of alternative.
- -> VExpr
-vCaseDEFAULT (vscrut, lscrut) (vbndr, lbndr) vty lty (vbody, lbody)
- = (Case vscrut vbndr vty (mkDEFAULT vbody),
- Case lscrut lbndr lty (mkDEFAULT lbody))
- where
- mkDEFAULT e = [(DEFAULT, [], e)]
diff --git a/docs/ndp/haskell.sty b/docs/ndp/haskell.sty
deleted file mode 100644
index 3e4d478b1e..0000000000
--- a/docs/ndp/haskell.sty
+++ /dev/null
@@ -1,496 +0,0 @@
-%%% This is a LaTeX2e style file.
-%%%
-%%% It supports setting functional languages, such as Haskell.
-%%%
-%%% Manuel M. T. Chakravarty <chak@cse.unsw.edu.au> [1998..2002]
-%%%
-%%% $Id: haskell.sty,v 1.2 2004/04/02 08:47:53 simonmar Exp $
-%%%
-%%% This file is free software; you can redistribute it and/or modify
-%%% it under the terms of the GNU General Public License as published by
-%%% the Free Software Foundation; either version 2 of the License, or
-%%% (at your option) any later version.
-%%%
-%%% This file is distributed in the hope that it will be useful,
-%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
-%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-%%% GNU General Public License for more details.
-%%%
-%%% Acknowledegments ==========================================================
-%%%
-%%% Thanks to Gabriele Keller <keller@it.uts.edu.au> for beta testing and
-%%% code contributions. Thanks to the LaTeX3 project for improving the LaTeX
-%%% sources (which helped me writing this code). Furthermore, I am grateful
-%%% to Martin Erwig <Martin.Erwig@FernUni-Hagen.de> and Bernard J. Pope
-%%% <bjpop@cs.mu.OZ.AU> for feedback and suggestions, and to Conal Elliott
-%%% <conal@MICROSOFT.com> and Marc van Dongen <dongen@cs.ucc.ie> for pointing
-%%% out a tricky bug.
-%%%
-%%% TODO ======================================================================
-%%%
-%%% B ~ bug; F ~ feature
-%%%
-%%% * B: Consider to use the following alternative definition for \<..\>:
-%%%
-%%% \def\<{\bgroup\@hsSpaceToApp\endhs}
-%%% \def\endhs#1\>{\(\mathit{#1}\)\egroup}
-%%%
-%%% It completely avoids the problem that \mathit\bgroup..\egroup isn't
-%%% guaranteed to work and seems more elegant, anyway.
-%%%
-%%% * F: Along the lines of the discussion with Martin Erwig add support for
-%%% keywords etc (see the emails)
-%%%
-%%% * B: If we have as input
-%%%
-%%% \<map
-%%% g\>
-%%%
-%%% there won't be a `\hsap' inserted!! (Can this be solved by using
-%%% \obeylines in \<...\>?)
-%%%
-%%% * B: A \relax is needed after a & if it immediately followed by a \hsbody{}
-%%% (See TeXbook, S.240)
-%%%
-%%% * F: Implement a \hstext{...} as \(\text{...}\).
-%%%
-%%% * F: Star-form of \hscom that uses "---" instead of "-\hskip0pt-"
-%%%
-%%% * We would like hswhere* etc that are like haskell* (\hsalign already
-%%% supports this, ie, there is a \hsalign*).
-%%%
-%%% * Star-Versions of if, let etc that use a single line layout (maybe not
-%%% with star, because of the above).
-%%%
-%%% * Support for enforcing and prohibiting breaks in `haskell' displays.
-%%%
-%%% * Comments in a let-in should be aligned in the same way for the bindings
-%%% and the body.
-%%%
-%%% * It would be nice to have different styles (indentation after in of
-%%% let-in or not) etc; either to be set with a package option or in the
-%%% preamble (the latter probably makes more sense).
-%%%
-%%% * Literate programming facility: Variant of the `haskell' env (maybe
-%%% `hschunk', which is named and can be used in other chunks). But maybe
-%%% it is not necessary to provide a chunk-based reordering mechanism,
-%%% because most of the Haskell stuff can be in any order anyway...
-%%% Important is to provide a way to define visually pleasing layout
-%%% together with the raw Haskell form for program output. (Maybe `haskell*'
-%%% as Haskell env that outputs its contents?)
-%%%
-
-%% Initialization
-%% ==============
-
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{haskell}[2002/02/08 v1.1a Chilli's Haskell Style]
-
-% NOTE: The sole purpose of the following is to work around what I believe is
-% a bug in LaTeX. If the first occurrence of \mathit in a document uses
-% \bgroup and \egroup to enclose the argument (instead of { and }),
-% \mathit does *not* apply to the argument. (I guess, some font
-% initialisation stuff is getting in the way of parsing the argument.)
-%
-% The following forces a \mathit right after \begin{document}.
-%
-% UPDATE: The LaTeX project people say that it isn't really a bug; more
-% like a not supported form. See alternative definition in the
-% bug list above.
-%
-\AtBeginDocument{\setbox0=\hbox{\(\mathit\relax\)}}
-
-
-%% Parameters
-%% ==========
-
-\newskip\hsmargin
-\hsmargin\leftmargini
-
-
-%% Main macros and environments
-%% ============================
-
-% applications
-%
-\newcommand{\hsap}{% % application by juxtaposition
- \unskip\mskip 4mu plus 1mu} % only the last \hsap counts
-
-% commands to start and stop setting spaces as \hsap
-%
-{\obeyspaces\gdef\@hsSpaceToApp{\obeyspaces\let =\hsap}} % spaces matter!!!
-{\obeyspaces\gdef\@hsNormalSpace{\let =\space}}
-
-% commands to start and stop treating numbers specially, ie, we don't want
-% them to be affected by font changing commands in Haskell contexts as this
-% would give italic numerals; the trick is to redefine their math code such
-% that they go into math class 0 and thus don't change families (cf. `The
-% TeXbook', Chapter 17, pp152)
-%
-\newcommand{\@hsRmNumbers}{%
- \mathcode`0="0030
- \mathcode`1="0031
- \mathcode`2="0032
- \mathcode`3="0033
- \mathcode`4="0034
- \mathcode`5="0035
- \mathcode`6="0036
- \mathcode`7="0037
- \mathcode`8="0038
- \mathcode`9="0039
- }
-\newcommand{\@hsNormalNumbers}{%
- \mathcode`0="7030
- \mathcode`1="7031
- \mathcode`2="7032
- \mathcode`3="7033
- \mathcode`4="7034
- \mathcode`5="7035
- \mathcode`6="7036
- \mathcode`7="7037
- \mathcode`8="7038
- \mathcode`9="7039
- }
-
-% Save the bindings of the standard math commands
-%
-% This is somewhat subtle as we want to able to enter the original math mode
-% within Haskell mode and we have to ensure that the different opening
-% commands are matched by the correct versions of the closing commands.
-%
-\let\@hsmathorg=\(
-\let\@hsmathendorg=\)
-\let\hs@crorg=\\
-\newcommand{\@hsmath}{%
- \relax\hbox\bgroup
- \@hsNormalSpace
- \@hsNormalNumbers
- \let\(=\@hsmathorgx
- \let\)=\@hsmathend
- \def\\{\hs@crorg}%
- \@hsmathorg
- }
-\newcommand{\@hsmathend}{%
- \@hsmathendorg
- \egroup
- }
-\newcommand{\@hsmathorgx}{%
- \relax\@hsmathorg
- \let\)=\@hsmathendorg
- }
-
-%% Typesetting of Haskell
-%% ======================
-
-% Inline Haskell phrases are delimited by `\<' and `\>'.
-%
-% Note: `\>' is only locally redefined.
-%
-\newcommand{\<}{%
- \@hsmathorg
- \mathit\bgroup
- \@hsSpaceToApp
- \@hsRmNumbers
- \let\>=\@endhs
- \let\(=\@hsmath
- \def\\{\cr} % for Haskell alignments
- }
-\newcommand{\@endhs}{%
- \egroup
- \@hsmathendorg
- }
-
-% Displayed Haskell (environment `haskell' and `haskell*')
-%
-% There are two kind of preambles for \halign: \hs@preambleNorm is for
-% `amsmath' style alignments and \hs@preambleStar for `equation' style
-% alignments (but with an unbound number of columns to its right)
-%
-% We need #### to get a ## in the \edef building the \halign command.
-%
-% first the preambles (also used in \hs@align below):
-%
-\def\hs@preambleNorm{%
- \noexpand\<####\unskip\noexpand\>\hfil&&\noexpand%
- \<{}####\unskip\noexpand\>\hfil}
-\def\hs@preambleStar{%
- \noexpand\<####\unskip\noexpand\>\hfil&\hfil\noexpand%
- \<{}####\unskip{}\noexpand\>\hfil&&\noexpand\<{}####\noexpand\>\hfil}
-%
-% the environments:
-%
-\newenvironment{haskell}{%
- \@haskell\hs@preambleNorm}{%
- \@endhaskell
- }
-\newenvironment{haskell*}{%
- \@haskell\hs@preambleStar}{%
- \@endhaskell
- }
-%
-% auxiliary definition getting the preamble as its first argument and starting
-% the environment:
-%
-\def\@haskell#1{%
- \bgroup
- \vspace\abovedisplayskip
- \let\(=\@hsmath % Important when `\(' occurs after `&'!
- \edef\@preamble{%
- \halign\bgroup\hskip\hsmargin#1\cr}
- \@preamble
- }
-%
-% Auxiliary definition ending environment:
-%
-\def\@endhaskell{%
- \crcr\egroup
-% \vspace\belowdisplayskip
- \egroup\noindent\ignorespaces\global\@ignoretrue%
- }
-
-% single line comment and keyword style
-%
-\newcommand{\hscom}[1]{%
- \relax\(\quad\textnormal{-\hskip0pt- #1}\)}
-% \relax\(\quad\textnormal{--- #1}\)}
-\newcommand{\hskwd}[1]{%
- \mathbf{#1}}
-
-% informal description
-%
-\newcommand{\hsinf}[1]{%
- \(\langle\textnormal{#1}\rangle\)}
-
-% literals and some special symbols
-%
-\newcommand{\hschar}[1]{\textrm{'#1'}} % character literals
-\newcommand{\hsstr}[1]{\textrm{``#1''}} % strings literals
-\newcommand{\hsfrom}{\leftarrow} % <-
-
-% aligned subphrases
-%
-% check for an optional star and combine prefix (in #1) with one of the two
-% preambles (with star means to center the material between the first and
-% second &)
-%
-\def\hs@align#1{%
- \@ifstar
- {\hs@align@pre{#1\hs@preambleStar}}%
- {\hs@align@pre{#1\hs@preambleNorm}}%
- }
-%
-% test for optional argument; #1: preamble
-%
-\def\hs@align@pre#1{%
- \@testopt{\hs@align@prealign#1}t}
-%
-% got all arguments, now for the real code; #1: preamble; #2: alignment;
-% #3: body (the material set by the \halign)
-%
-\def\hs@align@prealign#1[#2]#3{%
- \relax\(
- \edef\@preamble{%
- \halign\bgroup#1\cr}
- \if #2t\vtop \else \if#2b\vbox \else \vcenter \fi\fi
- \bgroup%
- \@preamble
- #3%
- \crcr\egroup%
- \egroup\)
- }
-%
-% user-level command: alignment without a prefix
-%
-\newcommand{\hsalign}{%
- \relax
- \hs@align\relax%
- }
-
-% subphrase breaking the surrounding alignment being flushed left
-%
-\newcommand{\hsnoalign}[1]{%
- \noalign{%
- \hs@align{\hskip\hsmargin}{#1}%
- }%
- }
-
-% body expression breaking the surrounding alignment
-%
-% * setting \hsmargin to 0pt within the preamble (and _after_ it is used in
-% the preamble) is crucial, as we want \hsmargin only to be applied in
-% _outermost_ alignments
-%
-\newcommand{\hsbody}[1]{%
- {}\\
- \noalign{%
- \hs@align{\hskip\hsmargin\quad\hsmargin0pt}{#1}%
- }%
- }
-
-
-%% Defining commands for use in the Haskell mode
-%% =============================================
-%%
-%% We use some of the low-level machinery defined in LaTeX's source file
-%% `ltdefns.dtx'.
-%%
-%% \hscommand is similar to \newcommand, but there is no *-version.
-%%
-%% We use our own definitions here to insert a strategic `\relax' (see below)
-%% and to obey spaces within the bodies of Haskell definitions.
-
-\newcommand{\hscommand}[1]{\@testopt{\hs@newcommand#1}0}
-\def\hs@newcommand#1[#2]{%
- \obeyspaces % spaces count in Haskell macros
- \@ifnextchar [{\hs@xargdef#1[#2]}%
- {\hs@argdef#1[#2]}}
-
-% All this trouble only to be able to add the `\relax' into the expansion
-% process. If we don't that, commands without optional arguments when
-% invoked after an alignment character & don't work properly (actually, the
-% \obeyspaces doesn't work). I am sure that has to do with the scanning for
-% \omit etc in \halign (TeXbook, p240), but I don't understand yet why it
-% is problematic in this case.
-%
-% Furthermore, we switch off \obeyspaces in the end.
-%
-\long\def\hs@argdef#1[#2]#3{%
- \@ifdefinable#1{%
- \expandafter\def\expandafter#1\expandafter{%
- \relax % in order to stop token expansion after &
- \csname\string#1\expandafter\endcsname}%
- \expandafter\@yargdef
- \csname\string#1\endcsname
- \@ne
- {#2}%
- {#3}}%
- \catcode`\ =10% % stop obeying spaces now
- }
-
-% Switch off \obeyspaces in the end.
-%
-\long\def\hs@xargdef#1[#2][#3]#4{%
- \@ifdefinable#1{%
- \expandafter\def\expandafter#1\expandafter{%
- \expandafter
- \@protected@testopt
- \expandafter
- #1%
- \csname\string#1\expandafter\endcsname
- {#3}}%
- \expandafter\@yargdef
- \csname\string#1\endcsname
- \tw@
- {#2}%
- {#4}}%
- \catcode`\ =10% % stop obeying spaces now
- }
-
-
-%% Abbreviations
-%% =============
-
-% infix operators
-%
-\newcommand{\hsapp}{\mathbin{+\mkern-7mu+}}
-\newcommand{\hsifix}[1]{\mathbin{\string`#1\string`}}
-
-% let expression
-%
-\hscommand{\hslet}[3][t]{%
- \hsalign[#1]{%
- \hskwd{let}\\
- \quad\hsalign{#2}\\
- \hskwd{in}\\
- #3
- }%
- }
-
-% if expression
-%
-\hscommand{\hsif}[4][t]{%
- \hsalign[#1]{%
- \hskwd{if} #2 \hskwd{then}\\
- \quad\hsalign{#3}\\
- \hskwd{else}\\
- \quad\hsalign{#4}%
- }%
- }
-
-% case expression
-%
-\hscommand{\hscase}[3][t]{%
- \hsalign[#1]{%
- \hskwd{case} #2 \hskwd{of}\\
- \quad\hsalign{#3}%
- }%
- }
-
-% where clause
-%
-% * it is important to take the \quad into the preamble, so that nested
-% \noaligns can break it
-%
-\hscommand{\hswhere}[1]{%
- \hsbody{%
- \hskwd{where}\\
- \hs@align{\quad}{#1}%
- }%
- }
-
-% do expression
-%
-\hscommand{\hsdo}[2][t]{%
- \hsalign[#1]{%
- \hskwd{do}\\
- \quad\hsalign{#2}\\
- }%
-}
-
-% class declaration
-%
-\hscommand{\hsclass}[2]{%
- \hskwd{class} #1 \hskwd{where}
- \hsbody{%
- #2
- }%
-}
-
-% instance declaration
-%
-\hscommand{\hsinstance}[2]{%
- \hskwd{instance} #1 \hskwd{where}
- \hsbody{%
- #2
- }%
-}
-
-
-%% Extensions for Distributed Haskell (Goffin)
-%% ===========================================
-%%
-%% These definitions may change in the future.
-
-\hscommand{\hsunif}{\mathbin{:=:}}
-\hscommand{\hsalias}{\mathrel{\sim}}
-\hscommand{\hsoutof}{\twoheadleftarrow}
-\hscommand{\hsinto}{\twoheadrightarrow}
-\hscommand{\hsparc}{\binampersand}
-\hscommand{\hsseq}{\Longrightarrow}
-\hscommand{\hsex}[2]{{\hskwd{ex} #1 \hskwd{in} #2}}
-
-\hscommand{\hsexin}[3][t]{%
- \hsalign[#1]{%
- \hskwd{ex} #2 \hskwd{in}\\
- \quad\hsalign{#3}\\
- }%
- }
-
-\hscommand{\hschoice}[2][t]{%
- \hsalign[#1]{%
- \hskwd{choice}\\
- \quad\hsalign{#2}\\
- }%
- }
-
-
diff --git a/docs/ndp/vect.tex b/docs/ndp/vect.tex
deleted file mode 100644
index bf1e25842b..0000000000
--- a/docs/ndp/vect.tex
+++ /dev/null
@@ -1,363 +0,0 @@
-\documentclass{article}
-\usepackage{haskell}
-
-\hscommand{\vect}[1]{(#1)_v}
-\hscommand{\lift}[2]{(#1)^{\uparrow#2}}
-\hscommand{\liftn}[1]{(#1)^{\uparrow{n}}}
-
-\hscommand{\patype}[1]{\mathsf{patype}\langle#1\rangle}
-\hscommand{\pa}[1]{\mathsf{pa}\langle#1\rangle}
-
-\hscommand{\capp}{\mathbin{{\$}{:}}}
-\hscommand{\cappP}{\mathbin{{\$}{:}^\uparrow}}
-
-\hscommand{\parr}[1]{[{:}{:}#1{:}{:}]}
-\hscommand{\pparr}[1]{[{:}#1{:}]}
-
-\hscommand{\Data}{\hskwd{data}}
-\hscommand{\DataF}{\hskwd{data~family}}
-\hscommand{\DataI}{\hskwd{data~instance}}
-\hscommand{\NewtypeI}{\hskwd{newtype~instance}}
-
-\setlength{\parindent}{0cm}
-
-\begin{document}
-
-\section*{Library}
-
-\subsection*{Parallel arrays}
-
-We distinguish between user-visible, parametric arrays (\<\pparr{\cdot}\>) and
-flattened parallel arrays (\<\parr{\cdot}\>) which are internal to our
-implementation. Operations on the former have purely sequential semantics.
-During vectorisation, they are replaced by parallel arrays and operations.
-
-\begin{haskell}
-\Data \pparr{\alpha} = Array Int \alpha \hscom{or similar} \\
-\DataF \parr{\alpha}
-\end{haskell}
-
-\subsection*{\<PA\> dictionaries}
-
-To avoid problems with using typeclasses in Core, we use explicit records for
-representing dictionaries of type-dependent operations on parallel arrays:
-
-\begin{haskell}
-\Data PA \alpha = & PA \{
- \hsbody{lengthP & :: \parr{\alpha}\to{Int} \\
- replicateP & :: Int\to\alpha\to\parr{\alpha} \\
- \ldots \\ \}}
-\end{haskell}
-
-In vectorised code, polymorphic functions must be supplied with a \<PA\>
-dictionary for each type variable. For instance, \<\Lambda\alpha.e\> turns
-into \<\Lambda\alpha.\lambda{dPA_\alpha}::PA \alpha.e'\>.
-
-For higher-kinded type variables, we expect a function of appropriate type
-which computes the dictionary for a saturated application of the type
-variable from the dictionaries of the arguments. For instance,
-\<\Lambda{m}::{*}\to{*}.e\> turns into
-\<\Lambda{m}::{*}\to{*}.\lambda{dPA_m}::(\forall\alpha::{*}.PA \alpha\to{PA}
-(m a)).e'\>.
-In general, the type of the \<dPA\> argument for a type \<\sigma::\kappa\> is
-given by
-
-\begin{haskell}
-\patype{\sigma:{*}} & = PA \sigma \\
-\patype{\sigma:\kappa_1\to\kappa_2} & =
-\forall\alpha:\kappa_1.\patype{\alpha:\kappa_1}\to\patype{\sigma \alpha:\kappa_2}
-\end{haskell}
-
-For each user-defined or built-in type constructor \<T\> we
-automatically define its dictionary \<dPA_T::\patype{T}\>. Moreover, for every
-in-scope type variable \<\alpha\> we have its dictionary
-\<dPA_\alpha::\patype{\alpha}\>. This allows us to compute the dictionary for
-an arbitrary type as follows:
-
-\begin{haskell}
-\pa{T} & = dPA_T \\
-\pa{\alpha} & = dPA_{\alpha} \\
-\pa{\sigma \phi} & = \pa{\sigma}[\phi] \pa{\phi} \\
-\pa{\forall\alpha::\kappa.\sigma} & =
-\Lambda\alpha::\kappa.\lambda{dPA_{\alpha}}::\patype{\alpha::\kappa}.\pa{\sigma}
-\end{haskell}
-
-\subsection*{Closures}
-
-Closures are represented as follows:
-
-\begin{haskell}
-\Data & Clo \alpha \beta & = \exists\gamma. Clo & (PA \gamma) \gamma
- & (\gamma\to\alpha\to\beta) (\parr{\gamma}\to\parr{\alpha}\to\parr{\beta}) \\
-\DataI & \parr{Clo \alpha \beta} & = \exists\gamma. AClo & (PA \gamma)
- \parr{\gamma}
- & (\gamma\to\alpha\to\beta) (\parr{\gamma}\to\parr{\alpha}\to\parr{\beta})
-\end{haskell}
-
-Closure application is implemented by the following two operators:
-
-\begin{haskell}
-({\capp}) & :: Clo \alpha \beta \to \alpha \to \beta \\
-({\cappP}) & :: \parr{Clo \alpha \beta} \to \parr{\alpha} \to \parr{\beta}
-\end{haskell}
-
-Note that \<({\cappP})\> is effectively the lifted version of \<({\capp})\>.
-
-\subsection*{Flat array representation}
-
-Some important instances of the \<\parr{\cdot}\> family:
-
-\begin{haskell}
-\hskwd{data} & \hskwd{instance} \parr{(\alpha_1,\ldots,\alpha_n)}
- & = ATup_n !Int \parr{\alpha_1} \ldots \parr{\alpha_n} \\
-\hskwd{newtype}~ & \hskwd{instance} \parr{\alpha\to\beta}
- & = AFn (\parr{\alpha}\to\parr{\beta}) \\
-\hskwd{newtype} & \hskwd{instance} \parr{PA \alpha}
- & = APA (PA \alpha)
-\end{haskell}
-
-The last two definitions are discussed later.
-
-\section*{Vectorisation}
-
-\subsection*{Types}
-
-We assume that for each type constructor \<T\>, there exists a vectorised
-version \<T_v\> (which can be the same as \<T\>). In particular, we have
-\begin{haskell}
-({\to}_v) & = Clo \\
-\pparr{\cdot}_v & = \parr{\cdot}
-\end{haskell}
-
-Vectorisation of types is defined as follows:
-
-\begin{haskell}
-\vect{T} & = T_v \\
-\vect{\alpha} & = \alpha \\
-\vect{\sigma \phi} & = \vect{\sigma} \vect{\phi} \\
-\vect{\forall\alpha:\kappa.\sigma} & = \forall\alpha:\kappa.\patype{\alpha:\kappa}\to\vect{\sigma}
-\end{haskell}
-
-\subsection*{Data type declarations}
-
-\begin{haskell}
-\vect{\hskwd{data} T = \overline{C t_1 \ldots t_n}} = \hskwd{data} T_v =
-\overline{C_v \vect{t_1} \ldots \vect{t_n}}
-\end{haskell}
-
-\subsection*{Terms}
-
-We distinguish between local variables (\<x\>) and global variables and
-literals \<c\>. We assume that we have the following typing judgement:
-
-\begin{haskell}
-\Delta,\Gamma\vdash{e}:\sigma
-\end{haskell}
-
-Here, \<\Delta\> assigns types to globals and \<\Gamma\> to locals. Moreover,
-we assume that for each global variable \<c\>, there exists a
-vectorised version \<c_v\>, i.e.,
-
-\begin{haskell}
-c:\sigma\in\Delta \Longrightarrow c_v:\vect{\sigma}\in\Delta
-\end{haskell}
-
-\subsubsection*{Vectorisation}
-
-\begin{haskell}
-\vect{c} & = c_v & c is global \\
-\vect{x} & = x & x is local \\
-\vect{\Lambda\alpha:\kappa.e} & =
-\Lambda\alpha:\kappa.\lambda{dPA_{\alpha}}:\patype{\alpha:\kappa}.\vect{e} \\
-\vect{e[\sigma]} & = \vect{e}[\vect{\sigma}] \pa{\vect{\sigma}} \\
-\vect{e_1 e_2} & = \vect{e_1}\capp\vect{e_2} \\
-\vect{\lambda{x}:\sigma.e} & = Clo \vect{\sigma} \vect{\phi} \tau \pa{\tau}
- (y_1,\dots,y_n) \\
- &
-\quad\quad(\lambda{ys}:\tau.
- \lambda{x}:\vect{\sigma}.
- \hskwd{case} ys \hskwd{of} (y_1,\dots,y_n) \to \vect{e}) \\
- &
-\quad\quad(\lambda{ys}:\parr{\tau}.
- \lambda{x}:\parr{\vect{\sigma}}.
- \hskwd{case} ys \hskwd{of} ATup_n l y_1 \dots y_n \to \lift{e}{l})
-\\
- \hswhere{e has type \phi \\
- \{y_1:\tau_1,\dots,y_n:\tau_n\} & = FVS(e)\setminus{x} \\
- \tau & = (\vect{\tau_1},\dots,\vect{\tau_n})}
-% \\
-% e has type \phi}
-\end{haskell}
-
-Vectorisation maintains the following invariant:
-
-\begin{haskell}
-\Delta,\Gamma\vdash{e}:\sigma \Longrightarrow
- \Delta,\Gamma_v\vdash\vect{e}:\vect{\sigma}
-\end{haskell}
-
-where \<\Gamma_v\> is defined by
-
-\begin{haskell}
-x:\sigma\in\Gamma \Longleftrightarrow x:\vect{\sigma}\in\Gamma_v
-\end{haskell}
-
-\subsubsection*{Lifting}
-\begin{haskell}
-\liftn{c:\sigma} & = replicateP \pa{\vect{\sigma}} n c_v \\
-\liftn{x} & = x \\
-\liftn{\Lambda\alpha:\kappa.e} & =
-\Lambda\alpha:\kappa.\lambda{dPA_{\alpha}}:\patype{\alpha:\kappa}.\liftn{e} \\
-\liftn{e[\sigma]} & = \liftn{e}[\vect{\sigma}] \pa{\vect{\sigma}} \\
-\liftn{e_1 e_2} & = \liftn{e_1} \cappP \liftn{e_2} \\
-\liftn{\lambda{x}:\sigma.e} & = AClo \vect{\sigma} \vect{\phi} \vect{\tau}
- \pa{\vect{\tau}}
- (ATup_n y_1 \dots y_n) \\
- &
-\quad\quad(\lambda{ys}:\vect{\tau}.
- \lambda{x}:\vect{\sigma}.
- \hskwd{case} ys \hskwd{of} (y_1,\dots,y_n) \to \vect{e}) \\
- &
-\quad\quad(\lambda{ys}:\parr{\vect{\tau}}.
- \lambda{x}:\parr{\vect{\sigma}}.
- \hskwd{case} ys \hskwd{of} ATup_n l y_1 \dots y_n \to \lift{e}{l})
- \hswhere{e has type \phi \\
- \{y_1:\tau_1,\dots,y_n:\tau_n\} & = FVS(e)\setminus{x} \\
- \tau & = (\tau_1,\dots,\tau_n)}
-\end{haskell}
-
-Lifting maintains the following invariant:
-
-\begin{haskell}
-\Delta,\Gamma\vdash{e}:\sigma \Longrightarrow
- \Delta,\Gamma^\uparrow\vdash\liftn{e} : \parr{\sigma_v}
-\end{haskell}
-
-where
-
-\begin{haskell}
-x:\sigma\in\Gamma \Longleftrightarrow x:\parr{\vect{\sigma}}\in\Gamma^\uparrow
-\end{haskell}
-
-Note that this is precisely the reason for the \<\parr{\cdot}\> instances for
-\<\alpha\to\beta\> and \<PA \alpha\>. A term of type \<\forall\alpha.\sigma\>
-will be lifted to a term of type
-\<\parr{\forall\alpha.PA \alpha\to\vect{\sigma}}\> which requires the
-instances. Apart from closures, these are the only occurrences of \<({\to})\> in
-the transformed program, however.
-
-
-\section*{What to vectorise?}
-
-An expression is vectorisable if it only mentions globals and type constructors
-which have a vectorised form. When vectorising, we look for maximal
-vectorisable subexpressions and transform those. For instance, assuming that
-\<print\> hasn't been vectorised, in
-
-\begin{haskell}
-main = \hsdo{
- print (sumP \pparr{\ldots}) \\
- print (mapP \ldots \pparr{\ldots})}
-\end{haskell}
-
-we would vectorise the arguments to \<print\>. Note that this implies that we
-never call non-vectorised code from vectorised code (is that a problem?).
-
-Whenever we come out of a vectorised ``bubble'', we have to convert between
-vectorised and unvectorised data types. The examples above would roughly
-translate to
-
-\begin{haskell}
-main = \hsdo{
- print (unvect (sumP_v \parr{\ldots})) \\
- print (unvect (mapP_v \ldots \parr{\ldots}))}
-\end{haskell}
-
-For this, we have to have the following functions:
-
-\begin{haskell}
-vect_\sigma & :: \sigma\to\vect{\sigma} \\
-unvect_\sigma & :: \vect{\sigma}\to\sigma
-\end{haskell}
-
-It is sufficient to have these functions only for a restricted set of types as
-we can always vectorise less if the conversions becomes too complex.
-
-Sometimes, it doesn't make sense to vectorise things. For instance, in
-
-\begin{haskell}
-foo f xs = print (f xs)
-\end{haskell}
-
-we wouldn't vectorise \<f xs\>. Unfortunately, this means that
-\<foo (mapP f) xs\> will be purely sequential.
-
-For each expression, the vectoriser gives one of the following answers.
-
-\begin{tabular}{lp{10cm}}
-\textbf{Yes} &
-the expression can be (and has been) vectorised \\
-\textbf{Maybe} &
-the expression can be vectorised but it doesn't make sense to do so
-unless it is used in a vectrorisable context (e.g., for \<f xs\> in \<foo\>)
-\\
-\textbf{No} &
-the expression can't be vectorised (although parts of it can, so we
-still get back a transformed expression)
-\end{tabular}
-
-\subsection*{Top-level definitions}
-
-For a top-level definition of the form
-
-\begin{haskell}
-f :: \sigma = e
-\end{haskell}
-
-vectorisation proceeds as follows.
-
-\begin{itemize}
-\item If \<e\> can be fully vectorised, we generate
-\begin{haskell}
-f_v :: \vect{\sigma} = \vect{e}
-\end{haskell}
-
-\item If it doesn't always make sense to vectorise \<e\>, i.e., the vectoriser
-returned \textbf{Maybe}, we leave the definition of \<f\> unchanged. Thus, we
-would not change
-\begin{haskell}
-({\$}) = \lambda{f}.\lambda{x}.f x
-\end{haskell}
-but would additionally generate
-\begin{haskell}
-({\$}_v) = Clo \ldots
-\end{haskell}
-
-\item Otherwise (if the vectoriser said \textbf{Yes}) and we have
-\<unconv_\sigma\>, we change the definition of \<f\> to
-\begin{haskell}
-f :: \sigma = unconv_\sigma f_v
-\end{haskell}
-
-\item Otherwise (the vectoriser said \textbf{Yes} but we do not have
-\<unconv_\sigma\> or if \<e\> couldn't be fully vectorised), we change the
-definition of \<f\> to
-\begin{haskell}
-f :: \sigma = e'
-\end{haskell}
-where \<e'\> is obtaining by vectorising \<e\> as much as possible without
-changing its type. For instance, for
-\begin{haskell}
-f = \lambda{g}.\lambda{x}.mapP (\ldots) (g x)
-\end{haskell}
-we would generate
-\begin{haskell}
-f & = \lambda{g}.\lambda{x}.unvect (mapP_v (\ldots) (vect (g x))) \\
-f_v & = Clo \ldots
-\end{haskell}
-assuming we have the necessary conversions but cannot convert functions (i.e.,
-\<g\>).
-\end{itemize}
-
-\end{document}
-
diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst
index dd9af944f0..4e0be937f4 100644
--- a/docs/users_guide/debugging.rst
+++ b/docs/users_guide/debugging.rst
@@ -299,13 +299,6 @@ subexpression elimination pass.
that ``foo`` is not being inlined. You can pass ``-dinline-check foo`` and
you will see a report about why ``foo`` is not inlined.
-
-.. ghc-flag:: -ddump-vect
- :shortdesc: Dump vectoriser input and output
- :type: dynamic
-
- Dumps the output of the vectoriser.
-
.. ghc-flag:: -ddump-simpl
:shortdesc: Dump final simplifier output
:type: dynamic
@@ -351,12 +344,6 @@ subexpression elimination pass.
Dump "occurrence analysis" output
-.. ghc-flag:: -ddump-vt-trace
- :shortdesc: Trace vectoriser
- :type: dynamic
-
- Make the vectoriser be *real* chatty about what it is up to.
-
.. ghc-flag:: -ddump-prep
:shortdesc: Dump prepared core
:type: dynamic
diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst
index d8eaab9419..bb31b0783a 100644
--- a/docs/users_guide/extending_ghc.rst
+++ b/docs/users_guide/extending_ghc.rst
@@ -352,7 +352,7 @@ Core plugins in more detail
``CoreToDo`` is effectively a data type that describes all the kinds of
optimization passes GHC does on Core. There are passes for
-simplification, CSE, vectorisation, etc. There is a specific case for
+simplification, CSE, etc. There is a specific case for
plugins, ``CoreDoPluginPass :: String -> PluginPass -> CoreToDo`` which
should be what you always use when inserting your own pass into the
pipeline. The first parameter is the name of the plugin, and the second
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index a705512114..b00d75f6a7 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -1228,7 +1228,6 @@ Parallel List Comprehensions
.. extension:: ParallelListComp
:shortdesc: Enable parallel list comprehensions.
- Implied by :extension:`ParallelArrays`.
:since: 6.8.1
diff --git a/docs/users_guide/parallel.rst b/docs/users_guide/parallel.rst
index f334e1be38..fea8fa4a57 100644
--- a/docs/users_guide/parallel.rst
+++ b/docs/users_guide/parallel.rst
@@ -156,13 +156,3 @@ from the ``Control.Parallel.Strategies`` module in the `parallel
package <http://hackage.haskell.org/package/parallel>`__. This module
builds functionality around ``par``, expressing more elaborate patterns
of parallel computation, such as parallel ``map``.
-
-.. _dph:
-
-Data Parallel Haskell
----------------------
-
-GHC includes experimental support for Data Parallel Haskell (DPH). This
-code is highly unstable and is only provided as a technology preview.
-More information can be found on the corresponding
-`DPH wiki page <http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell>`__.
diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst
index 59edcdc320..da066e158c 100644
--- a/docs/users_guide/using-optimisation.rst
+++ b/docs/users_guide/using-optimisation.rst
@@ -88,20 +88,6 @@ So, for example, ``ghc -c Foo.hs``
runtime or space *worse* if you're unlucky. They are normally turned
on or off individually.
-.. ghc-flag:: -Odph
- :shortdesc: Enable level 2 optimisations, set
- ``-fmax-simplifier-iterations=20``
- and ``-fsimplifier-phases=3``.
- :type: dynamic
- :category: optimization-levels
-
- .. index::
- single: optimise; DPH
-
- Enables all ``-O2`` optimisation, sets
- ``-fmax-simplifier-iterations=20`` and ``-fsimplifier-phases=3``.
- Designed for use with :ref:`Data Parallel Haskell (DPH) <dph>`.
-
We don't use a ``-O*`` flag for day-to-day work. We use ``-O`` to get
respectable speed; e.g., when we want to measure something. When we want
to go for broke, we tend to use ``-O2`` (and we go for lots of coffee
@@ -1147,41 +1133,3 @@ by saying ``-fno-wombat``.
if a function definition will be inlined *at a call site*. The other option
determines if a function definition will be kept around at all for
potential inlining.
-
-.. ghc-flag:: -fvectorisation-avoidance
- :shortdesc: Enable vectorisation avoidance. Always enabled by default.
- :type: dynamic
- :reverse: -fno-vectorisation-avoidance
- :category:
-
- :default: on
-
- .. index::
- single: -fvectorisation-avoidance
-
- Part of :ref:`Data Parallel Haskell (DPH) <dph>`.
-
- Enable the *vectorisation* avoidance optimisation.
- This optimisation only works when used in combination with the
- ``-fvectorise`` transformation.
-
- While vectorisation of code using DPH is often a big win, it can
- also produce worse results for some kinds of code. This optimisation
- modifies the vectorisation transformation to try to determine if a
- function would be better of unvectorised and if so, do just that.
-
-.. ghc-flag:: -fvectorise
- :shortdesc: Enable vectorisation of nested data parallelism
- :type: dynamic
- :reverse: -fno-vectorise
- :category:
-
- :default: off
-
- Part of :ref:`Data Parallel Haskell (DPH) <dph>`.
-
- Enable the *vectorisation* optimisation
- transformation. This optimisation transforms the nested data
- parallelism code of programs using DPH into flat data parallelism.
- Flat data parallel programs should have better load balancing,
- enable SIMD parallelism and friendlier cache behaviour.
diff --git a/ghc.mk b/ghc.mk
index 4456bc3d03..206643020f 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -481,11 +481,6 @@ ifeq "$(CrossCompiling) $(Stage1Only)" "NO NO"
define addExtraPackage
ifeq "$2" "-"
# Do nothing; this package is already handled above
-else ifeq "$2" "dph"
-ifeq "$$(BUILD_DPH) $$(GhcProfiled)" "YES NO"
-# The DPH packages need TH, which is incompatible with a profiled GHC.
-PACKAGES_STAGE2 += $1
-endif
else ifeq "$2" "extra"
ifeq "$$(BUILD_EXTRA_PKGS)" "YES"
PACKAGES_STAGE2 += $1
@@ -662,13 +657,6 @@ ifneq "$(CLEANING)" "YES"
BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE2))
BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE1))
BUILD_DIRS += $(patsubst %, libraries/%, $(filter-out $(PACKAGES_STAGE1),$(PACKAGES_STAGE0)))
-ifeq "$(BUILD_DPH)" "YES"
-# Note: `$(eval $(call foreachLibrary,addExtraPackage))` above adds the
-# packages listed in `libraries/dph/ghc-packages` (e.g. dph-base) to
-# PACKAGES_STAGE2. But not 'libraries/dph' itself (it doesn't have a cabal
-# file). Since it does have a ghc.mk file, we add it to BUILD_DIRS here.
-BUILD_DIRS += $(wildcard libraries/dph)
-endif
endif
BUILD_DIRS += libraries/integer-gmp/gmp
@@ -792,8 +780,7 @@ endif
ifneq "$(BINDIST)" "YES"
# Make sure we have all the GHCi libs by the time we've built
-# ghc-stage2. DPH includes a bit of Template Haskell which needs the
-# GHCi libs, and we don't have a better way to express that dependency.
+# ghc-stage2.
#
GHCI_LIBS = $(foreach lib,$(PACKAGES_STAGE1),$(libraries/$(lib)_dist-install_GHCI_LIB)) \
$(compiler_stage2_GHCI_LIB)
@@ -1082,10 +1069,6 @@ $(eval $(call bindist-list,.,\
bindist.mk \
libraries/gen_contents_index \
libraries/prologue.txt \
- $(wildcard libraries/dph/LICENSE \
- libraries/dph/ghc-packages \
- libraries/dph/ghc-packages2 \
- libraries/dph/ghc-stage2-package) \
))
endif
# mk/project.mk gets an absolute path, so we manually include it in
@@ -1231,7 +1214,7 @@ GIT_COMMIT_ID:
sdist-ghc-prep-tree : VERSION GIT_COMMIT_ID
# Extra packages which shouldn't be in the source distribution: see #8801
-EXTRA_PACKAGES=parallel random primitive vector dph
+EXTRA_PACKAGES=parallel random
.PHONY: sdist-ghc-prep-tree
sdist-ghc-prep-tree :
diff --git a/libraries/base/GHC/PArr.hs b/libraries/base/GHC/PArr.hs
deleted file mode 100644
index 67d25bcb85..0000000000
--- a/libraries/base/GHC/PArr.hs
+++ /dev/null
@@ -1,37 +0,0 @@
-{-# LANGUAGE Trustworthy #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE ParallelArrays, MagicHash #-}
-{-# OPTIONS_GHC -funbox-strict-fields #-}
-{-# OPTIONS_HADDOCK hide #-}
-
------------------------------------------------------------------------------
--- |
--- Module : GHC.PArr
--- Copyright : (c) 2001-2011 The Data Parallel Haskell team
--- License : see libraries/base/LICENSE
---
--- Maintainer : cvs-ghc@haskell.org
--- Stability : internal
--- Portability : non-portable (GHC Extensions)
---
--- BIG UGLY HACK: The desugarer special cases this module. Despite the uses of '-XParallelArrays',
--- the desugarer does not load 'Data.Array.Parallel' into its global state. (Hence,
--- the present module may not use any other piece of '-XParallelArray' syntax.)
---
--- This will be cleaned up when we change the internal represention of '[::]' to not
--- rely on a wired-in type constructor.
-
-module GHC.PArr where
-
-import GHC.Base
-
--- Representation of parallel arrays
---
--- Vanilla representation of parallel Haskell based on standard GHC arrays that is used if the
--- vectorised is /not/ used.
---
--- NB: This definition *must* be kept in sync with `TysWiredIn.parrTyCon'!
---
-data [::] e = PArr !Int (Array# e)
-
-type PArr = [::] -- this synonym is to get access to '[::]' without using the special syntax
diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal
index 905bc49471..1d439be322 100644
--- a/libraries/base/base.cabal
+++ b/libraries/base/base.cabal
@@ -263,7 +263,6 @@ Library
GHC.Num
GHC.OldList
GHC.OverloadedLabels
- GHC.PArr
GHC.Pack
GHC.Profiling
GHC.Ptr
diff --git a/libraries/dph b/libraries/dph
deleted file mode 160000
-Subproject 64eca669f13f4d216af9024474a3fc73ce10179
diff --git a/libraries/primitive b/libraries/primitive
deleted file mode 160000
-Subproject 53f72ce69a4dfde5345cf5809a8b4a199352336
diff --git a/libraries/vector b/libraries/vector
deleted file mode 160000
-Subproject 224eccbac0125b7bd302f24063bbb473b2c2e1d
diff --git a/packages b/packages
index 69aed70839..94dad9e137 100644
--- a/packages
+++ b/packages
@@ -12,7 +12,6 @@
# The repos are of several kinds:
# - The main GHC source repo
# - Each boot package lives in a repo
-# - DPH is a repo that contains several packages
# - Haddock and hsc2hs are applications, built on top of GHC,
# and in turn needed to bootstrap GHC
# - ghc-tarballs is need to build GHC
@@ -29,7 +28,7 @@
# GitHub and GHC developers are granted push-rights for are denoted by
# being specified with the `ssh://` scheme. Thus, `https://`
# repo urls denote read-only access.
-# * 'tag', in combination with the variables BUILD_DPH and BUILD_EXTRA_PKGS,
+# * 'tag', in combination with the variable BUILD_EXTRA_PKGS,
# determines which packages are build by default.
#
# Lines that start with a '#' are comments.
@@ -67,7 +66,4 @@ nofib nofib - -
libraries/parallel extra - ssh://git@github.com/haskell/parallel.git
libraries/stm - - ssh://git@github.com/haskell/stm.git
libraries/random extra - https://github.com/haskell/random.git
-libraries/primitive dph - https://github.com/haskell/primitive.git
-libraries/vector dph - https://github.com/haskell/vector.git
-libraries/dph dph - -
. - ghc.git -
diff --git a/testsuite/tests/dph/Makefile b/testsuite/tests/dph/Makefile
deleted file mode 100644
index 9a36a1c5fe..0000000000
--- a/testsuite/tests/dph/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/classes/DefsVect.hs b/testsuite/tests/dph/classes/DefsVect.hs
deleted file mode 100644
index f6ed5544e2..0000000000
--- a/testsuite/tests/dph/classes/DefsVect.hs
+++ /dev/null
@@ -1,53 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS_GHC -fvectorise #-}
-
-module DefsVect where
-
-import Data.Array.Parallel
-
-
--- {-# VECTORISE SCALAR instance Eq Char #-}
--- {-# VECTORISE SCALAR instance Eq Float #-}
--- {-# VECTORISE SCALAR instance Ord Char #-}
--- {-# VECTORISE SCALAR instance Ord Float #-}
-
-
-data MyBool = MyTrue | MyFalse
-
-class Eq a => Cmp a where
- cmp :: a -> a -> Bool
-
--- FIXME:
--- instance Cmp Int where
--- cmp = (==)
-
--- isFive :: (Eq a, Num a) => a -> Bool
-isFive :: Int -> Bool
-isFive x = x == 5
-
-isEq :: Eq a => a -> Bool
-isEq x = x == x
-
-fiveEq :: Int -> Bool
-fiveEq x = isFive x && isEq x
-
-cmpArrs :: PArray Int -> PArray Int -> Bool
-{-# NOINLINE cmpArrs #-}
-cmpArrs v w = cmpArrs' (fromPArrayP v) (fromPArrayP w)
-
-cmpArrs' :: [:Int:] -> [:Int:] -> Bool
-cmpArrs' xs ys = andP [:x == y | x <- xs | y <- ys:]
-
-isFives :: PArray Int -> Bool
-{-# NOINLINE isFives #-}
-isFives xs = isFives' (fromPArrayP xs)
-
-isFives' :: [:Int:] -> Bool
-isFives' xs = andP (mapP isFive xs)
-
-isEqs :: PArray Int -> Bool
-{-# NOINLINE isEqs #-}
-isEqs xs = isEqs' (fromPArrayP xs)
-
-isEqs' :: [:Int:] -> Bool
-isEqs' xs = andP (mapP isEq xs)
diff --git a/testsuite/tests/dph/classes/Main.hs b/testsuite/tests/dph/classes/Main.hs
deleted file mode 100644
index 471c0cc8e0..0000000000
--- a/testsuite/tests/dph/classes/Main.hs
+++ /dev/null
@@ -1,15 +0,0 @@
-module Main where
-
-import Data.Array.Parallel.PArray (PArray, fromList)
-
-import DefsVect
-
-main
- = let v = fromList [1..10]
- w = fromList [11..20]
- in
- print $ [ fiveEq 5
- , cmpArrs v w
- , isFives (fromList $ replicate 10 5)
- , isEqs v
- ]
diff --git a/testsuite/tests/dph/classes/Makefile b/testsuite/tests/dph/classes/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/classes/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/classes/dph-classes-copy-fast.stdout b/testsuite/tests/dph/classes/dph-classes-copy-fast.stdout
deleted file mode 100644
index bf8e7b9e4b..0000000000
--- a/testsuite/tests/dph/classes/dph-classes-copy-fast.stdout
+++ /dev/null
@@ -1 +0,0 @@
-[True,False,True,True]
diff --git a/testsuite/tests/dph/classes/dph-classes-vseg-fast.stdout b/testsuite/tests/dph/classes/dph-classes-vseg-fast.stdout
deleted file mode 100644
index bf8e7b9e4b..0000000000
--- a/testsuite/tests/dph/classes/dph-classes-vseg-fast.stdout
+++ /dev/null
@@ -1 +0,0 @@
-[True,False,True,True]
diff --git a/testsuite/tests/dph/classes/dph-classes.T b/testsuite/tests/dph/classes/dph-classes.T
deleted file mode 100644
index acd19ba4b1..0000000000
--- a/testsuite/tests/dph/classes/dph-classes.T
+++ /dev/null
@@ -1,6 +0,0 @@
-
-test('dph-classes-vseg-fast',
- [normal, reqlib('dph-lifted-vseg'), reqlib('dph-prim-par'),
- only_ways(['normal', 'threaded1', 'threaded2'])],
- multimod_compile_and_run,
- ['Main', '-O0 -fno-enable-rewrite-rules -package dph-lifted-vseg'])
diff --git a/testsuite/tests/dph/diophantine/DiophantineVect.hs b/testsuite/tests/dph/diophantine/DiophantineVect.hs
deleted file mode 100644
index 981b9ad62d..0000000000
--- a/testsuite/tests/dph/diophantine/DiophantineVect.hs
+++ /dev/null
@@ -1,39 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise -XParallelListComp #-}
-module DiophantineVect (solution3) where
-
-import Data.Array.Parallel
-import Data.Array.Parallel.Prelude.Int as I
-
-import qualified Prelude as P
-
-solution3'
- = let
- pow x i = productP (replicateP i x)
- primes = [: 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73 :]
- a `cutTo` b = sliceP 0 (lengthP b) a
- sumpri xx = productP [: pow p x | p <- primes `cutTo` xx | x <- xx :]
- distinct xx = productP [: x I.+ 1 | x <- xx :]
-
- series :: [:Int:] -> Int -> [:[:Int:]:]
- series xs n
- | n == 1 = [: [: 0 :] :]
- | otherwise = [: [: x :] +:+ ps
- | x <- xs
- , ps <- series (I.enumFromToP 0 x) (n I.- 1) :]
-
- prob x y
- = let xx = [: (sumpri m ,m)
- | m <- series (I.enumFromToP 1 3) x
- , distinct [: x I.* 2 | x <- m :] > y :]
- i = minIndexP [: a | (a, b) <- xx :]
- in xx !: i
- in
- prob 5 200
-
-solution3 :: (Int, PArray Int)
-{-# NOINLINE solution3 #-}
-solution3
- = let (i, is) = solution3'
- in
- (i, toPArrayP is)
diff --git a/testsuite/tests/dph/diophantine/Main.hs b/testsuite/tests/dph/diophantine/Main.hs
deleted file mode 100644
index 571566ebcb..0000000000
--- a/testsuite/tests/dph/diophantine/Main.hs
+++ /dev/null
@@ -1,42 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-
-import Data.List
-import DiophantineVect
-
-import qualified Data.Array.Parallel.PArray as P
-import Data.Array.Parallel.Prelude
-
-
--- Solution for the 108th Euler problem.
--- From the Haskell Wiki
-solution1
- = let primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73]
- series _ 1 = [[0]]
- series xs n = [x:ps | x <- xs, ps <- series [0..x] (n-1) ]
- distinct = product . map (+1)
- sumpri x = product $ zipWith (^) primes x
-
- prob x y = minimum [ (sumpri m ,m)
- | m <- series [1..3] x
- , (>y) $ distinct $ map (*2) m]
- in prob 5 200
-
-solution2
- = let primes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73]
- series _ 1 = [[0]]
- series xs n = [x:ps | x <- xs, ps <- series [0..x] (n-1) ]
- distinct xx = product [ x + 1 | x <- xx ]
- sumpri xx = product $ zipWith (^) primes xx
-
- prob x y = minimum [ (sumpri m ,m)
- | m <- series [1..3] x
- , (distinct $ map (*2) m) > y ]
- in prob 5 200
-
-
-main
- = do print solution1
- print solution2
- print solution3
-
-
diff --git a/testsuite/tests/dph/diophantine/Makefile b/testsuite/tests/dph/diophantine/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/diophantine/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/diophantine/dph-diophantine-copy-fast.stdout b/testsuite/tests/dph/diophantine/dph-diophantine-copy-fast.stdout
deleted file mode 100644
index 3fe0f66bd1..0000000000
--- a/testsuite/tests/dph/diophantine/dph-diophantine-copy-fast.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-(1260,[2,2,1,1,0])
-(1260,[2,2,1,1,0])
-(1260,fromList<PArray> [2,2,1,1,0])
diff --git a/testsuite/tests/dph/diophantine/dph-diophantine-copy-opt.stdout b/testsuite/tests/dph/diophantine/dph-diophantine-copy-opt.stdout
deleted file mode 100644
index 3fe0f66bd1..0000000000
--- a/testsuite/tests/dph/diophantine/dph-diophantine-copy-opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-(1260,[2,2,1,1,0])
-(1260,[2,2,1,1,0])
-(1260,fromList<PArray> [2,2,1,1,0])
diff --git a/testsuite/tests/dph/diophantine/dph-diophantine.T b/testsuite/tests/dph/diophantine/dph-diophantine.T
deleted file mode 100644
index fbcf565145..0000000000
--- a/testsuite/tests/dph/diophantine/dph-diophantine.T
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-test ('dph-diophantine-copy-fast'
- , [ outputdir('fast')
- , reqlib('dph-lifted-copy')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-copy'])
-
diff --git a/testsuite/tests/dph/dotp/DotPVect.hs b/testsuite/tests/dph/dotp/DotPVect.hs
deleted file mode 100644
index 3fc9084245..0000000000
--- a/testsuite/tests/dph/dotp/DotPVect.hs
+++ /dev/null
@@ -1,15 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise #-}
-module DotPVect ( dotp ) where
-
-import Data.Array.Parallel
-import Data.Array.Parallel.Prelude.Double as D
-
-import qualified Prelude
-
-dotp :: PArray Double -> PArray Double -> Double
-{-# NOINLINE dotp #-}
-dotp v w = dotp' (fromPArrayP v) (fromPArrayP w)
-
-dotp' :: [:Double:] -> [:Double:] -> Double
-dotp' v w = D.sumP (zipWithP (D.*) v w)
diff --git a/testsuite/tests/dph/dotp/Main.hs b/testsuite/tests/dph/dotp/Main.hs
deleted file mode 100644
index 04eb407fc7..0000000000
--- a/testsuite/tests/dph/dotp/Main.hs
+++ /dev/null
@@ -1,54 +0,0 @@
-import DotPVect ( dotp )
-
-import Control.Exception (evaluate)
-import System.Console.GetOpt
-import qualified System.Random as R
-
-import qualified Data.Array.Parallel.Unlifted as U
-import qualified Data.Array.Parallel.PArray as P
-import Data.Array.Parallel.PArray (PArray)
-
-
-
-generateVectorU :: Int -> IO (U.Array Double)
-generateVectorU n =
- do
- let seed = 42742
- let rg = R.mkStdGen seed
- let -- The std random function is too slow to generate really big vectors
- -- with. Instead, we generate a short random vector and repeat that.
- randvec = U.randomRs k (-100, 100) rg
- vec = U.map (\i -> U.index "generateVectorU" randvec (i `mod` k)) (U.enumFromTo 0 (n-1))
- evaluate vec
- return vec
- where
- k = 1000
-
-generateVector :: Int -> IO (PArray Double)
-generateVector n
- = do
- vec <- generateVectorU n
- return $ P.fromUArray vec
-
-generateVectors :: Int -> IO (PArray Double, PArray Double)
-generateVectors n =
- do
- v <- generateVector n
- w <- generateVector n
- return (v,w)
-
-main
- = do -- compute dot product with NDP
- vectors <- generateVectors 100000
- let resultViaNDP = (uncurry dotp) vectors
-
- -- compute with lists
- let (aVecX, aVecY) = vectors
- let vecX = P.toList aVecX
- let vecY = P.toList aVecY
- let resultViaList = sum $ zipWith (*) vecX vecY
-
- -- ignore wibbles in low order bits
- putStr $ (take 12 $ show resultViaNDP) ++ "\n"
- putStr $ (take 12 $ show resultViaList) ++ "\n"
-
diff --git a/testsuite/tests/dph/dotp/Makefile b/testsuite/tests/dph/dotp/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/dotp/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/dotp/dph-dotp-copy-fast.stdout b/testsuite/tests/dph/dotp/dph-dotp-copy-fast.stdout
deleted file mode 100644
index e8f012cbc6..0000000000
--- a/testsuite/tests/dph/dotp/dph-dotp-copy-fast.stdout
+++ /dev/null
@@ -1,2 +0,0 @@
-3.3659625259
-3.3659625259
diff --git a/testsuite/tests/dph/dotp/dph-dotp-copy-opt.stdout b/testsuite/tests/dph/dotp/dph-dotp-copy-opt.stdout
deleted file mode 100644
index e8f012cbc6..0000000000
--- a/testsuite/tests/dph/dotp/dph-dotp-copy-opt.stdout
+++ /dev/null
@@ -1,2 +0,0 @@
-3.3659625259
-3.3659625259
diff --git a/testsuite/tests/dph/dotp/dph-dotp-vseg-fast.stdout b/testsuite/tests/dph/dotp/dph-dotp-vseg-fast.stdout
deleted file mode 100644
index e8f012cbc6..0000000000
--- a/testsuite/tests/dph/dotp/dph-dotp-vseg-fast.stdout
+++ /dev/null
@@ -1,2 +0,0 @@
-3.3659625259
-3.3659625259
diff --git a/testsuite/tests/dph/dotp/dph-dotp-vseg-opt.stdout b/testsuite/tests/dph/dotp/dph-dotp-vseg-opt.stdout
deleted file mode 100644
index e8f012cbc6..0000000000
--- a/testsuite/tests/dph/dotp/dph-dotp-vseg-opt.stdout
+++ /dev/null
@@ -1,2 +0,0 @@
-3.3659625259
-3.3659625259
diff --git a/testsuite/tests/dph/dotp/dph-dotp.T b/testsuite/tests/dph/dotp/dph-dotp.T
deleted file mode 100644
index e49644290a..0000000000
--- a/testsuite/tests/dph/dotp/dph-dotp.T
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-test ('dph-dotp-copy-fast'
- , [ outputdir('copy-fast')
- , reqlib('dph-lifted-copy')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-copy -package dph-prim-par'])
-
-test ('dph-dotp-vseg-fast'
- , [ outputdir('vseg-fast')
- , reqlib('dph-lifted-vseg')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-vseg -package dph-prim-par'])
-
diff --git a/testsuite/tests/dph/enumfromto/EnumFromToP.hs b/testsuite/tests/dph/enumfromto/EnumFromToP.hs
deleted file mode 100644
index f210f21dab..0000000000
--- a/testsuite/tests/dph/enumfromto/EnumFromToP.hs
+++ /dev/null
@@ -1,24 +0,0 @@
--- List enumeration doesn't work for parallel list comprehensions.
---
--- > ghc-stage2: panic! (the 'impossible' happened)
--- > (GHC version 7.7.20130109 for x86_64-unknown-linux):
--- > DsMonad: uninitialised ds_parr_bi
---
--- (I.enumFromToP is a workaround)
-
-{-# LANGUAGE ParallelArrays, ParallelListComp #-}
-{-# OPTIONS -fvectorise #-}
-module EnumFromToP where
-
-import Data.Array.Parallel hiding ((+), (-), (*), (/))
-import Data.Array.Parallel.PArray
-import Data.Array.Parallel.Prelude.Bool as B
-import Data.Array.Parallel.Prelude.Double as D
-import qualified Data.Array.Parallel.Prelude.Int as I
-import qualified Data.Vector as V
-import qualified Prelude as P
-
-
-nums = [: 0 .. 100 :]
-
-
diff --git a/testsuite/tests/dph/enumfromto/Makefile b/testsuite/tests/dph/enumfromto/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/enumfromto/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/enumfromto/dph-enumfromto.T b/testsuite/tests/dph/enumfromto/dph-enumfromto.T
deleted file mode 100644
index ac4d0f0176..0000000000
--- a/testsuite/tests/dph/enumfromto/dph-enumfromto.T
+++ /dev/null
@@ -1,4 +0,0 @@
-test('EnumFromToP',
- [reqlib('dph-lifted-vseg'), reqlib('dph-prim-par'), expect_broken(7736),
- only_ways(['normal', 'threaded1', 'threaded2'])],
- compile, ['-O0 -package dph-lifted-vseg'])
diff --git a/testsuite/tests/dph/modules/ExportList.hs b/testsuite/tests/dph/modules/ExportList.hs
deleted file mode 100644
index 99011e1a97..0000000000
--- a/testsuite/tests/dph/modules/ExportList.hs
+++ /dev/null
@@ -1,33 +0,0 @@
--- Explicit export list
--- Produces error
--- > ghc-stage2: panic! (the 'impossible' happened)
--- > (GHC version 7.7.20130109 for x86_64-unknown-linux):
--- > nameModule solveV{v r3Ep}
--- It is something about internal vs external names.
-
-{-# LANGUAGE ParallelArrays, ParallelListComp #-}
-{-# OPTIONS -fvectorise #-}
-module ExportList (solvePA) where
-
-import Data.Array.Parallel hiding ((+), (-), (*), (/))
-import Data.Array.Parallel.PArray
-import Data.Array.Parallel.Prelude.Bool as B
-import Data.Array.Parallel.Prelude.Double as D
-import qualified Data.Array.Parallel.Prelude.Int as I
-import qualified Data.Vector as V
-import qualified Prelude as P
-
-data NodeV = NodeV Double Double Double [:NodeV:]
-
-{-# NOINLINE solvePA #-}
-solvePA
- :: NodeV -- ^ nodes
- -> Double -- ^ time
- -> PArray Double
-solvePA nodes t = toPArrayP (solveV t)
-
-
-solveV :: Double -> [:Double:]
-solveV t
- = concatP (mapP solveV [: :])
-
diff --git a/testsuite/tests/dph/modules/Makefile b/testsuite/tests/dph/modules/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/modules/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr b/testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr
deleted file mode 100644
index bf6f453f71..0000000000
--- a/testsuite/tests/dph/modules/dph-ExportList-vseg-fast.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-[1 of 1] Compiling ExportList ( ExportList.hs, ExportList.o )
-Warning: vectorisation failure: identityConvTyCon: type constructor contains parallel arrays [::]
- Could NOT call vectorised from original version
- ExportList.solveV :: GHC.Types.Double -> [:GHC.Types.Double:]
-Warning: vectorisation failure: identityConvTyCon: type constructor contains parallel arrays NodeV
- Could NOT call vectorised from original version
- ExportList.solvePA :: ExportList.NodeV
- -> GHC.Types.Double
- -> Data.Array.Parallel.PArray.PData.Base.PArray GHC.Types.Double
diff --git a/testsuite/tests/dph/modules/dph-modules.T b/testsuite/tests/dph/modules/dph-modules.T
deleted file mode 100644
index 6ccac11f30..0000000000
--- a/testsuite/tests/dph/modules/dph-modules.T
+++ /dev/null
@@ -1,4 +0,0 @@
-test('dph-ExportList-vseg-fast',
- [reqlib('dph-lifted-vseg'), reqlib('dph-prim-par'),
- only_ways(['normal', 'threaded1', 'threaded2'])],
- multimod_compile, ['ExportList', '-O0 -package dph-lifted-vseg'])
diff --git a/testsuite/tests/dph/nbody/Body.hs b/testsuite/tests/dph/nbody/Body.hs
deleted file mode 100644
index 8a116993a8..0000000000
--- a/testsuite/tests/dph/nbody/Body.hs
+++ /dev/null
@@ -1,85 +0,0 @@
-{-# LANGUAGE BangPatterns #-}
-
--- | Massful bodies in the simulation.
-module Body
- ( Velocity
- , Accel
- , MassPoint
- , Body
-
- , unitBody
- , massPointOfBody
- , setMassOfBody
- , setAccelOfBody
- , setStartVelOfBody
- , advanceBody)
-where
-import Util
-
-
--- Types ----------------------------------------------------------------------
--- We're using tuples instead of ADTs so we can put them in unboxed vectors.
-
--- | The velocity of a point.
-type Velocity = (Double, Double)
-
--- | The acceleration of a point.
-type Accel = (Double, Double)
-
--- | A point in 2D space with its mass.
-type MassPoint = (Double, Double, Double)
-
--- | Bodies consist of a MassPoint, but also carry their velocity
--- and acceleration between steps of the simulation.
-type Body = (MassPoint, Velocity, Accel)
-
-
--- Body -----------------------------------------------------------------------
--- | Make a body with unit mass and zero vel and acc.
-unitBody :: Double -> Double -> Body
-unitBody x y
- = ((x, y, 1), (0, 0), (0, 0))
-
-
--- | Take the MassPoint of a body.
-massPointOfBody :: Body -> MassPoint
-massPointOfBody (mp, vel, acc)
- = mp
-
-
--- | Set the mass of a body.
-setMassOfBody :: Double -> Body -> Body
-setMassOfBody mass ((x, y, _), vel, acc)
- = ((x, y, mass), vel, acc)
-
-
--- | Set the acceleration of a body.
-setAccelOfBody :: Accel -> Body -> Body
-setAccelOfBody acc' (mp, vel, _)
- = (mp, vel, acc')
-
-
--- | Set the starting velocity of a body.
--- It is set to rotate around the origin, with the speed proportional
--- to the sqrt of the distance from it. This seems to make nice simulations.
-setStartVelOfBody :: Double -> Body -> Body
-setStartVelOfBody startVel (mp@(x, y, mass), vel, acc)
- = let pos = (x, y)
- (x', y') = normaliseV (x, y)
- vel' = (y', -x')
- vel'' = mulSV (sqrt (magV pos) * startVel) vel'
-
- in (mp, vel'', acc)
-
-
--- | Advance a body forwards in time.
-advanceBody :: Double -> Body -> Body
-advanceBody time
- ( (px, py, mass)
- , (vx, vy)
- , acc@(ax, ay))
-
- = ( (px + time * vx, py + time * vy, mass)
- , (vx + time * ax, vy + time * ay)
- , acc)
-
diff --git a/testsuite/tests/dph/nbody/Config.hs b/testsuite/tests/dph/nbody/Config.hs
deleted file mode 100644
index 1fc93a8164..0000000000
--- a/testsuite/tests/dph/nbody/Config.hs
+++ /dev/null
@@ -1,50 +0,0 @@
-
-module Config
- ( Config(..)
- , defaultConfig)
-where
-
--- | Program config
-data Config
- = Config {
- -- What solver to use
- configSolverName :: String
-
- -- System setup
- , configBodyCount :: Int
- , configBodyMass :: Double
- , configTimeStep :: Double
- , configEpsilon :: Double
-
- -- Initial conditions.
- , configStartDiscSize :: Double
- , configStartSpeed :: Double
-
- -- Terminating conditions.
- , configMaxSteps :: Int
-
- -- Dump points to file
- , configDumpFinal :: Maybe FilePath
-
- -- Print points to stdout
- , configPrintFinal :: Bool
-
- -- Print timings to stdout
- , configPrintTimings :: Bool }
-
-
-defaultConfig :: Config
-defaultConfig
- = Config
- { configSolverName = "nested-bh"
- , configBodyCount = 100
- , configBodyMass = 10
- , configTimeStep = 1
- , configEpsilon = 100
- , configStartDiscSize = 50
- , configStartSpeed = 0.5
- , configMaxSteps = 10
- , configDumpFinal = Nothing
- , configPrintFinal = True
- , configPrintTimings = False }
-
diff --git a/testsuite/tests/dph/nbody/Dump.hs b/testsuite/tests/dph/nbody/Dump.hs
deleted file mode 100644
index b436e3c07a..0000000000
--- a/testsuite/tests/dph/nbody/Dump.hs
+++ /dev/null
@@ -1,46 +0,0 @@
-{-# LANGUAGE ScopedTypeVariables #-}
-module Dump
- ( dumpWorld
- , printWorld)
-where
-import Body
-import World
-import System.IO
-import Data.List
-import Text.Printf
-import qualified Data.Vector.Unboxed as V
-
-
--- | Dump the bodies in a world to a file.
-dumpWorld :: World -> FilePath -> IO ()
-dumpWorld world filePath
- = do h <- openFile filePath WriteMode
- mapM_ (hWriteBody h)
- $ V.toList
- $ worldBodies world
- hClose h
-
-
--- | Print the bodies in a world to stdout
-printWorld :: World -> IO ()
-printWorld world
- = do mapM_ (hWriteBody stdout)
- $ V.toList
- $ worldBodies world
-
-
--- | Write a single body to a file.
-hWriteBody :: Handle -> Body -> IO ()
-hWriteBody h ((px, py, mass), (vx, vy), (ax, ay))
- = hPutStrLn h
- $ concat
- $ ( (padRc 8 ' ' $ show mass)
- : " "
- : (intersperse " "
- $ map (\f -> printf "%15.8f" f) [ px, py, vx, vy, ax, ay ]))
-
-
--- | Right justify a doc, padding with a given character.
-padRc :: Int -> Char -> String -> String
-padRc n c str
- = replicate (n - length str) c ++ str
diff --git a/testsuite/tests/dph/nbody/Generate.hs b/testsuite/tests/dph/nbody/Generate.hs
deleted file mode 100644
index 5b700ddec5..0000000000
--- a/testsuite/tests/dph/nbody/Generate.hs
+++ /dev/null
@@ -1,98 +0,0 @@
-{-# LANGUAGE TypeOperators #-}
-module Generate
- ( genPointsUniform
- , genPointsUniformWithSeed
- , genPointsDisc
- , genPointsCombo
- , pointsPArrayOfUArray )
-where
-import Types
-import Randomish
-import qualified Data.Array.Parallel.Unlifted as U
-import qualified Data.Array.Parallel as P
-import qualified Data.Array.Parallel.PArray as P
-import Data.Array.Parallel.PArray (PArray)
-import Control.Exception
-
--- Random points generation
--- IMPORTANT: We use the same seed with the same random generator in all
--- quickhull codes. The asymptotic work complexity of quickhull
--- is between O (N) and O (N^2) depending on the input.
--- To compare benchmark results, they always need to use the same
--- input.
-seed :: Int
-seed = 42742
-
--- | Some uniformly distributed points
-genPointsUniform
- :: Int -- ^ number of points
- -> Double -- ^ minimum coordinate
- -> Double -- ^ maximum coordinate
- -> U.Array (Double, Double)
-
-genPointsUniform n pointMin pointMax
- = let pts = randomishDoubles (n*2) pointMin pointMax seed
- xs = U.extract pts 0 n
- ys = U.extract pts n n
- in U.zip xs ys
-
-
--- | Some uniformly distributed points
-genPointsUniformWithSeed
- :: Int -- ^ seed
- -> Int -- ^ number of points
- -> Double -- ^ minimum coordinate
- -> Double -- ^ maximum coordinate
- -> U.Array (Double, Double)
-
-genPointsUniformWithSeed seed' n pointMin pointMax
- = let pts = randomishDoubles (n*2) pointMin pointMax seed'
- xs = U.extract pts 0 n
- ys = U.extract pts n n
- in U.zip xs ys
-
-
--- | Some points distributed as a disc
-genPointsDisc
- :: Int -- ^ number of points
- -> (Double, Double) -- ^ center of disc
- -> Double -- ^ radius of disc
- -> U.Array (Double, Double)
-
-genPointsDisc n (originX, originY) radiusMax
- = let radius = randomishDoubles n 0 radiusMax seed
- angle = randomishDoubles n (-pi) pi (seed + 1234)
-
- makeXY r a
- = ( originX + r * cos a
- , originY + r * sin a)
-
- in originX `seq` originY `seq` U.zipWith makeXY radius angle
-
-
--- | A point cloud with areas of high and low density
-genPointsCombo
- :: Int -- ^ number of points
- -> U.Array (Double, Double)
-
-genPointsCombo n
- = genPointsDisc (n `div` 5) (250, 250) 200
- U.+:+ genPointsDisc (n `div` 5) (100, 100) 80
- U.+:+ genPointsDisc (n `div` 5) (150, 300) 30
- U.+:+ genPointsDisc (n `div` 5) (500, 120) 30
- U.+:+ genPointsDisc (n `div` 5) (300, 200) 150
-
-
--- | Convert a list of points to a PArray
-pointsPArrayOfUArray
- :: U.Array (Double, Double)
- -> IO (PArray Point)
-
-pointsPArrayOfUArray ps
- = do
- let pts = makePointsPA
- (P.fromUArray (U.fsts ps))
- (P.fromUArray (U.snds ps))
- evaluate $ P.nf pts
- return pts
-
diff --git a/testsuite/tests/dph/nbody/Main.hs b/testsuite/tests/dph/nbody/Main.hs
deleted file mode 100644
index ad2c809a1c..0000000000
--- a/testsuite/tests/dph/nbody/Main.hs
+++ /dev/null
@@ -1,103 +0,0 @@
-{-# LANGUAGE ParallelListComp, BangPatterns #-}
-
-import Config
-import Dump
-import World
-import Body
-import Util
-import Solver
-import Generate
-import Control.Monad
-import Data.Maybe
-import qualified Data.Vector.Unboxed as V
-import qualified Data.Array.Parallel as P
-import qualified Data.Array.Parallel.PArray as P
-
-
-main :: IO ()
-main
- = let config = defaultConfig
- calcAccels = calcAccels_nb
-
- -- Setup initial world
- vPoints = genPointsDisc
- (configBodyCount config)
- (0, 0)
- (configStartDiscSize config)
-
- vBodies = V.map (setStartVelOfBody $ configStartSpeed config)
- $ V.map (setMassOfBody $ configBodyMass config)
- $ V.map (uncurry unitBody)
- $ vPoints
-
- worldStart = World
- { worldBodies = vBodies
- , worldSteps = 0 }
-
- in mainBatch config calcAccels worldStart
-
-
--- | Run the simulation in batch mode.
-mainBatch :: Config -> Solver -> World -> IO ()
-mainBatch config calcAccels worldStart
- = do let world' = mainBatchRun config calcAccels worldStart
- mainEnd (configDumpFinal config)
- (configPrintFinal config)
- world'
-
-
-mainBatchRun config calcAccels worldStart
- = go worldStart
- where go !world
- = let world' = advanceWorld
- (calcAccels $ configEpsilon config)
- (configTimeStep config)
- world
-
- in if worldSteps world' < configMaxSteps config
- then go world'
- else world'
-
-
--- | Called at end of run to dump final world state.
-mainEnd :: Maybe FilePath -- ^ Write final bodies to this file.
- -> Bool -- ^ Print final bodies to stdout
- -> World -- ^ Final world state.
- -> IO ()
-
-mainEnd mDumpFinal printFinal world
- = do -- Dump the final world state to file if requested.
- maybe (return ()) (dumpWorld world) mDumpFinal
- when printFinal (printWorld world)
-
-
--- Solver ---------------------------------------------------------------------
-type Solver = Double -> V.Vector MassPoint -> V.Vector Accel
-
--- | Nested Data Parallelism + Barnes-Hut algorithm.
-calcAccels_nb :: Solver
-calcAccels_nb epsilon mpts
- = let
- -- bounds finding isn't vectorised yet.
- (llx, lly, rux, ruy) = findBounds mpts
-
- mpts' = P.fromList $ V.toList mpts
- accels' = calcAccelsWithBoxPA epsilon llx lly rux ruy mpts'
-
- in V.fromList $ P.toList accels'
-
-
--- | Find the coordinates of the bounding box that contains these points.
-findBounds :: V.Vector MassPoint -> (Double, Double, Double, Double)
-{-# INLINE findBounds #-}
-findBounds bounds
- = V.foldl' acc (x1, y1, x1, y1) bounds
- where
- (x1, y1, _) = bounds V.! 0
-
- acc (!llx, !lly, !rux, !ruy) (x, y, _)
- = let !llx' = min llx x
- !lly' = min lly y
- !rux' = max rux x
- !ruy' = max ruy y
- in (llx', lly', rux', ruy')
diff --git a/testsuite/tests/dph/nbody/Makefile b/testsuite/tests/dph/nbody/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/nbody/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/nbody/Randomish.hs b/testsuite/tests/dph/nbody/Randomish.hs
deleted file mode 100644
index 7aeefa33d8..0000000000
--- a/testsuite/tests/dph/nbody/Randomish.hs
+++ /dev/null
@@ -1,82 +0,0 @@
-{-# LANGUAGE BangPatterns #-}
-
-module Randomish
- ( randomishInts
- , randomishDoubles)
-where
-import Data.Word
-import Data.Vector.Unboxed (Vector)
-import qualified Data.Vector.Unboxed.Mutable as MV
-import qualified Data.Vector.Unboxed as V
-import qualified Data.Vector.Generic as G
-
-
--- | Use the "minimal standard" Lehmer generator to quickly generate some random
--- numbers with reasonable statistical properties. By "reasonable" we mean good
--- enough for games and test data, but not cryptography or anything where the
--- quality of the randomness really matters.
---
--- From "Random Number Generators: Good ones are hard to find"
--- Stephen K. Park and Keith W. Miller.
--- Communications of the ACM, Oct 1988, Volume 31, Number 10.
---
-randomishInts
- :: Int -- Length of vector.
- -> Int -- Minumum value in output.
- -> Int -- Maximum value in output.
- -> Int -- Random seed.
- -> Vector Int -- Vector of random numbers.
-
-randomishInts !len !valMin' !valMax' !seed'
-
- = let -- a magic number (don't change it)
- multiplier :: Word64
- multiplier = 16807
-
- -- a merzenne prime (don't change it)
- modulus :: Word64
- modulus = 2^(31 :: Integer) - 1
-
- -- if the seed is 0 all the numbers in the sequence are also 0.
- seed
- | seed' == 0 = 1
- | otherwise = seed'
-
- !valMin = fromIntegral valMin'
- !valMax = fromIntegral valMax' + 1
- !range = valMax - valMin
-
- {-# INLINE f #-}
- f x = multiplier * x `mod` modulus
- in G.create
- $ do
- vec <- MV.new len
-
- let go !ix !x
- | ix == len = return ()
- | otherwise
- = do let x' = f x
- MV.write vec ix $ fromIntegral $ (x `mod` range) + valMin
- go (ix + 1) x'
-
- go 0 (f $ f $ f $ fromIntegral seed)
- return vec
-
-
--- | Generate some randomish doubles with terrible statistical properties.
--- This is good enough for test data, but not much else.
-randomishDoubles
- :: Int -- Length of vector
- -> Double -- Minimum value in output
- -> Double -- Maximum value in output
- -> Int -- Random seed.
- -> Vector Double -- Vector of randomish doubles.
-
-randomishDoubles !len !valMin !valMax !seed
- = let range = valMax - valMin
-
- mx = 2^(30 :: Integer) - 1
- mxf = fromIntegral mx
- ints = randomishInts len 0 mx seed
-
- in V.map (\n -> valMin + (fromIntegral n / mxf) * range) ints
diff --git a/testsuite/tests/dph/nbody/Solver.hs b/testsuite/tests/dph/nbody/Solver.hs
deleted file mode 100644
index a5545b3f2f..0000000000
--- a/testsuite/tests/dph/nbody/Solver.hs
+++ /dev/null
@@ -1,156 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise #-}
-module Solver
- (calcAccelsWithBoxPA)
-where
-import Data.Array.Parallel
-import Data.Array.Parallel.Prelude.Bool
-import Data.Array.Parallel.Prelude.Double as D
-import qualified Data.Array.Parallel.Prelude.Int as I
-import qualified Prelude
-
-data BoundingBox
- = Box Double -- lower left X
- Double -- lower left Y
- Double -- upper right X
- Double -- upper right Y
-
-data MassPoint
- = MP Double -- pos X
- Double -- pos Y
- Double -- mass
-
-type Accel
- = (Double, Double)
-
-data BHTree
- = BHT Double -- size of cell
- Double -- centroid X
- Double -- centroid Y
- Double -- centroid mass
- [:BHTree:] -- children
-
-
-calcAccelsWithBoxPA
- :: Double
- -> Double -> Double -> Double -> Double
- -> PArray (Double, Double, Double)
- -> PArray (Double, Double)
-
-calcAccelsWithBoxPA epsilon llx lly rux ruy mpts
- = let mpts' = [: MP x y m | (x, y, m) <- fromPArrayP mpts :]
- accs' = calcAccelsWithBox epsilon llx lly rux ruy mpts'
- in toPArrayP accs'
-{-# NOINLINE calcAccelsWithBoxPA #-}
-
--- | Given the extend of a bounding box containing all the points,
--- calculate the accelerations on all of them.
-calcAccelsWithBox
- :: Double
- -> Double -> Double -> Double -> Double
- -> [: MassPoint :]
- -> [: Accel :]
-
-calcAccelsWithBox epsilon llx lly rux ruy mspts
- = accs
- where accs = [: calcAccel epsilon m tree | m <- mspts :]
- tree = buildTree (Box llx lly rux ruy) mspts
-
-
--- | Build the Barnes-Hut quadtree tree.
-buildTree :: BoundingBox -> [: MassPoint :] -> BHTree
-buildTree bb particles
- | lengthP particles I.<= 1 = BHT s x y m emptyP
- | otherwise = BHT s x y m subTrees
- where (MP x y m) = calcCentroid particles
- (boxes, splitPnts) = splitPoints bb particles
- subTrees = [:buildTree bb' ps | (bb', ps) <- zipP boxes splitPnts:]
-
- (Box llx lly rux ruy) = bb
- sx = rux D.- llx
- sy = ruy D.- lly
- s = if sx D.< sy then sx else sy
-
-
--- | Split massPoints according to their locations in the quadrants.
-splitPoints
- :: BoundingBox
- -> [: MassPoint :]
- -> ([:BoundingBox:], [:[: MassPoint :]:])
-
-splitPoints b@(Box llx lly rux ruy) particles
- | noOfPoints I.<= 1 = (singletonP b, singletonP particles)
- | otherwise
- = unzipP [: (b,p) | (b,p) <- zipP boxes splitPars, lengthP p I.> 0:]
- where noOfPoints = lengthP particles
- lls = [: p | p <- particles, inBox b1 p :]
- lus = [: p | p <- particles, inBox b2 p :]
- rus = [: p | p <- particles, inBox b3 p :]
- rls = [: p | p <- particles, inBox b4 p :]
- b1 = Box llx lly midx midy
- b2 = Box llx midy midx ruy
- b3 = Box midx midy rux ruy
- b4 = Box midx lly rux midy
- boxes = singletonP b1 +:+ singletonP b2 +:+ singletonP b3 +:+ singletonP b4
- splitPars = singletonP lls +:+ singletonP lus +:+ singletonP rus +:+ singletonP rls
- (midx, midy) = ((llx D.+ rux) D./ 2.0 , (lly D.+ ruy) D./ 2.0)
-
-
--- | Checks if particle is in box (excluding left and lower border)
-inBox :: BoundingBox -> MassPoint -> Bool
-inBox (Box llx lly rux ruy) (MP px py _)
- = (px D.> llx) && (px D.<= rux) && (py D.> lly) && (py D.<= ruy)
-
-
--- | Calculate the centroid of some points.
-calcCentroid:: [:MassPoint:] -> MassPoint
-calcCentroid mpts
- = MP (sumP xs / mass) (sumP ys / mass) mass
- where mass = sumP [: m | MP _ _ m <- mpts :]
- (xs, ys) = unzipP [: (m D.* x, m D.* y) | MP x y m <- mpts :]
-
-
--- | Calculate the accelleration of a point due to the points in the given tree.
-calcAccel :: Double -> MassPoint -> BHTree -> (Double, Double)
-calcAccel epsilon mpt (BHT s x y m subtrees)
- | lengthP subtrees I.== 0
- = accel epsilon mpt (MP x y m)
-
- | isFar mpt s x y
- = accel epsilon mpt (MP x y m)
-
- | otherwise
- = let (xs, ys) = unzipP [: calcAccel epsilon mpt st | st <- subtrees :]
- in (sumP xs, sumP ys)
-
-
--- | Calculate the acceleration on a point due to some other point.
-accel :: Double -- ^ If the distance between the points is smaller than this
- -- then ignore the forces between them.
- -> MassPoint -- ^ The point being acclerated.
- -> MassPoint -- ^ Neibouring point.
- -> Accel
-
-accel epsilon (MP x1 y1 _) (MP x2 y2 m)
- = (aabs D.* dx D./ r , aabs D.* dy D./ r)
- where rsqr = (dx D.* dx) D.+ (dy D.* dy) D.+ epsilon D.* epsilon
- r = sqrt rsqr
- dx = x1 D.- x2
- dy = y1 D.- y2
- aabs = m D./ rsqr
-
-
--- | If the point is far from a cell in the tree then we can use
--- it's centroid as an approximation of all the points in the region.
-isFar :: MassPoint -- point being accelerated
- -> Double -- size of region
- -> Double -- position of center of mass of cell
- -> Double -- position of center of mass of cell
- -> Bool
-
-isFar (MP x1 y1 m) s x2 y2
- = let dx = x2 D.- x1
- dy = y2 D.- y1
- dist = sqrt (dx D.* dx D.+ dy D.* dy)
- in (s D./ dist) D.< 1
-
diff --git a/testsuite/tests/dph/nbody/Types.hs b/testsuite/tests/dph/nbody/Types.hs
deleted file mode 100644
index 5ebd849a62..0000000000
--- a/testsuite/tests/dph/nbody/Types.hs
+++ /dev/null
@@ -1,52 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise #-}
-
-module Types
- ( Point
- , Line
- , makePoints, makePointsPA
- , xsOf, xsOfPA
- , ysOf, ysOfPA)
-where
-import Data.Array.Parallel
-import Data.Array.Parallel.Prelude.Double
-import qualified Data.Array.Parallel.Prelude.Double as D
-import qualified Prelude as P
-
-type Point = (Double, Double)
-type Line = (Point, Point)
-
--- | Make some points from their components.
-makePoints :: [:Double:] -> [:Double:] -> [:Point:]
-makePoints = zipP
-
-
--- | Make some points from their components, as a `PArray`.
-makePointsPA :: PArray Double -> PArray Double -> PArray Point
-{-# NOINLINE makePointsPA #-}
-makePointsPA xs ys
- = toPArrayP (makePoints (fromPArrayP xs) (fromPArrayP ys))
-
-
--- | Take the x values of some points.
-xsOf :: [:Point:] -> [:Double:]
-xsOf ps = [: x | (x, _) <- ps :]
-
-
--- | Take the x values of some points as a `PArray`.
-xsOfPA :: PArray Point -> PArray Double
-{-# NOINLINE xsOfPA #-}
-xsOfPA ps = toPArrayP (xsOf (fromPArrayP ps))
-
-
--- | Take the y values of some points.
-ysOf :: [:Point:] -> [:Double:]
-ysOf ps = [: y | (_, y) <- ps :]
-
-
--- | Take the y values of some points as a `PArray`.
-ysOfPA :: PArray Point -> PArray Double
-{-# NOINLINE ysOfPA #-}
-ysOfPA ps = toPArrayP (ysOf (fromPArrayP ps))
-
-
diff --git a/testsuite/tests/dph/nbody/Util.hs b/testsuite/tests/dph/nbody/Util.hs
deleted file mode 100644
index 5f78802c83..0000000000
--- a/testsuite/tests/dph/nbody/Util.hs
+++ /dev/null
@@ -1,18 +0,0 @@
-
-module Util
- ( magV
- , mulSV
- , normaliseV)
-where
-
--- | The magnitude of a vector.
-magV :: (Double, Double) -> Double
-magV (x, y) = sqrt (x * x + y * y)
-
--- | Multiply a vector by a scalar.
-mulSV :: Double -> (Double, Double) -> (Double, Double)
-mulSV s (x, y) = (s * x, s * y)
-
--- | Normalise a vector, so it has a magnitude of 1.
-normaliseV :: (Double, Double) -> (Double, Double)
-normaliseV v = mulSV (1 / magV v) v
diff --git a/testsuite/tests/dph/nbody/World.hs b/testsuite/tests/dph/nbody/World.hs
deleted file mode 100644
index d858ffb928..0000000000
--- a/testsuite/tests/dph/nbody/World.hs
+++ /dev/null
@@ -1,47 +0,0 @@
-{-# LANGUAGE BangPatterns #-}
-
-module World
- ( World(..)
- , advanceWorld)
-where
-import Body
-import qualified Data.Vector.Unboxed as V
-
-data World
- = World
- { -- | Bodies in the simulation.
- worldBodies :: !(V.Vector Body)
-
- -- | Number of steps taken in the simulation so far.
- , worldSteps :: !Int }
-
-
--- | Advance the world forward in time.
-advanceWorld
- :: (V.Vector MassPoint -> V.Vector Accel)
- -- ^ Fn to compute accelerations of each point.
- -> Double -- ^ Time step.
- -> World
- -> World
-
-advanceWorld calcAccels timeStep world
- = let -- Calculate the accelerations on each body.
- accels = calcAccels
- $ V.map massPointOfBody
- $ worldBodies world
-
- -- Apply the accelerations to the bodies and advance them.
- bodies' = V.zipWith
- (\body (ax, ay)
- -> advanceBody timeStep
- (setAccelOfBody (-ax, -ay) body))
- (worldBodies world)
- accels
-
- -- Update the world.
- steps' = worldSteps world + 1
-
- in world { worldBodies = bodies'
- , worldSteps = steps' }
-
- \ No newline at end of file
diff --git a/testsuite/tests/dph/nbody/dph-nbody-copy-fast.stdout b/testsuite/tests/dph/nbody/dph-nbody-copy-fast.stdout
deleted file mode 100644
index 69fdd8b303..0000000000
--- a/testsuite/tests/dph/nbody/dph-nbody-copy-fast.stdout
+++ /dev/null
@@ -1,100 +0,0 @@
- 10.0 -7.88876745 14.40403609 0.07781862 1.41725313 0.00728077 -0.00615418
- 10.0 -20.39602554 -5.40256368 -1.56824530 0.67893475 0.01493099 0.00782011
- 10.0 -0.05794753 10.34183386 0.35651327 0.89460951 0.00188899 -0.00356931
- 10.0 -4.75609397 34.74782948 1.61195437 1.87077953 0.00587195 -0.01975082
- 10.0 36.25896362 10.82337782 2.14170846 -1.41319743 -0.02163268 -0.00507727
- 10.0 4.02674361 -9.00872919 0.03617254 -0.88316283 -0.00122400 0.00926493
- 10.0 42.00406508 -40.85785845 -0.76014767 -3.29738763 -0.02191949 0.02332737
- 10.0 -22.63186030 5.80994447 -1.07420146 1.51160117 0.01670201 0.00006355
- 10.0 16.53870540 16.94639077 1.84926442 0.20378411 -0.00879785 -0.00880553
- 10.0 39.92854878 29.06425991 2.88523318 -1.01552251 -0.02189971 -0.01632925
- 10.0 -17.45501954 11.39301477 -0.56641470 1.60906365 0.01371008 -0.00396360
- 10.0 26.25934753 8.00486951 1.85024443 -0.89918952 -0.01562756 -0.00309898
- 10.0 -9.33900099 9.24549389 -0.36060159 1.12461927 0.00801307 -0.00255620
- 10.0 -46.47873679 -28.36980232 -2.92763912 1.44708065 0.02528654 0.01949016
- 10.0 -12.54370842 34.21722863 1.24120256 2.21072951 0.01080973 -0.01869097
- 10.0 -7.14048930 7.10420057 -0.36081624 0.86670872 0.00647863 -0.00118788
- 10.0 -49.88492485 -23.33817148 -2.76602163 1.78294227 0.02720067 0.01682362
- 10.0 -19.81399282 53.52954568 2.07232227 2.65936299 0.01424146 -0.02727658
- 10.0 23.77418551 14.68227128 2.04725863 -0.41772276 -0.01379116 -0.00752371
- 10.0 -5.73673778 8.93192786 -0.16259409 0.97138466 0.00562305 -0.00245174
- 10.0 10.54277542 -1.02674862 0.84834041 -0.44100517 -0.00531874 0.00383461
- 10.0 23.01197723 21.12299112 2.25990543 -0.12607295 -0.01291140 -0.01176114
- 10.0 -44.78532667 12.05197921 -1.02696812 2.77848076 0.02808850 -0.00298275
- 10.0 31.46388060 -49.75461307 -1.52046945 -3.03579919 -0.01637469 0.02786471
- 10.0 24.84943257 -25.92687211 -0.24060772 -2.45045466 -0.01484349 0.01860299
- 10.0 25.91948874 -30.60444211 -0.52684367 -2.60005186 -0.01516185 0.02084074
- 10.0 -10.85946929 20.87407647 0.39902427 1.82589346 0.00972306 -0.01062660
- 10.0 -38.51435867 1.59076858 -1.56374573 2.10935343 0.02533138 0.00325720
- 10.0 48.51766969 -21.77175738 0.49039776 -3.14884736 -0.02642908 0.01352300
- 10.0 5.74566172 46.44110258 2.61301762 1.41963745 -0.00049448 -0.02602402
- 10.0 -22.88917903 -27.97906439 -2.49898486 -0.03157484 0.01438842 0.02110301
- 10.0 31.73261776 -6.28614087 1.21728705 -1.94829313 -0.01955786 0.00624200
- 10.0 4.24232124 19.44671943 1.21964188 1.10199242 -0.00052277 -0.01009959
- 10.0 0.91334970 48.66777413 2.53737735 1.69247032 0.00244742 -0.02680742
- 10.0 10.67139892 31.69558668 2.17625638 0.97201541 -0.00424894 -0.01856619
- 10.0 12.94163719 58.29627746 3.27732262 1.10311871 -0.00411829 -0.03016643
- 10.0 39.19514702 34.09017661 3.04651632 -0.83806079 -0.02092181 -0.01899392
- 10.0 -24.13067759 -32.16302812 -2.68262548 -0.04506858 0.01454248 0.02301772
- 10.0 51.78333979 -13.45956325 1.00920828 -3.03719366 -0.02816357 0.00875884
- 10.0 -18.73188233 -17.30379387 -1.95701398 -0.00677590 0.01307052 0.01538889
- 10.0 24.70514705 -49.06503148 -1.67808526 -2.78661149 -0.01337746 0.02867654
- 10.0 -51.06940692 -15.61458174 -2.46357376 2.08982818 0.02835174 0.01252356
- 10.0 -4.29154911 -29.69366786 -1.77081329 -1.27717018 0.00330457 0.02241695
- 10.0 2.11752441 33.61609431 1.87012243 1.50451828 0.00141129 -0.01940596
- 10.0 37.73902003 -20.32722331 0.42253535 -2.74138534 -0.02210996 0.01412198
- 10.0 18.24940441 16.13909492 1.89723284 0.04723628 -0.00993771 -0.00831431
- 10.0 -0.86685880 -26.00179392 -1.38458807 -1.39913472 0.00136531 0.02041813
- 10.0 -14.99514725 -9.73327401 -1.49412678 0.04580994 0.01096177 0.01022804
- 10.0 7.00887790 1.98168034 0.68812772 0.00896544 -0.00293511 0.00198547
- 10.0 14.82165676 -26.61468332 -0.63832974 -2.10322539 -0.00891726 0.01991691
- 10.0 36.97393038 41.34508248 3.24972457 -0.53759403 -0.01886630 -0.02264741
- 10.0 13.20164819 -5.94173158 0.74976608 -0.99205532 -0.00725503 0.00697320
- 10.0 -27.55525109 11.38230453 -0.82867230 2.04896832 0.02021279 -0.00334846
- 10.0 44.22611452 7.91205992 2.08170876 -1.97441862 -0.02553919 -0.00334242
- 10.0 -30.78228408 -9.00330845 -1.98277752 1.19492292 0.02083894 0.00999898
- 10.0 21.23162596 1.68817791 1.43493089 -0.91572699 -0.01244008 0.00145281
- 10.0 43.83049777 17.41111171 2.48943804 -1.60943360 -0.02478736 -0.00913389
- 10.0 18.27076095 14.11054567 1.82221570 -0.03605102 -0.01008131 -0.00688670
- 10.0 -23.16386718 14.98115804 -0.48627528 2.03701218 0.01725857 -0.00604352
- 10.0 17.66869644 37.69009924 2.68456831 0.61313519 -0.00829888 -0.02182563
- 10.0 -13.13453980 43.06229834 1.74152194 2.32880687 0.01088136 -0.02345547
- 10.0 17.04551969 -8.51968300 0.74199110 -1.36393081 -0.00992090 0.00843742
- 10.0 -12.74957582 2.86610039 -0.88706993 0.76014301 0.01004519 0.00183585
- 10.0 -11.57352997 -3.93218467 -1.08155095 0.15539312 0.00900597 0.00634724
- 10.0 -0.43691930 11.99128730 0.42464351 1.00896428 0.00223775 -0.00474195
- 10.0 -18.84718297 2.59155114 -1.14765946 1.09328119 0.01395275 0.00224813
- 10.0 26.50822037 34.91831202 2.84251996 -0.01459342 -0.01374681 -0.02010543
- 10.0 -1.83862732 -27.40591387 -1.51844281 -1.37417813 0.00190638 0.02119551
- 10.0 -29.61534814 -11.34773579 -2.05992588 1.01365241 0.02001716 0.01147311
- 10.0 -1.58282077 2.69811157 -0.11418406 0.29617314 0.00265977 0.00167764
- 10.0 2.81028701 8.79669118 0.52804717 0.69094215 -0.00005422 -0.00258329
- 10.0 -46.98701557 11.56383052 -1.07690408 2.84555950 0.02883999 -0.00259972
- 10.0 -3.40737443 -56.06838909 -2.91291405 -1.56839602 0.00150420 0.03217266
- 10.0 -19.98158539 39.46428514 1.28835283 2.57214878 0.01493065 -0.02105105
- 10.0 -44.66881930 12.46139603 -1.00158524 2.78765137 0.02804667 -0.00323063
- 10.0 -16.39650937 23.16371517 0.32747014 2.11248239 0.01323682 -0.01177621
- 10.0 21.95611509 7.76064067 1.72075828 -0.61228724 -0.01269236 -0.00269100
- 10.0 -10.50904475 12.60669705 -0.19243723 1.40501570 0.00897813 -0.00484325
- 10.0 -14.30586541 -0.91198946 -1.12740574 0.55739977 0.01090470 0.00440092
- 10.0 -46.00705467 -6.85206507 -2.04591400 2.14319881 0.02767905 0.00814089
- 10.0 30.41289215 -6.97966533 1.15654150 -1.91885498 -0.01852614 0.00680537
- 10.0 -48.27660341 27.60241976 -0.13762372 3.31622222 0.02879885 -0.01161224
- 10.0 -17.74747450 10.50189167 -0.63686673 1.56720699 0.01384037 -0.00328594
- 10.0 54.39641806 -0.37738366 1.72976962 -2.73607215 -0.02940059 0.00129876
- 10.0 6.47050061 -29.43922970 -1.20659479 -1.82090480 -0.00359394 0.02244751
- 10.0 0.58954963 -13.25292294 -0.49482500 -1.03808365 0.00082873 0.01218738
- 10.0 -12.31468078 -40.73604077 -2.60912850 -0.94516629 0.00720515 0.02765879
- 10.0 38.13312568 24.34484548 2.69648135 -1.04260079 -0.02152543 -0.01341969
- 10.0 -13.70564154 27.92937950 0.77625108 2.14221048 0.01158560 -0.01492998
- 10.0 40.53583366 -0.14911602 1.65704468 -2.10583120 -0.02408788 0.00179315
- 10.0 8.39984292 -15.41302717 -0.12676090 -1.44483730 -0.00437128 0.01330585
- 10.0 22.44930397 -38.06973908 -1.11496697 -2.59958621 -0.01287940 0.02515562
- 10.0 47.41809427 3.44198464 1.88610439 -2.29818650 -0.02696432 -0.00068958
- 10.0 27.36675414 46.97814868 3.25532655 0.14568231 -0.01291442 -0.02560627
- 10.0 -10.16897115 -22.40458265 -1.73420047 -0.76737649 0.00741932 0.01846132
- 10.0 40.36029012 -18.88517950 0.55513182 -2.79063722 -0.02344201 0.01302615
- 10.0 -14.39025584 20.54575351 0.21589623 1.94610689 0.01196694 -0.01021320
- 10.0 19.64156343 34.26658662 2.62377284 0.42861126 -0.00976569 -0.01997954
- 10.0 -33.50298072 43.14541702 1.10503992 3.09224158 0.02172220 -0.02121984
- 10.0 -20.79202850 -24.09713162 -2.28882549 -0.07479119 0.01364036 0.01919977
diff --git a/testsuite/tests/dph/nbody/dph-nbody-copy-opt.stdout b/testsuite/tests/dph/nbody/dph-nbody-copy-opt.stdout
deleted file mode 100644
index 69fdd8b303..0000000000
--- a/testsuite/tests/dph/nbody/dph-nbody-copy-opt.stdout
+++ /dev/null
@@ -1,100 +0,0 @@
- 10.0 -7.88876745 14.40403609 0.07781862 1.41725313 0.00728077 -0.00615418
- 10.0 -20.39602554 -5.40256368 -1.56824530 0.67893475 0.01493099 0.00782011
- 10.0 -0.05794753 10.34183386 0.35651327 0.89460951 0.00188899 -0.00356931
- 10.0 -4.75609397 34.74782948 1.61195437 1.87077953 0.00587195 -0.01975082
- 10.0 36.25896362 10.82337782 2.14170846 -1.41319743 -0.02163268 -0.00507727
- 10.0 4.02674361 -9.00872919 0.03617254 -0.88316283 -0.00122400 0.00926493
- 10.0 42.00406508 -40.85785845 -0.76014767 -3.29738763 -0.02191949 0.02332737
- 10.0 -22.63186030 5.80994447 -1.07420146 1.51160117 0.01670201 0.00006355
- 10.0 16.53870540 16.94639077 1.84926442 0.20378411 -0.00879785 -0.00880553
- 10.0 39.92854878 29.06425991 2.88523318 -1.01552251 -0.02189971 -0.01632925
- 10.0 -17.45501954 11.39301477 -0.56641470 1.60906365 0.01371008 -0.00396360
- 10.0 26.25934753 8.00486951 1.85024443 -0.89918952 -0.01562756 -0.00309898
- 10.0 -9.33900099 9.24549389 -0.36060159 1.12461927 0.00801307 -0.00255620
- 10.0 -46.47873679 -28.36980232 -2.92763912 1.44708065 0.02528654 0.01949016
- 10.0 -12.54370842 34.21722863 1.24120256 2.21072951 0.01080973 -0.01869097
- 10.0 -7.14048930 7.10420057 -0.36081624 0.86670872 0.00647863 -0.00118788
- 10.0 -49.88492485 -23.33817148 -2.76602163 1.78294227 0.02720067 0.01682362
- 10.0 -19.81399282 53.52954568 2.07232227 2.65936299 0.01424146 -0.02727658
- 10.0 23.77418551 14.68227128 2.04725863 -0.41772276 -0.01379116 -0.00752371
- 10.0 -5.73673778 8.93192786 -0.16259409 0.97138466 0.00562305 -0.00245174
- 10.0 10.54277542 -1.02674862 0.84834041 -0.44100517 -0.00531874 0.00383461
- 10.0 23.01197723 21.12299112 2.25990543 -0.12607295 -0.01291140 -0.01176114
- 10.0 -44.78532667 12.05197921 -1.02696812 2.77848076 0.02808850 -0.00298275
- 10.0 31.46388060 -49.75461307 -1.52046945 -3.03579919 -0.01637469 0.02786471
- 10.0 24.84943257 -25.92687211 -0.24060772 -2.45045466 -0.01484349 0.01860299
- 10.0 25.91948874 -30.60444211 -0.52684367 -2.60005186 -0.01516185 0.02084074
- 10.0 -10.85946929 20.87407647 0.39902427 1.82589346 0.00972306 -0.01062660
- 10.0 -38.51435867 1.59076858 -1.56374573 2.10935343 0.02533138 0.00325720
- 10.0 48.51766969 -21.77175738 0.49039776 -3.14884736 -0.02642908 0.01352300
- 10.0 5.74566172 46.44110258 2.61301762 1.41963745 -0.00049448 -0.02602402
- 10.0 -22.88917903 -27.97906439 -2.49898486 -0.03157484 0.01438842 0.02110301
- 10.0 31.73261776 -6.28614087 1.21728705 -1.94829313 -0.01955786 0.00624200
- 10.0 4.24232124 19.44671943 1.21964188 1.10199242 -0.00052277 -0.01009959
- 10.0 0.91334970 48.66777413 2.53737735 1.69247032 0.00244742 -0.02680742
- 10.0 10.67139892 31.69558668 2.17625638 0.97201541 -0.00424894 -0.01856619
- 10.0 12.94163719 58.29627746 3.27732262 1.10311871 -0.00411829 -0.03016643
- 10.0 39.19514702 34.09017661 3.04651632 -0.83806079 -0.02092181 -0.01899392
- 10.0 -24.13067759 -32.16302812 -2.68262548 -0.04506858 0.01454248 0.02301772
- 10.0 51.78333979 -13.45956325 1.00920828 -3.03719366 -0.02816357 0.00875884
- 10.0 -18.73188233 -17.30379387 -1.95701398 -0.00677590 0.01307052 0.01538889
- 10.0 24.70514705 -49.06503148 -1.67808526 -2.78661149 -0.01337746 0.02867654
- 10.0 -51.06940692 -15.61458174 -2.46357376 2.08982818 0.02835174 0.01252356
- 10.0 -4.29154911 -29.69366786 -1.77081329 -1.27717018 0.00330457 0.02241695
- 10.0 2.11752441 33.61609431 1.87012243 1.50451828 0.00141129 -0.01940596
- 10.0 37.73902003 -20.32722331 0.42253535 -2.74138534 -0.02210996 0.01412198
- 10.0 18.24940441 16.13909492 1.89723284 0.04723628 -0.00993771 -0.00831431
- 10.0 -0.86685880 -26.00179392 -1.38458807 -1.39913472 0.00136531 0.02041813
- 10.0 -14.99514725 -9.73327401 -1.49412678 0.04580994 0.01096177 0.01022804
- 10.0 7.00887790 1.98168034 0.68812772 0.00896544 -0.00293511 0.00198547
- 10.0 14.82165676 -26.61468332 -0.63832974 -2.10322539 -0.00891726 0.01991691
- 10.0 36.97393038 41.34508248 3.24972457 -0.53759403 -0.01886630 -0.02264741
- 10.0 13.20164819 -5.94173158 0.74976608 -0.99205532 -0.00725503 0.00697320
- 10.0 -27.55525109 11.38230453 -0.82867230 2.04896832 0.02021279 -0.00334846
- 10.0 44.22611452 7.91205992 2.08170876 -1.97441862 -0.02553919 -0.00334242
- 10.0 -30.78228408 -9.00330845 -1.98277752 1.19492292 0.02083894 0.00999898
- 10.0 21.23162596 1.68817791 1.43493089 -0.91572699 -0.01244008 0.00145281
- 10.0 43.83049777 17.41111171 2.48943804 -1.60943360 -0.02478736 -0.00913389
- 10.0 18.27076095 14.11054567 1.82221570 -0.03605102 -0.01008131 -0.00688670
- 10.0 -23.16386718 14.98115804 -0.48627528 2.03701218 0.01725857 -0.00604352
- 10.0 17.66869644 37.69009924 2.68456831 0.61313519 -0.00829888 -0.02182563
- 10.0 -13.13453980 43.06229834 1.74152194 2.32880687 0.01088136 -0.02345547
- 10.0 17.04551969 -8.51968300 0.74199110 -1.36393081 -0.00992090 0.00843742
- 10.0 -12.74957582 2.86610039 -0.88706993 0.76014301 0.01004519 0.00183585
- 10.0 -11.57352997 -3.93218467 -1.08155095 0.15539312 0.00900597 0.00634724
- 10.0 -0.43691930 11.99128730 0.42464351 1.00896428 0.00223775 -0.00474195
- 10.0 -18.84718297 2.59155114 -1.14765946 1.09328119 0.01395275 0.00224813
- 10.0 26.50822037 34.91831202 2.84251996 -0.01459342 -0.01374681 -0.02010543
- 10.0 -1.83862732 -27.40591387 -1.51844281 -1.37417813 0.00190638 0.02119551
- 10.0 -29.61534814 -11.34773579 -2.05992588 1.01365241 0.02001716 0.01147311
- 10.0 -1.58282077 2.69811157 -0.11418406 0.29617314 0.00265977 0.00167764
- 10.0 2.81028701 8.79669118 0.52804717 0.69094215 -0.00005422 -0.00258329
- 10.0 -46.98701557 11.56383052 -1.07690408 2.84555950 0.02883999 -0.00259972
- 10.0 -3.40737443 -56.06838909 -2.91291405 -1.56839602 0.00150420 0.03217266
- 10.0 -19.98158539 39.46428514 1.28835283 2.57214878 0.01493065 -0.02105105
- 10.0 -44.66881930 12.46139603 -1.00158524 2.78765137 0.02804667 -0.00323063
- 10.0 -16.39650937 23.16371517 0.32747014 2.11248239 0.01323682 -0.01177621
- 10.0 21.95611509 7.76064067 1.72075828 -0.61228724 -0.01269236 -0.00269100
- 10.0 -10.50904475 12.60669705 -0.19243723 1.40501570 0.00897813 -0.00484325
- 10.0 -14.30586541 -0.91198946 -1.12740574 0.55739977 0.01090470 0.00440092
- 10.0 -46.00705467 -6.85206507 -2.04591400 2.14319881 0.02767905 0.00814089
- 10.0 30.41289215 -6.97966533 1.15654150 -1.91885498 -0.01852614 0.00680537
- 10.0 -48.27660341 27.60241976 -0.13762372 3.31622222 0.02879885 -0.01161224
- 10.0 -17.74747450 10.50189167 -0.63686673 1.56720699 0.01384037 -0.00328594
- 10.0 54.39641806 -0.37738366 1.72976962 -2.73607215 -0.02940059 0.00129876
- 10.0 6.47050061 -29.43922970 -1.20659479 -1.82090480 -0.00359394 0.02244751
- 10.0 0.58954963 -13.25292294 -0.49482500 -1.03808365 0.00082873 0.01218738
- 10.0 -12.31468078 -40.73604077 -2.60912850 -0.94516629 0.00720515 0.02765879
- 10.0 38.13312568 24.34484548 2.69648135 -1.04260079 -0.02152543 -0.01341969
- 10.0 -13.70564154 27.92937950 0.77625108 2.14221048 0.01158560 -0.01492998
- 10.0 40.53583366 -0.14911602 1.65704468 -2.10583120 -0.02408788 0.00179315
- 10.0 8.39984292 -15.41302717 -0.12676090 -1.44483730 -0.00437128 0.01330585
- 10.0 22.44930397 -38.06973908 -1.11496697 -2.59958621 -0.01287940 0.02515562
- 10.0 47.41809427 3.44198464 1.88610439 -2.29818650 -0.02696432 -0.00068958
- 10.0 27.36675414 46.97814868 3.25532655 0.14568231 -0.01291442 -0.02560627
- 10.0 -10.16897115 -22.40458265 -1.73420047 -0.76737649 0.00741932 0.01846132
- 10.0 40.36029012 -18.88517950 0.55513182 -2.79063722 -0.02344201 0.01302615
- 10.0 -14.39025584 20.54575351 0.21589623 1.94610689 0.01196694 -0.01021320
- 10.0 19.64156343 34.26658662 2.62377284 0.42861126 -0.00976569 -0.01997954
- 10.0 -33.50298072 43.14541702 1.10503992 3.09224158 0.02172220 -0.02121984
- 10.0 -20.79202850 -24.09713162 -2.28882549 -0.07479119 0.01364036 0.01919977
diff --git a/testsuite/tests/dph/nbody/dph-nbody-vseg-fast.stdout b/testsuite/tests/dph/nbody/dph-nbody-vseg-fast.stdout
deleted file mode 100644
index 69fdd8b303..0000000000
--- a/testsuite/tests/dph/nbody/dph-nbody-vseg-fast.stdout
+++ /dev/null
@@ -1,100 +0,0 @@
- 10.0 -7.88876745 14.40403609 0.07781862 1.41725313 0.00728077 -0.00615418
- 10.0 -20.39602554 -5.40256368 -1.56824530 0.67893475 0.01493099 0.00782011
- 10.0 -0.05794753 10.34183386 0.35651327 0.89460951 0.00188899 -0.00356931
- 10.0 -4.75609397 34.74782948 1.61195437 1.87077953 0.00587195 -0.01975082
- 10.0 36.25896362 10.82337782 2.14170846 -1.41319743 -0.02163268 -0.00507727
- 10.0 4.02674361 -9.00872919 0.03617254 -0.88316283 -0.00122400 0.00926493
- 10.0 42.00406508 -40.85785845 -0.76014767 -3.29738763 -0.02191949 0.02332737
- 10.0 -22.63186030 5.80994447 -1.07420146 1.51160117 0.01670201 0.00006355
- 10.0 16.53870540 16.94639077 1.84926442 0.20378411 -0.00879785 -0.00880553
- 10.0 39.92854878 29.06425991 2.88523318 -1.01552251 -0.02189971 -0.01632925
- 10.0 -17.45501954 11.39301477 -0.56641470 1.60906365 0.01371008 -0.00396360
- 10.0 26.25934753 8.00486951 1.85024443 -0.89918952 -0.01562756 -0.00309898
- 10.0 -9.33900099 9.24549389 -0.36060159 1.12461927 0.00801307 -0.00255620
- 10.0 -46.47873679 -28.36980232 -2.92763912 1.44708065 0.02528654 0.01949016
- 10.0 -12.54370842 34.21722863 1.24120256 2.21072951 0.01080973 -0.01869097
- 10.0 -7.14048930 7.10420057 -0.36081624 0.86670872 0.00647863 -0.00118788
- 10.0 -49.88492485 -23.33817148 -2.76602163 1.78294227 0.02720067 0.01682362
- 10.0 -19.81399282 53.52954568 2.07232227 2.65936299 0.01424146 -0.02727658
- 10.0 23.77418551 14.68227128 2.04725863 -0.41772276 -0.01379116 -0.00752371
- 10.0 -5.73673778 8.93192786 -0.16259409 0.97138466 0.00562305 -0.00245174
- 10.0 10.54277542 -1.02674862 0.84834041 -0.44100517 -0.00531874 0.00383461
- 10.0 23.01197723 21.12299112 2.25990543 -0.12607295 -0.01291140 -0.01176114
- 10.0 -44.78532667 12.05197921 -1.02696812 2.77848076 0.02808850 -0.00298275
- 10.0 31.46388060 -49.75461307 -1.52046945 -3.03579919 -0.01637469 0.02786471
- 10.0 24.84943257 -25.92687211 -0.24060772 -2.45045466 -0.01484349 0.01860299
- 10.0 25.91948874 -30.60444211 -0.52684367 -2.60005186 -0.01516185 0.02084074
- 10.0 -10.85946929 20.87407647 0.39902427 1.82589346 0.00972306 -0.01062660
- 10.0 -38.51435867 1.59076858 -1.56374573 2.10935343 0.02533138 0.00325720
- 10.0 48.51766969 -21.77175738 0.49039776 -3.14884736 -0.02642908 0.01352300
- 10.0 5.74566172 46.44110258 2.61301762 1.41963745 -0.00049448 -0.02602402
- 10.0 -22.88917903 -27.97906439 -2.49898486 -0.03157484 0.01438842 0.02110301
- 10.0 31.73261776 -6.28614087 1.21728705 -1.94829313 -0.01955786 0.00624200
- 10.0 4.24232124 19.44671943 1.21964188 1.10199242 -0.00052277 -0.01009959
- 10.0 0.91334970 48.66777413 2.53737735 1.69247032 0.00244742 -0.02680742
- 10.0 10.67139892 31.69558668 2.17625638 0.97201541 -0.00424894 -0.01856619
- 10.0 12.94163719 58.29627746 3.27732262 1.10311871 -0.00411829 -0.03016643
- 10.0 39.19514702 34.09017661 3.04651632 -0.83806079 -0.02092181 -0.01899392
- 10.0 -24.13067759 -32.16302812 -2.68262548 -0.04506858 0.01454248 0.02301772
- 10.0 51.78333979 -13.45956325 1.00920828 -3.03719366 -0.02816357 0.00875884
- 10.0 -18.73188233 -17.30379387 -1.95701398 -0.00677590 0.01307052 0.01538889
- 10.0 24.70514705 -49.06503148 -1.67808526 -2.78661149 -0.01337746 0.02867654
- 10.0 -51.06940692 -15.61458174 -2.46357376 2.08982818 0.02835174 0.01252356
- 10.0 -4.29154911 -29.69366786 -1.77081329 -1.27717018 0.00330457 0.02241695
- 10.0 2.11752441 33.61609431 1.87012243 1.50451828 0.00141129 -0.01940596
- 10.0 37.73902003 -20.32722331 0.42253535 -2.74138534 -0.02210996 0.01412198
- 10.0 18.24940441 16.13909492 1.89723284 0.04723628 -0.00993771 -0.00831431
- 10.0 -0.86685880 -26.00179392 -1.38458807 -1.39913472 0.00136531 0.02041813
- 10.0 -14.99514725 -9.73327401 -1.49412678 0.04580994 0.01096177 0.01022804
- 10.0 7.00887790 1.98168034 0.68812772 0.00896544 -0.00293511 0.00198547
- 10.0 14.82165676 -26.61468332 -0.63832974 -2.10322539 -0.00891726 0.01991691
- 10.0 36.97393038 41.34508248 3.24972457 -0.53759403 -0.01886630 -0.02264741
- 10.0 13.20164819 -5.94173158 0.74976608 -0.99205532 -0.00725503 0.00697320
- 10.0 -27.55525109 11.38230453 -0.82867230 2.04896832 0.02021279 -0.00334846
- 10.0 44.22611452 7.91205992 2.08170876 -1.97441862 -0.02553919 -0.00334242
- 10.0 -30.78228408 -9.00330845 -1.98277752 1.19492292 0.02083894 0.00999898
- 10.0 21.23162596 1.68817791 1.43493089 -0.91572699 -0.01244008 0.00145281
- 10.0 43.83049777 17.41111171 2.48943804 -1.60943360 -0.02478736 -0.00913389
- 10.0 18.27076095 14.11054567 1.82221570 -0.03605102 -0.01008131 -0.00688670
- 10.0 -23.16386718 14.98115804 -0.48627528 2.03701218 0.01725857 -0.00604352
- 10.0 17.66869644 37.69009924 2.68456831 0.61313519 -0.00829888 -0.02182563
- 10.0 -13.13453980 43.06229834 1.74152194 2.32880687 0.01088136 -0.02345547
- 10.0 17.04551969 -8.51968300 0.74199110 -1.36393081 -0.00992090 0.00843742
- 10.0 -12.74957582 2.86610039 -0.88706993 0.76014301 0.01004519 0.00183585
- 10.0 -11.57352997 -3.93218467 -1.08155095 0.15539312 0.00900597 0.00634724
- 10.0 -0.43691930 11.99128730 0.42464351 1.00896428 0.00223775 -0.00474195
- 10.0 -18.84718297 2.59155114 -1.14765946 1.09328119 0.01395275 0.00224813
- 10.0 26.50822037 34.91831202 2.84251996 -0.01459342 -0.01374681 -0.02010543
- 10.0 -1.83862732 -27.40591387 -1.51844281 -1.37417813 0.00190638 0.02119551
- 10.0 -29.61534814 -11.34773579 -2.05992588 1.01365241 0.02001716 0.01147311
- 10.0 -1.58282077 2.69811157 -0.11418406 0.29617314 0.00265977 0.00167764
- 10.0 2.81028701 8.79669118 0.52804717 0.69094215 -0.00005422 -0.00258329
- 10.0 -46.98701557 11.56383052 -1.07690408 2.84555950 0.02883999 -0.00259972
- 10.0 -3.40737443 -56.06838909 -2.91291405 -1.56839602 0.00150420 0.03217266
- 10.0 -19.98158539 39.46428514 1.28835283 2.57214878 0.01493065 -0.02105105
- 10.0 -44.66881930 12.46139603 -1.00158524 2.78765137 0.02804667 -0.00323063
- 10.0 -16.39650937 23.16371517 0.32747014 2.11248239 0.01323682 -0.01177621
- 10.0 21.95611509 7.76064067 1.72075828 -0.61228724 -0.01269236 -0.00269100
- 10.0 -10.50904475 12.60669705 -0.19243723 1.40501570 0.00897813 -0.00484325
- 10.0 -14.30586541 -0.91198946 -1.12740574 0.55739977 0.01090470 0.00440092
- 10.0 -46.00705467 -6.85206507 -2.04591400 2.14319881 0.02767905 0.00814089
- 10.0 30.41289215 -6.97966533 1.15654150 -1.91885498 -0.01852614 0.00680537
- 10.0 -48.27660341 27.60241976 -0.13762372 3.31622222 0.02879885 -0.01161224
- 10.0 -17.74747450 10.50189167 -0.63686673 1.56720699 0.01384037 -0.00328594
- 10.0 54.39641806 -0.37738366 1.72976962 -2.73607215 -0.02940059 0.00129876
- 10.0 6.47050061 -29.43922970 -1.20659479 -1.82090480 -0.00359394 0.02244751
- 10.0 0.58954963 -13.25292294 -0.49482500 -1.03808365 0.00082873 0.01218738
- 10.0 -12.31468078 -40.73604077 -2.60912850 -0.94516629 0.00720515 0.02765879
- 10.0 38.13312568 24.34484548 2.69648135 -1.04260079 -0.02152543 -0.01341969
- 10.0 -13.70564154 27.92937950 0.77625108 2.14221048 0.01158560 -0.01492998
- 10.0 40.53583366 -0.14911602 1.65704468 -2.10583120 -0.02408788 0.00179315
- 10.0 8.39984292 -15.41302717 -0.12676090 -1.44483730 -0.00437128 0.01330585
- 10.0 22.44930397 -38.06973908 -1.11496697 -2.59958621 -0.01287940 0.02515562
- 10.0 47.41809427 3.44198464 1.88610439 -2.29818650 -0.02696432 -0.00068958
- 10.0 27.36675414 46.97814868 3.25532655 0.14568231 -0.01291442 -0.02560627
- 10.0 -10.16897115 -22.40458265 -1.73420047 -0.76737649 0.00741932 0.01846132
- 10.0 40.36029012 -18.88517950 0.55513182 -2.79063722 -0.02344201 0.01302615
- 10.0 -14.39025584 20.54575351 0.21589623 1.94610689 0.01196694 -0.01021320
- 10.0 19.64156343 34.26658662 2.62377284 0.42861126 -0.00976569 -0.01997954
- 10.0 -33.50298072 43.14541702 1.10503992 3.09224158 0.02172220 -0.02121984
- 10.0 -20.79202850 -24.09713162 -2.28882549 -0.07479119 0.01364036 0.01919977
diff --git a/testsuite/tests/dph/nbody/dph-nbody-vseg-opt.stdout b/testsuite/tests/dph/nbody/dph-nbody-vseg-opt.stdout
deleted file mode 100644
index 69fdd8b303..0000000000
--- a/testsuite/tests/dph/nbody/dph-nbody-vseg-opt.stdout
+++ /dev/null
@@ -1,100 +0,0 @@
- 10.0 -7.88876745 14.40403609 0.07781862 1.41725313 0.00728077 -0.00615418
- 10.0 -20.39602554 -5.40256368 -1.56824530 0.67893475 0.01493099 0.00782011
- 10.0 -0.05794753 10.34183386 0.35651327 0.89460951 0.00188899 -0.00356931
- 10.0 -4.75609397 34.74782948 1.61195437 1.87077953 0.00587195 -0.01975082
- 10.0 36.25896362 10.82337782 2.14170846 -1.41319743 -0.02163268 -0.00507727
- 10.0 4.02674361 -9.00872919 0.03617254 -0.88316283 -0.00122400 0.00926493
- 10.0 42.00406508 -40.85785845 -0.76014767 -3.29738763 -0.02191949 0.02332737
- 10.0 -22.63186030 5.80994447 -1.07420146 1.51160117 0.01670201 0.00006355
- 10.0 16.53870540 16.94639077 1.84926442 0.20378411 -0.00879785 -0.00880553
- 10.0 39.92854878 29.06425991 2.88523318 -1.01552251 -0.02189971 -0.01632925
- 10.0 -17.45501954 11.39301477 -0.56641470 1.60906365 0.01371008 -0.00396360
- 10.0 26.25934753 8.00486951 1.85024443 -0.89918952 -0.01562756 -0.00309898
- 10.0 -9.33900099 9.24549389 -0.36060159 1.12461927 0.00801307 -0.00255620
- 10.0 -46.47873679 -28.36980232 -2.92763912 1.44708065 0.02528654 0.01949016
- 10.0 -12.54370842 34.21722863 1.24120256 2.21072951 0.01080973 -0.01869097
- 10.0 -7.14048930 7.10420057 -0.36081624 0.86670872 0.00647863 -0.00118788
- 10.0 -49.88492485 -23.33817148 -2.76602163 1.78294227 0.02720067 0.01682362
- 10.0 -19.81399282 53.52954568 2.07232227 2.65936299 0.01424146 -0.02727658
- 10.0 23.77418551 14.68227128 2.04725863 -0.41772276 -0.01379116 -0.00752371
- 10.0 -5.73673778 8.93192786 -0.16259409 0.97138466 0.00562305 -0.00245174
- 10.0 10.54277542 -1.02674862 0.84834041 -0.44100517 -0.00531874 0.00383461
- 10.0 23.01197723 21.12299112 2.25990543 -0.12607295 -0.01291140 -0.01176114
- 10.0 -44.78532667 12.05197921 -1.02696812 2.77848076 0.02808850 -0.00298275
- 10.0 31.46388060 -49.75461307 -1.52046945 -3.03579919 -0.01637469 0.02786471
- 10.0 24.84943257 -25.92687211 -0.24060772 -2.45045466 -0.01484349 0.01860299
- 10.0 25.91948874 -30.60444211 -0.52684367 -2.60005186 -0.01516185 0.02084074
- 10.0 -10.85946929 20.87407647 0.39902427 1.82589346 0.00972306 -0.01062660
- 10.0 -38.51435867 1.59076858 -1.56374573 2.10935343 0.02533138 0.00325720
- 10.0 48.51766969 -21.77175738 0.49039776 -3.14884736 -0.02642908 0.01352300
- 10.0 5.74566172 46.44110258 2.61301762 1.41963745 -0.00049448 -0.02602402
- 10.0 -22.88917903 -27.97906439 -2.49898486 -0.03157484 0.01438842 0.02110301
- 10.0 31.73261776 -6.28614087 1.21728705 -1.94829313 -0.01955786 0.00624200
- 10.0 4.24232124 19.44671943 1.21964188 1.10199242 -0.00052277 -0.01009959
- 10.0 0.91334970 48.66777413 2.53737735 1.69247032 0.00244742 -0.02680742
- 10.0 10.67139892 31.69558668 2.17625638 0.97201541 -0.00424894 -0.01856619
- 10.0 12.94163719 58.29627746 3.27732262 1.10311871 -0.00411829 -0.03016643
- 10.0 39.19514702 34.09017661 3.04651632 -0.83806079 -0.02092181 -0.01899392
- 10.0 -24.13067759 -32.16302812 -2.68262548 -0.04506858 0.01454248 0.02301772
- 10.0 51.78333979 -13.45956325 1.00920828 -3.03719366 -0.02816357 0.00875884
- 10.0 -18.73188233 -17.30379387 -1.95701398 -0.00677590 0.01307052 0.01538889
- 10.0 24.70514705 -49.06503148 -1.67808526 -2.78661149 -0.01337746 0.02867654
- 10.0 -51.06940692 -15.61458174 -2.46357376 2.08982818 0.02835174 0.01252356
- 10.0 -4.29154911 -29.69366786 -1.77081329 -1.27717018 0.00330457 0.02241695
- 10.0 2.11752441 33.61609431 1.87012243 1.50451828 0.00141129 -0.01940596
- 10.0 37.73902003 -20.32722331 0.42253535 -2.74138534 -0.02210996 0.01412198
- 10.0 18.24940441 16.13909492 1.89723284 0.04723628 -0.00993771 -0.00831431
- 10.0 -0.86685880 -26.00179392 -1.38458807 -1.39913472 0.00136531 0.02041813
- 10.0 -14.99514725 -9.73327401 -1.49412678 0.04580994 0.01096177 0.01022804
- 10.0 7.00887790 1.98168034 0.68812772 0.00896544 -0.00293511 0.00198547
- 10.0 14.82165676 -26.61468332 -0.63832974 -2.10322539 -0.00891726 0.01991691
- 10.0 36.97393038 41.34508248 3.24972457 -0.53759403 -0.01886630 -0.02264741
- 10.0 13.20164819 -5.94173158 0.74976608 -0.99205532 -0.00725503 0.00697320
- 10.0 -27.55525109 11.38230453 -0.82867230 2.04896832 0.02021279 -0.00334846
- 10.0 44.22611452 7.91205992 2.08170876 -1.97441862 -0.02553919 -0.00334242
- 10.0 -30.78228408 -9.00330845 -1.98277752 1.19492292 0.02083894 0.00999898
- 10.0 21.23162596 1.68817791 1.43493089 -0.91572699 -0.01244008 0.00145281
- 10.0 43.83049777 17.41111171 2.48943804 -1.60943360 -0.02478736 -0.00913389
- 10.0 18.27076095 14.11054567 1.82221570 -0.03605102 -0.01008131 -0.00688670
- 10.0 -23.16386718 14.98115804 -0.48627528 2.03701218 0.01725857 -0.00604352
- 10.0 17.66869644 37.69009924 2.68456831 0.61313519 -0.00829888 -0.02182563
- 10.0 -13.13453980 43.06229834 1.74152194 2.32880687 0.01088136 -0.02345547
- 10.0 17.04551969 -8.51968300 0.74199110 -1.36393081 -0.00992090 0.00843742
- 10.0 -12.74957582 2.86610039 -0.88706993 0.76014301 0.01004519 0.00183585
- 10.0 -11.57352997 -3.93218467 -1.08155095 0.15539312 0.00900597 0.00634724
- 10.0 -0.43691930 11.99128730 0.42464351 1.00896428 0.00223775 -0.00474195
- 10.0 -18.84718297 2.59155114 -1.14765946 1.09328119 0.01395275 0.00224813
- 10.0 26.50822037 34.91831202 2.84251996 -0.01459342 -0.01374681 -0.02010543
- 10.0 -1.83862732 -27.40591387 -1.51844281 -1.37417813 0.00190638 0.02119551
- 10.0 -29.61534814 -11.34773579 -2.05992588 1.01365241 0.02001716 0.01147311
- 10.0 -1.58282077 2.69811157 -0.11418406 0.29617314 0.00265977 0.00167764
- 10.0 2.81028701 8.79669118 0.52804717 0.69094215 -0.00005422 -0.00258329
- 10.0 -46.98701557 11.56383052 -1.07690408 2.84555950 0.02883999 -0.00259972
- 10.0 -3.40737443 -56.06838909 -2.91291405 -1.56839602 0.00150420 0.03217266
- 10.0 -19.98158539 39.46428514 1.28835283 2.57214878 0.01493065 -0.02105105
- 10.0 -44.66881930 12.46139603 -1.00158524 2.78765137 0.02804667 -0.00323063
- 10.0 -16.39650937 23.16371517 0.32747014 2.11248239 0.01323682 -0.01177621
- 10.0 21.95611509 7.76064067 1.72075828 -0.61228724 -0.01269236 -0.00269100
- 10.0 -10.50904475 12.60669705 -0.19243723 1.40501570 0.00897813 -0.00484325
- 10.0 -14.30586541 -0.91198946 -1.12740574 0.55739977 0.01090470 0.00440092
- 10.0 -46.00705467 -6.85206507 -2.04591400 2.14319881 0.02767905 0.00814089
- 10.0 30.41289215 -6.97966533 1.15654150 -1.91885498 -0.01852614 0.00680537
- 10.0 -48.27660341 27.60241976 -0.13762372 3.31622222 0.02879885 -0.01161224
- 10.0 -17.74747450 10.50189167 -0.63686673 1.56720699 0.01384037 -0.00328594
- 10.0 54.39641806 -0.37738366 1.72976962 -2.73607215 -0.02940059 0.00129876
- 10.0 6.47050061 -29.43922970 -1.20659479 -1.82090480 -0.00359394 0.02244751
- 10.0 0.58954963 -13.25292294 -0.49482500 -1.03808365 0.00082873 0.01218738
- 10.0 -12.31468078 -40.73604077 -2.60912850 -0.94516629 0.00720515 0.02765879
- 10.0 38.13312568 24.34484548 2.69648135 -1.04260079 -0.02152543 -0.01341969
- 10.0 -13.70564154 27.92937950 0.77625108 2.14221048 0.01158560 -0.01492998
- 10.0 40.53583366 -0.14911602 1.65704468 -2.10583120 -0.02408788 0.00179315
- 10.0 8.39984292 -15.41302717 -0.12676090 -1.44483730 -0.00437128 0.01330585
- 10.0 22.44930397 -38.06973908 -1.11496697 -2.59958621 -0.01287940 0.02515562
- 10.0 47.41809427 3.44198464 1.88610439 -2.29818650 -0.02696432 -0.00068958
- 10.0 27.36675414 46.97814868 3.25532655 0.14568231 -0.01291442 -0.02560627
- 10.0 -10.16897115 -22.40458265 -1.73420047 -0.76737649 0.00741932 0.01846132
- 10.0 40.36029012 -18.88517950 0.55513182 -2.79063722 -0.02344201 0.01302615
- 10.0 -14.39025584 20.54575351 0.21589623 1.94610689 0.01196694 -0.01021320
- 10.0 19.64156343 34.26658662 2.62377284 0.42861126 -0.00976569 -0.01997954
- 10.0 -33.50298072 43.14541702 1.10503992 3.09224158 0.02172220 -0.02121984
- 10.0 -20.79202850 -24.09713162 -2.28882549 -0.07479119 0.01364036 0.01919977
diff --git a/testsuite/tests/dph/nbody/dph-nbody.T b/testsuite/tests/dph/nbody/dph-nbody.T
deleted file mode 100644
index 11ee313882..0000000000
--- a/testsuite/tests/dph/nbody/dph-nbody.T
+++ /dev/null
@@ -1,19 +0,0 @@
-
-test ('dph-nbody-vseg-fast'
- , [ outputdir('vseg-fast')
- , reqlib('dph-lifted-vseg')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-vseg -package dph-prim-par'])
-
-
-test ('dph-nbody-copy-fast'
- , [ outputdir('copy-fast')
- , reqlib('dph-lifted-copy')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -fno-vectorisation-avoidance -package dph-lifted-copy -package dph-prim-par'])
diff --git a/testsuite/tests/dph/primespj/Main.hs b/testsuite/tests/dph/primespj/Main.hs
deleted file mode 100644
index f7a3ed1fe5..0000000000
--- a/testsuite/tests/dph/primespj/Main.hs
+++ /dev/null
@@ -1,30 +0,0 @@
-import Control.Exception (evaluate)
-import System.Console.GetOpt
-
-import Data.Array.Parallel.PArray (PArray)
-import qualified Data.Array.Parallel.PArray as P
-
-import PrimesVect (primesVect)
-import Debug.Trace
-
-
-primesList :: Int -> [Int]
-primesList 1 = []
-primesList n = sps ++ [ i | i <- [sq+1..n], multiple sps i ]
- where
- sps = primesList sq
- sq = floor $ sqrt $ fromIntegral n
-
- multiple :: [Int] -> Int -> Bool
- multiple ps i = and [i `mod` p /= 0 | p <- ps]
-
-
-main
- = do let n = 1000
- let resultViaNDP = P.toList $ primesVect n
- let resultViaLists = primesList n
-
- print resultViaNDP
- print resultViaLists
- print $ resultViaNDP == resultViaLists
-
diff --git a/testsuite/tests/dph/primespj/Makefile b/testsuite/tests/dph/primespj/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/primespj/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/primespj/PrimesVect.hs b/testsuite/tests/dph/primespj/PrimesVect.hs
deleted file mode 100644
index 34b3a568b7..0000000000
--- a/testsuite/tests/dph/primespj/PrimesVect.hs
+++ /dev/null
@@ -1,25 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise #-}
-module PrimesVect (primesVect)
-
-where
-import Data.Array.Parallel
-import Data.Array.Parallel.Prelude.Int
-import qualified Prelude
-
-primesVect:: Int -> PArray Int
-primesVect n = toPArrayP (primesVect' n)
-
-primesVect':: Int -> [:Int:]
-primesVect' n
- | n == 1 = emptyP
- | n == 2 = singletonP 2
- | otherwise = sps +:+ [: i | i <- enumFromToP (sq+1) n, notMultiple sps i:]
- where
-
- sps = primesVect' sq
- sq = sqrt n
-
- notMultiple :: [:Int:] -> Int -> Bool
- notMultiple ps i = andP [: mod i p /= 0 | p <- ps:]
-
diff --git a/testsuite/tests/dph/primespj/dph-primespj-copy-fast.stdout b/testsuite/tests/dph/primespj/dph-primespj-copy-fast.stdout
deleted file mode 100644
index d935f68b11..0000000000
--- a/testsuite/tests/dph/primespj/dph-primespj-copy-fast.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
-[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
-True
diff --git a/testsuite/tests/dph/primespj/dph-primespj-copy-opt.stdout b/testsuite/tests/dph/primespj/dph-primespj-copy-opt.stdout
deleted file mode 100644
index d935f68b11..0000000000
--- a/testsuite/tests/dph/primespj/dph-primespj-copy-opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
-[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
-True
diff --git a/testsuite/tests/dph/primespj/dph-primespj-vseg-fast.stdout b/testsuite/tests/dph/primespj/dph-primespj-vseg-fast.stdout
deleted file mode 100644
index d935f68b11..0000000000
--- a/testsuite/tests/dph/primespj/dph-primespj-vseg-fast.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
-[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
-True
diff --git a/testsuite/tests/dph/primespj/dph-primespj-vseg-opt.stdout b/testsuite/tests/dph/primespj/dph-primespj-vseg-opt.stdout
deleted file mode 100644
index d935f68b11..0000000000
--- a/testsuite/tests/dph/primespj/dph-primespj-vseg-opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
-[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]
-True
diff --git a/testsuite/tests/dph/primespj/dph-primespj.T b/testsuite/tests/dph/primespj/dph-primespj.T
deleted file mode 100644
index 8b45cc80e7..0000000000
--- a/testsuite/tests/dph/primespj/dph-primespj.T
+++ /dev/null
@@ -1,11 +0,0 @@
-
-test ('dph-primespj-copy-fast'
- , [ outputdir('fast')
- , reqlib('dph-lifted-copy')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-copy'])
-
-
diff --git a/testsuite/tests/dph/quickhull/Main.hs b/testsuite/tests/dph/quickhull/Main.hs
deleted file mode 100644
index e1dc04ba24..0000000000
--- a/testsuite/tests/dph/quickhull/Main.hs
+++ /dev/null
@@ -1,43 +0,0 @@
-
-import qualified Types as QH
-import QuickHullVect (quickhull)
-
-import qualified Data.Array.Parallel.Unlifted as U
-import qualified Data.Array.Parallel.Prelude as P
-
-import qualified Data.Array.Parallel.PArray as P
-import Data.Array.Parallel.PArray (PArray)
-
-import System.Environment
-import Data.List
-
-import SVG
-import TestData
-
-
------
-runQuickhull :: PArray QH.Point -> [(Double, Double)]
-runQuickhull pts
- = let result = quickhull pts
- resxs = P.toUArray (QH.xsOf result)
- resys = P.toUArray (QH.ysOf result)
- in U.index "runQuickhull" resxs 0 `seq` (zip (U.toList resxs) (U.toList resys))
-
-
--- Main Program ---------------------------------------------------------------
-main
- = do args <- getArgs
- let n = case args of
- [s] -> read s
- _ -> 1000
-
- paInput <- toPArrayPoints
- $ genPointsCombo n
-
- let psHull = runQuickhull paInput
- psInput = P.toList paInput
-
- putStr
- $ makeSVG
- (roundPoints psInput)
- (roundPoints psHull)
diff --git a/testsuite/tests/dph/quickhull/Makefile b/testsuite/tests/dph/quickhull/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/quickhull/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/quickhull/QuickHullVect.hs b/testsuite/tests/dph/quickhull/QuickHullVect.hs
deleted file mode 100644
index e0ad75858d..0000000000
--- a/testsuite/tests/dph/quickhull/QuickHullVect.hs
+++ /dev/null
@@ -1,41 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise #-}
-
-module QuickHullVect (quickhull) where
-
-import Types
-
-import Data.Array.Parallel
-import Data.Array.Parallel.Prelude.Double as D
-import qualified Data.Array.Parallel.Prelude.Int as Int
-
-import qualified Prelude as P
-
-distance :: Point -> Line -> Double
-distance (xo, yo) ((x1, y1), (x2, y2))
- = (x1 D.- xo) D.* (y2 D.- yo) D.- (y1 D.- yo) D.* (x2 D.- xo)
-
-hsplit :: [:Point:] -> Line -> [:Point:]
-hsplit points line@(p1, p2)
- | lengthP packed Int.< 2 = singletonP p1 +:+ packed
- | otherwise
- = concatP [: hsplit packed ends | ends <- [:(p1, pm), (pm, p2):] :]
- where
- cross = [: distance p line | p <- points :]
- packed = [: p | (p,c) <- zipP points cross, c D.> 0.0 :]
- pm = points !: maxIndexP cross
-
-quickHull' :: [:Point:] -> [:Point:]
-quickHull' points
- | lengthP points Int.== 0 = points
- | otherwise
- = concatP [: hsplit points ends | ends <- [: (minx, maxx), (maxx, minx) :] :]
- where
- xs = [: x | (x, y) <- points :]
- minx = points !: minIndexP xs
- maxx = points !: maxIndexP xs
-
-quickhull :: PArray Point -> PArray Point
-{-# NOINLINE quickhull #-}
-quickhull ps = toPArrayP (quickHull' (fromPArrayP ps))
-
diff --git a/testsuite/tests/dph/quickhull/SVG.hs b/testsuite/tests/dph/quickhull/SVG.hs
deleted file mode 100644
index c750fb06f5..0000000000
--- a/testsuite/tests/dph/quickhull/SVG.hs
+++ /dev/null
@@ -1,34 +0,0 @@
-
-module SVG where
-
--- Making a SVG diagram of the points and hull
-makeSVG :: [(Int, Int)] -> [(Int, Int)] -> String
-makeSVG points hull
- = unlines
- $ [ "<svg width=\"100%\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">" ]
- ++ [svgPolygon hull]
- ++ map svgPoint points
- ++ map svgPointHull hull
- ++ ["</svg>"]
-
-svgPolygon :: [(Int, Int)] -> String
-svgPolygon points
- = "<polygon"
- ++ " points=\"" ++ (concat [show x ++ "," ++ show y ++ " " | (x, y) <- points]) ++ "\""
- ++ " style=\"fill:#d0d0ff;stroke:#000000;stroke-width:1\""
- ++ "/>"
-
-svgPoint :: (Int, Int) -> String
-svgPoint (x, y)
- = "<circle cx=\"" ++ show x ++ "\" cy=\"" ++ show y ++ "\" r=\"0.5\""
- ++ " style=\"stroke:#000000\""
- ++ "/>"
-
-svgPointHull :: (Int, Int) -> String
-svgPointHull (x, y)
- = "<circle cx=\"" ++ show x ++ "\" cy=\"" ++ show y ++ "\" r=\"1\""
- ++ " style=\"stroke:#ff0000\""
- ++ "/>"
-
-roundPoints :: [(Double, Double)] -> [(Int, Int)]
-roundPoints ps = [(round x, round y) | (x, y) <- ps]
diff --git a/testsuite/tests/dph/quickhull/TestData.hs b/testsuite/tests/dph/quickhull/TestData.hs
deleted file mode 100644
index 938c9fea91..0000000000
--- a/testsuite/tests/dph/quickhull/TestData.hs
+++ /dev/null
@@ -1,92 +0,0 @@
-
-module TestData
- ( genPointsUniform
- , genPointsDisc
- , genPointsCombo
- , toPArrayPoints )
-where
-
-import qualified Types as QH
-import qualified Data.Array.Parallel.Unlifted as U
-import qualified Data.Array.Parallel.Prelude as P
-import qualified Data.Array.Parallel.Prelude.Double as D
-import qualified Data.Array.Parallel.PArray as P
-import Data.Array.Parallel.PArray (PArray)
-
-import System.Random
-import Control.Exception
-
--- Random points generation
--- IMPORTANT: We use the same seed with the same random generator in all
--- quickhull codes. The asymptotic work complexity of quickhull
--- is between O (N) and O (N^2) depending on the input.
--- To compare benchmark results, they always need to use the same
--- input.
-seed = 42742
-
--- | Some uniformly distributed points
-genPointsUniform
- :: Int -- ^ number of points
- -> Double -- ^ minimum coordinate
- -> Double -- ^ maximum coordinate
- -> [(Double, Double)]
-
-genPointsUniform n minXY maxXY
- = let
- pointMin = 10
- pointMax = 510
- gen = mkStdGen seed
- in toPairs $ take (2*n) $ randomRs (pointMin, pointMax) gen
-
-toPairs [] = []
-toPairs (x:y:pts) = (x, y) : toPairs pts
-
-
--- | Some points distributed as a disc
-genPointsDisc
- :: Int -- ^ number of points
- -> (Double, Double) -- ^ center of disc
- -> Double -- ^ radius of disc
- -> [(Double, Double)]
-
-genPointsDisc n (originX, originY) radiusMax
- = let (genRadius, genAngle)
- = split $ mkStdGen seed
-
- radius = take n $ randomRs (0, radiusMax) genRadius
- angle = take n $ randomRs (- pi, pi) genAngle
-
- makeXY (r, a)
- = ( originX + r * cos a
- , originY + r * sin a)
-
- in map makeXY $ zip radius angle
-
-
--- | A point cloud with areas of high and low density
-genPointsCombo
- :: Int -- ^ number of points
- -> [(Double, Double)]
-
-genPointsCombo n
- = genPointsDisc (n `div` 5) (250, 250) 200
- ++ genPointsDisc (n `div` 5) (100, 100) 80
- ++ genPointsDisc (n `div` 5) (150, 300) 30
- ++ genPointsDisc (n `div` 5) (500, 120) 30
- ++ genPointsDisc (n `div` 5) (300, 200) 150
-
-
--- | Convert a list of points to a PArray
-toPArrayPoints :: [(Double, Double)] -> IO (PArray QH.Point)
-toPArrayPoints ps
- = do let pts = QH.points (P.fromList (map fst ps))
- (P.fromList (map snd ps))
- evaluate $ force pts
- return pts
-
--- | Force points to be evaluated
-force pts
- = U.index "TestData" (P.toUArray (QH.xsOf pts)) 0 D.+
- U.index "TestData" (P.toUArray (QH.ysOf pts)) 0
-
-
diff --git a/testsuite/tests/dph/quickhull/Types.hs b/testsuite/tests/dph/quickhull/Types.hs
deleted file mode 100644
index 6b19ef1ab3..0000000000
--- a/testsuite/tests/dph/quickhull/Types.hs
+++ /dev/null
@@ -1,33 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise #-}
-
-module Types ( Point, Line, points, xsOf, ysOf) where
-
-import Data.Array.Parallel
-import Data.Array.Parallel.Prelude.Double
-
-type Point = (Double, Double)
-type Line = (Point, Point)
-
-points' :: [:Double:] -> [:Double:] -> [:Point:]
-points' = zipP
-
-points :: PArray Double -> PArray Double -> PArray Point
-{-# NOINLINE points #-}
-points xs ys = toPArrayP (points' (fromPArrayP xs) (fromPArrayP ys))
-
-xsOf' :: [:Point:] -> [:Double:]
-xsOf' ps = [: x | (x, _) <- ps :]
-
-xsOf :: PArray Point -> PArray Double
-{-# NOINLINE xsOf #-}
-xsOf ps = toPArrayP (xsOf' (fromPArrayP ps))
-
-ysOf' :: [:Point:] -> [:Double:]
-ysOf' ps = [: y | (_, y) <- ps :]
-
-ysOf :: PArray Point -> PArray Double
-{-# NOINLINE ysOf #-}
-ysOf ps = toPArrayP (ysOf' (fromPArrayP ps))
-
-
diff --git a/testsuite/tests/dph/quickhull/dph-quickhull-copy-fast.stdout b/testsuite/tests/dph/quickhull/dph-quickhull-copy-fast.stdout
deleted file mode 100644
index f6b2d92e9a..0000000000
--- a/testsuite/tests/dph/quickhull/dph-quickhull-copy-fast.stdout
+++ /dev/null
@@ -1,1019 +0,0 @@
-<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
-<polygon points="20,98 50,246 83,354 164,416 236,434 343,427 366,412 379,402 519,143 528,126 529,115 510,96 506,95 117,33 85,28 40,64 " style="fill:#d0d0ff;stroke:#000000;stroke-width:1"/>
-<circle cx="217" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="266" r="0.5" style="stroke:#000000"/>
-<circle cx="191" cy="353" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="416" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="257" r="0.5" style="stroke:#000000"/>
-<circle cx="266" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="350" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="334" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="189" cy="151" r="0.5" style="stroke:#000000"/>
-<circle cx="308" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="347" cy="160" r="0.5" style="stroke:#000000"/>
-<circle cx="251" cy="251" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="397" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="220" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="252" r="0.5" style="stroke:#000000"/>
-<circle cx="191" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="84" r="0.5" style="stroke:#000000"/>
-<circle cx="90" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="391" cy="360" r="0.5" style="stroke:#000000"/>
-<circle cx="277" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="421" r="0.5" style="stroke:#000000"/>
-<circle cx="274" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="187" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="343" cy="427" r="0.5" style="stroke:#000000"/>
-<circle cx="255" cy="170" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="329" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="261" r="0.5" style="stroke:#000000"/>
-<circle cx="214" cy="361" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="219" r="0.5" style="stroke:#000000"/>
-<circle cx="227" cy="351" r="0.5" style="stroke:#000000"/>
-<circle cx="228" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="314" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="209" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="367" cy="217" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="194" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="251" r="0.5" style="stroke:#000000"/>
-<circle cx="355" cy="406" r="0.5" style="stroke:#000000"/>
-<circle cx="252" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="219" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="217" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="220" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="207" r="0.5" style="stroke:#000000"/>
-<circle cx="266" cy="255" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="200" cy="248" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="360" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="255" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="50" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="231" cy="340" r="0.5" style="stroke:#000000"/>
-<circle cx="189" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="188" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="366" cy="412" r="0.5" style="stroke:#000000"/>
-<circle cx="183" cy="139" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="399" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="289" cy="404" r="0.5" style="stroke:#000000"/>
-<circle cx="346" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="181" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="274" r="0.5" style="stroke:#000000"/>
-<circle cx="246" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="201" cy="395" r="0.5" style="stroke:#000000"/>
-<circle cx="192" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="399" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="202" cy="221" r="0.5" style="stroke:#000000"/>
-<circle cx="361" cy="406" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="180" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="258" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="408" r="0.5" style="stroke:#000000"/>
-<circle cx="247" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="174" cy="346" r="0.5" style="stroke:#000000"/>
-<circle cx="373" cy="334" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="82" r="0.5" style="stroke:#000000"/>
-<circle cx="240" cy="388" r="0.5" style="stroke:#000000"/>
-<circle cx="263" cy="225" r="0.5" style="stroke:#000000"/>
-<circle cx="252" cy="207" r="0.5" style="stroke:#000000"/>
-<circle cx="233" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="234" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="285" cy="264" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="259" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="233" cy="258" r="0.5" style="stroke:#000000"/>
-<circle cx="108" cy="336" r="0.5" style="stroke:#000000"/>
-<circle cx="379" cy="402" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="432" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="347" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="213" r="0.5" style="stroke:#000000"/>
-<circle cx="330" cy="370" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="320" r="0.5" style="stroke:#000000"/>
-<circle cx="280" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="304" cy="209" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="304" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="188" cy="215" r="0.5" style="stroke:#000000"/>
-<circle cx="263" cy="218" r="0.5" style="stroke:#000000"/>
-<circle cx="196" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="371" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="285" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="217" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="335" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="182" r="0.5" style="stroke:#000000"/>
-<circle cx="221" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="333" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="199" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="153" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="419" r="0.5" style="stroke:#000000"/>
-<circle cx="227" cy="173" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="242" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="377" cy="388" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="215" r="0.5" style="stroke:#000000"/>
-<circle cx="438" cy="229" r="0.5" style="stroke:#000000"/>
-<circle cx="446" cy="216" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="238" r="0.5" style="stroke:#000000"/>
-<circle cx="224" cy="229" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="181" r="0.5" style="stroke:#000000"/>
-<circle cx="270" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="416" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="366" cy="244" r="0.5" style="stroke:#000000"/>
-<circle cx="279" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="353" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="70" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="92" r="0.5" style="stroke:#000000"/>
-<circle cx="196" cy="362" r="0.5" style="stroke:#000000"/>
-<circle cx="234" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="321" cy="367" r="0.5" style="stroke:#000000"/>
-<circle cx="251" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="154" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="216" r="0.5" style="stroke:#000000"/>
-<circle cx="421" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="215" cy="269" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="224" r="0.5" style="stroke:#000000"/>
-<circle cx="79" cy="327" r="0.5" style="stroke:#000000"/>
-<circle cx="424" cy="266" r="0.5" style="stroke:#000000"/>
-<circle cx="237" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="355" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="239" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="396" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="83" cy="354" r="0.5" style="stroke:#000000"/>
-<circle cx="236" cy="434" r="0.5" style="stroke:#000000"/>
-<circle cx="439" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="181" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="404" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="362" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="87" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="65" cy="166" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="107" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="60" r="0.5" style="stroke:#000000"/>
-<circle cx="123" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="67" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="37" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="62" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="34" r="0.5" style="stroke:#000000"/>
-<circle cx="36" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="60" cy="70" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="111" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="55" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="171" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="68" r="0.5" style="stroke:#000000"/>
-<circle cx="63" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="86" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="123" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="140" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="85" r="0.5" style="stroke:#000000"/>
-<circle cx="47" cy="77" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="88" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="87" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="113" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="83" r="0.5" style="stroke:#000000"/>
-<circle cx="106" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="80" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="59" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="50" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="20" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="165" r="0.5" style="stroke:#000000"/>
-<circle cx="73" cy="56" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="45" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="59" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="116" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="57" r="0.5" style="stroke:#000000"/>
-<circle cx="89" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="72" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="53" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="81" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="77" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="104" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="98" cy="160" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="81" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="72" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="89" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="98" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="33" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="105" cy="90" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="83" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="43" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="104" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="85" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="47" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="112" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="84" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="77" r="0.5" style="stroke:#000000"/>
-<circle cx="121" cy="44" r="0.5" style="stroke:#000000"/>
-<circle cx="48" cy="72" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="105" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="79" cy="91" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="58" r="0.5" style="stroke:#000000"/>
-<circle cx="97" cy="73" r="0.5" style="stroke:#000000"/>
-<circle cx="88" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="80" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="61" r="0.5" style="stroke:#000000"/>
-<circle cx="109" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="69" r="0.5" style="stroke:#000000"/>
-<circle cx="68" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="121" cy="62" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="50" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="109" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="91" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="97" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="90" cy="92" r="0.5" style="stroke:#000000"/>
-<circle cx="53" cy="72" r="0.5" style="stroke:#000000"/>
-<circle cx="108" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="64" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="166" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="112" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="54" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="40" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="76" r="0.5" style="stroke:#000000"/>
-<circle cx="85" cy="28" r="0.5" style="stroke:#000000"/>
-<circle cx="49" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="37" r="0.5" style="stroke:#000000"/>
-<circle cx="78" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="128" cy="147" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="56" cy="62" r="0.5" style="stroke:#000000"/>
-<circle cx="61" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="44" cy="71" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="86" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="106" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="32" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="170" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="57" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="62" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="61" r="0.5" style="stroke:#000000"/>
-<circle cx="33" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="69" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="73" cy="57" r="0.5" style="stroke:#000000"/>
-<circle cx="162" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="69" cy="71" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="325" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="275" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="171" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="326" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="326" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="288" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="312" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="166" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="171" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="120" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="172" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="143" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="143" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="313" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="275" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="321" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="129" cy="313" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="162" cy="318" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="291" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="325" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="157" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="281" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="321" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="179" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="157" cy="291" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="273" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="276" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="161" cy="318" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="129" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="125" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="328" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="487" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="476" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="476" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="521" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="108" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="516" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="521" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="481" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="470" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="522" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="483" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="493" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="493" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="479" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="519" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="527" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="512" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="507" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="519" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="528" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="529" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="525" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="483" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="477" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="507" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="481" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="511" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="484" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="479" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="526" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="474" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="526" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="484" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="475" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="528" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="523" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="277" r="0.5" style="stroke:#000000"/>
-<circle cx="235" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="312" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="375" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="363" cy="164" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="343" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="372" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="376" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="299" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="182" cy="162" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="328" cy="75" r="0.5" style="stroke:#000000"/>
-<circle cx="180" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="225" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="406" cy="282" r="0.5" style="stroke:#000000"/>
-<circle cx="320" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="328" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="221" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="332" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="140" r="0.5" style="stroke:#000000"/>
-<circle cx="231" cy="259" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="348" cy="208" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="276" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="348" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="269" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="388" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="172" r="0.5" style="stroke:#000000"/>
-<circle cx="200" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="379" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="277" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="187" r="0.5" style="stroke:#000000"/>
-<circle cx="324" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="312" cy="204" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="255" r="0.5" style="stroke:#000000"/>
-<circle cx="262" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="403" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="207" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="268" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="327" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="412" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="329" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="372" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="328" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="279" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="218" r="0.5" style="stroke:#000000"/>
-<circle cx="297" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="308" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="296" cy="312" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="240" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="383" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="247" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="319" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="280" cy="211" r="0.5" style="stroke:#000000"/>
-<circle cx="296" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="243" cy="272" r="0.5" style="stroke:#000000"/>
-<circle cx="392" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="331" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="181" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="288" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="326" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="325" cy="205" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="194" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="397" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="307" cy="204" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="436" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="373" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="172" r="0.5" style="stroke:#000000"/>
-<circle cx="360" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="299" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="201" cy="252" r="0.5" style="stroke:#000000"/>
-<circle cx="323" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="350" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="170" r="0.5" style="stroke:#000000"/>
-<circle cx="349" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="340" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="202" cy="147" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="309" cy="176" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="183" r="0.5" style="stroke:#000000"/>
-<circle cx="391" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="326" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="210" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="364" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="271" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="149" r="0.5" style="stroke:#000000"/>
-<circle cx="278" cy="205" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="363" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="262" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="327" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="194" r="0.5" style="stroke:#000000"/>
-<circle cx="333" cy="231" r="0.5" style="stroke:#000000"/>
-<circle cx="340" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="271" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="395" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="210" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="441" cy="184" r="0.5" style="stroke:#000000"/>
-<circle cx="447" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="191" r="0.5" style="stroke:#000000"/>
-<circle cx="281" cy="184" r="0.5" style="stroke:#000000"/>
-<circle cx="212" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="164" r="0.5" style="stroke:#000000"/>
-<circle cx="425" cy="239" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="322" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="187" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="336" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="272" cy="65" r="0.5" style="stroke:#000000"/>
-<circle cx="204" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="82" r="0.5" style="stroke:#000000"/>
-<circle cx="259" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="288" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="353" cy="288" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="218" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="226" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="195" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="428" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="274" cy="214" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="180" r="0.5" style="stroke:#000000"/>
-<circle cx="172" cy="257" r="0.5" style="stroke:#000000"/>
-<circle cx="431" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="290" cy="187" r="0.5" style="stroke:#000000"/>
-<circle cx="219" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="230" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="192" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="289" cy="338" r="0.5" style="stroke:#000000"/>
-<circle cx="442" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="415" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="384" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="20" cy="98" r="1" style="stroke:#ff0000"/>
-<circle cx="50" cy="246" r="1" style="stroke:#ff0000"/>
-<circle cx="83" cy="354" r="1" style="stroke:#ff0000"/>
-<circle cx="164" cy="416" r="1" style="stroke:#ff0000"/>
-<circle cx="236" cy="434" r="1" style="stroke:#ff0000"/>
-<circle cx="343" cy="427" r="1" style="stroke:#ff0000"/>
-<circle cx="366" cy="412" r="1" style="stroke:#ff0000"/>
-<circle cx="379" cy="402" r="1" style="stroke:#ff0000"/>
-<circle cx="519" cy="143" r="1" style="stroke:#ff0000"/>
-<circle cx="528" cy="126" r="1" style="stroke:#ff0000"/>
-<circle cx="529" cy="115" r="1" style="stroke:#ff0000"/>
-<circle cx="510" cy="96" r="1" style="stroke:#ff0000"/>
-<circle cx="506" cy="95" r="1" style="stroke:#ff0000"/>
-<circle cx="117" cy="33" r="1" style="stroke:#ff0000"/>
-<circle cx="85" cy="28" r="1" style="stroke:#ff0000"/>
-<circle cx="40" cy="64" r="1" style="stroke:#ff0000"/>
-</svg>
diff --git a/testsuite/tests/dph/quickhull/dph-quickhull-copy-opt.stdout b/testsuite/tests/dph/quickhull/dph-quickhull-copy-opt.stdout
deleted file mode 100644
index f6b2d92e9a..0000000000
--- a/testsuite/tests/dph/quickhull/dph-quickhull-copy-opt.stdout
+++ /dev/null
@@ -1,1019 +0,0 @@
-<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
-<polygon points="20,98 50,246 83,354 164,416 236,434 343,427 366,412 379,402 519,143 528,126 529,115 510,96 506,95 117,33 85,28 40,64 " style="fill:#d0d0ff;stroke:#000000;stroke-width:1"/>
-<circle cx="217" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="266" r="0.5" style="stroke:#000000"/>
-<circle cx="191" cy="353" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="416" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="257" r="0.5" style="stroke:#000000"/>
-<circle cx="266" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="350" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="334" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="189" cy="151" r="0.5" style="stroke:#000000"/>
-<circle cx="308" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="347" cy="160" r="0.5" style="stroke:#000000"/>
-<circle cx="251" cy="251" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="397" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="220" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="252" r="0.5" style="stroke:#000000"/>
-<circle cx="191" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="84" r="0.5" style="stroke:#000000"/>
-<circle cx="90" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="391" cy="360" r="0.5" style="stroke:#000000"/>
-<circle cx="277" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="421" r="0.5" style="stroke:#000000"/>
-<circle cx="274" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="187" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="343" cy="427" r="0.5" style="stroke:#000000"/>
-<circle cx="255" cy="170" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="329" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="261" r="0.5" style="stroke:#000000"/>
-<circle cx="214" cy="361" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="219" r="0.5" style="stroke:#000000"/>
-<circle cx="227" cy="351" r="0.5" style="stroke:#000000"/>
-<circle cx="228" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="314" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="209" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="367" cy="217" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="194" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="251" r="0.5" style="stroke:#000000"/>
-<circle cx="355" cy="406" r="0.5" style="stroke:#000000"/>
-<circle cx="252" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="219" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="217" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="220" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="207" r="0.5" style="stroke:#000000"/>
-<circle cx="266" cy="255" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="200" cy="248" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="360" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="255" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="50" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="231" cy="340" r="0.5" style="stroke:#000000"/>
-<circle cx="189" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="188" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="366" cy="412" r="0.5" style="stroke:#000000"/>
-<circle cx="183" cy="139" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="399" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="289" cy="404" r="0.5" style="stroke:#000000"/>
-<circle cx="346" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="181" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="274" r="0.5" style="stroke:#000000"/>
-<circle cx="246" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="201" cy="395" r="0.5" style="stroke:#000000"/>
-<circle cx="192" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="399" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="202" cy="221" r="0.5" style="stroke:#000000"/>
-<circle cx="361" cy="406" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="180" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="258" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="408" r="0.5" style="stroke:#000000"/>
-<circle cx="247" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="174" cy="346" r="0.5" style="stroke:#000000"/>
-<circle cx="373" cy="334" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="82" r="0.5" style="stroke:#000000"/>
-<circle cx="240" cy="388" r="0.5" style="stroke:#000000"/>
-<circle cx="263" cy="225" r="0.5" style="stroke:#000000"/>
-<circle cx="252" cy="207" r="0.5" style="stroke:#000000"/>
-<circle cx="233" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="234" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="285" cy="264" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="259" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="233" cy="258" r="0.5" style="stroke:#000000"/>
-<circle cx="108" cy="336" r="0.5" style="stroke:#000000"/>
-<circle cx="379" cy="402" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="432" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="347" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="213" r="0.5" style="stroke:#000000"/>
-<circle cx="330" cy="370" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="320" r="0.5" style="stroke:#000000"/>
-<circle cx="280" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="304" cy="209" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="304" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="188" cy="215" r="0.5" style="stroke:#000000"/>
-<circle cx="263" cy="218" r="0.5" style="stroke:#000000"/>
-<circle cx="196" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="371" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="285" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="217" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="335" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="182" r="0.5" style="stroke:#000000"/>
-<circle cx="221" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="333" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="199" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="153" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="419" r="0.5" style="stroke:#000000"/>
-<circle cx="227" cy="173" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="242" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="377" cy="388" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="215" r="0.5" style="stroke:#000000"/>
-<circle cx="438" cy="229" r="0.5" style="stroke:#000000"/>
-<circle cx="446" cy="216" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="238" r="0.5" style="stroke:#000000"/>
-<circle cx="224" cy="229" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="181" r="0.5" style="stroke:#000000"/>
-<circle cx="270" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="416" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="366" cy="244" r="0.5" style="stroke:#000000"/>
-<circle cx="279" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="353" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="70" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="92" r="0.5" style="stroke:#000000"/>
-<circle cx="196" cy="362" r="0.5" style="stroke:#000000"/>
-<circle cx="234" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="321" cy="367" r="0.5" style="stroke:#000000"/>
-<circle cx="251" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="154" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="216" r="0.5" style="stroke:#000000"/>
-<circle cx="421" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="215" cy="269" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="224" r="0.5" style="stroke:#000000"/>
-<circle cx="79" cy="327" r="0.5" style="stroke:#000000"/>
-<circle cx="424" cy="266" r="0.5" style="stroke:#000000"/>
-<circle cx="237" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="355" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="239" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="396" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="83" cy="354" r="0.5" style="stroke:#000000"/>
-<circle cx="236" cy="434" r="0.5" style="stroke:#000000"/>
-<circle cx="439" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="181" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="404" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="362" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="87" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="65" cy="166" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="107" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="60" r="0.5" style="stroke:#000000"/>
-<circle cx="123" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="67" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="37" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="62" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="34" r="0.5" style="stroke:#000000"/>
-<circle cx="36" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="60" cy="70" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="111" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="55" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="171" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="68" r="0.5" style="stroke:#000000"/>
-<circle cx="63" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="86" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="123" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="140" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="85" r="0.5" style="stroke:#000000"/>
-<circle cx="47" cy="77" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="88" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="87" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="113" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="83" r="0.5" style="stroke:#000000"/>
-<circle cx="106" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="80" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="59" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="50" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="20" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="165" r="0.5" style="stroke:#000000"/>
-<circle cx="73" cy="56" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="45" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="59" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="116" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="57" r="0.5" style="stroke:#000000"/>
-<circle cx="89" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="72" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="53" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="81" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="77" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="104" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="98" cy="160" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="81" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="72" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="89" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="98" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="33" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="105" cy="90" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="83" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="43" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="104" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="85" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="47" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="112" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="84" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="77" r="0.5" style="stroke:#000000"/>
-<circle cx="121" cy="44" r="0.5" style="stroke:#000000"/>
-<circle cx="48" cy="72" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="105" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="79" cy="91" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="58" r="0.5" style="stroke:#000000"/>
-<circle cx="97" cy="73" r="0.5" style="stroke:#000000"/>
-<circle cx="88" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="80" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="61" r="0.5" style="stroke:#000000"/>
-<circle cx="109" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="69" r="0.5" style="stroke:#000000"/>
-<circle cx="68" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="121" cy="62" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="50" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="109" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="91" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="97" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="90" cy="92" r="0.5" style="stroke:#000000"/>
-<circle cx="53" cy="72" r="0.5" style="stroke:#000000"/>
-<circle cx="108" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="64" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="166" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="112" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="54" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="40" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="76" r="0.5" style="stroke:#000000"/>
-<circle cx="85" cy="28" r="0.5" style="stroke:#000000"/>
-<circle cx="49" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="37" r="0.5" style="stroke:#000000"/>
-<circle cx="78" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="128" cy="147" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="56" cy="62" r="0.5" style="stroke:#000000"/>
-<circle cx="61" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="44" cy="71" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="86" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="106" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="32" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="170" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="57" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="62" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="61" r="0.5" style="stroke:#000000"/>
-<circle cx="33" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="69" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="73" cy="57" r="0.5" style="stroke:#000000"/>
-<circle cx="162" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="69" cy="71" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="325" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="275" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="171" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="326" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="326" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="288" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="312" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="166" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="171" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="120" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="172" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="143" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="143" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="313" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="275" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="321" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="129" cy="313" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="162" cy="318" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="291" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="325" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="157" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="281" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="321" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="179" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="157" cy="291" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="273" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="276" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="161" cy="318" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="129" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="125" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="328" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="487" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="476" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="476" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="521" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="108" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="516" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="521" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="481" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="470" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="522" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="483" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="493" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="493" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="479" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="519" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="527" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="512" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="507" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="519" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="528" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="529" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="525" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="483" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="477" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="507" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="481" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="511" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="484" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="479" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="526" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="474" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="526" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="484" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="475" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="528" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="523" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="277" r="0.5" style="stroke:#000000"/>
-<circle cx="235" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="312" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="375" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="363" cy="164" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="343" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="372" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="376" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="299" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="182" cy="162" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="328" cy="75" r="0.5" style="stroke:#000000"/>
-<circle cx="180" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="225" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="406" cy="282" r="0.5" style="stroke:#000000"/>
-<circle cx="320" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="328" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="221" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="332" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="140" r="0.5" style="stroke:#000000"/>
-<circle cx="231" cy="259" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="348" cy="208" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="276" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="348" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="269" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="388" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="172" r="0.5" style="stroke:#000000"/>
-<circle cx="200" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="379" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="277" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="187" r="0.5" style="stroke:#000000"/>
-<circle cx="324" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="312" cy="204" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="255" r="0.5" style="stroke:#000000"/>
-<circle cx="262" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="403" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="207" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="268" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="327" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="412" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="329" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="372" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="328" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="279" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="218" r="0.5" style="stroke:#000000"/>
-<circle cx="297" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="308" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="296" cy="312" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="240" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="383" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="247" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="319" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="280" cy="211" r="0.5" style="stroke:#000000"/>
-<circle cx="296" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="243" cy="272" r="0.5" style="stroke:#000000"/>
-<circle cx="392" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="331" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="181" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="288" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="326" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="325" cy="205" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="194" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="397" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="307" cy="204" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="436" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="373" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="172" r="0.5" style="stroke:#000000"/>
-<circle cx="360" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="299" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="201" cy="252" r="0.5" style="stroke:#000000"/>
-<circle cx="323" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="350" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="170" r="0.5" style="stroke:#000000"/>
-<circle cx="349" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="340" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="202" cy="147" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="309" cy="176" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="183" r="0.5" style="stroke:#000000"/>
-<circle cx="391" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="326" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="210" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="364" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="271" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="149" r="0.5" style="stroke:#000000"/>
-<circle cx="278" cy="205" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="363" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="262" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="327" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="194" r="0.5" style="stroke:#000000"/>
-<circle cx="333" cy="231" r="0.5" style="stroke:#000000"/>
-<circle cx="340" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="271" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="395" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="210" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="441" cy="184" r="0.5" style="stroke:#000000"/>
-<circle cx="447" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="191" r="0.5" style="stroke:#000000"/>
-<circle cx="281" cy="184" r="0.5" style="stroke:#000000"/>
-<circle cx="212" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="164" r="0.5" style="stroke:#000000"/>
-<circle cx="425" cy="239" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="322" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="187" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="336" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="272" cy="65" r="0.5" style="stroke:#000000"/>
-<circle cx="204" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="82" r="0.5" style="stroke:#000000"/>
-<circle cx="259" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="288" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="353" cy="288" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="218" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="226" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="195" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="428" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="274" cy="214" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="180" r="0.5" style="stroke:#000000"/>
-<circle cx="172" cy="257" r="0.5" style="stroke:#000000"/>
-<circle cx="431" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="290" cy="187" r="0.5" style="stroke:#000000"/>
-<circle cx="219" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="230" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="192" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="289" cy="338" r="0.5" style="stroke:#000000"/>
-<circle cx="442" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="415" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="384" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="20" cy="98" r="1" style="stroke:#ff0000"/>
-<circle cx="50" cy="246" r="1" style="stroke:#ff0000"/>
-<circle cx="83" cy="354" r="1" style="stroke:#ff0000"/>
-<circle cx="164" cy="416" r="1" style="stroke:#ff0000"/>
-<circle cx="236" cy="434" r="1" style="stroke:#ff0000"/>
-<circle cx="343" cy="427" r="1" style="stroke:#ff0000"/>
-<circle cx="366" cy="412" r="1" style="stroke:#ff0000"/>
-<circle cx="379" cy="402" r="1" style="stroke:#ff0000"/>
-<circle cx="519" cy="143" r="1" style="stroke:#ff0000"/>
-<circle cx="528" cy="126" r="1" style="stroke:#ff0000"/>
-<circle cx="529" cy="115" r="1" style="stroke:#ff0000"/>
-<circle cx="510" cy="96" r="1" style="stroke:#ff0000"/>
-<circle cx="506" cy="95" r="1" style="stroke:#ff0000"/>
-<circle cx="117" cy="33" r="1" style="stroke:#ff0000"/>
-<circle cx="85" cy="28" r="1" style="stroke:#ff0000"/>
-<circle cx="40" cy="64" r="1" style="stroke:#ff0000"/>
-</svg>
diff --git a/testsuite/tests/dph/quickhull/dph-quickhull-vseg-fast.stdout b/testsuite/tests/dph/quickhull/dph-quickhull-vseg-fast.stdout
deleted file mode 100644
index f6b2d92e9a..0000000000
--- a/testsuite/tests/dph/quickhull/dph-quickhull-vseg-fast.stdout
+++ /dev/null
@@ -1,1019 +0,0 @@
-<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
-<polygon points="20,98 50,246 83,354 164,416 236,434 343,427 366,412 379,402 519,143 528,126 529,115 510,96 506,95 117,33 85,28 40,64 " style="fill:#d0d0ff;stroke:#000000;stroke-width:1"/>
-<circle cx="217" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="266" r="0.5" style="stroke:#000000"/>
-<circle cx="191" cy="353" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="416" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="257" r="0.5" style="stroke:#000000"/>
-<circle cx="266" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="350" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="334" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="189" cy="151" r="0.5" style="stroke:#000000"/>
-<circle cx="308" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="347" cy="160" r="0.5" style="stroke:#000000"/>
-<circle cx="251" cy="251" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="397" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="220" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="252" r="0.5" style="stroke:#000000"/>
-<circle cx="191" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="84" r="0.5" style="stroke:#000000"/>
-<circle cx="90" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="391" cy="360" r="0.5" style="stroke:#000000"/>
-<circle cx="277" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="421" r="0.5" style="stroke:#000000"/>
-<circle cx="274" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="187" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="343" cy="427" r="0.5" style="stroke:#000000"/>
-<circle cx="255" cy="170" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="329" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="261" r="0.5" style="stroke:#000000"/>
-<circle cx="214" cy="361" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="219" r="0.5" style="stroke:#000000"/>
-<circle cx="227" cy="351" r="0.5" style="stroke:#000000"/>
-<circle cx="228" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="314" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="209" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="367" cy="217" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="194" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="251" r="0.5" style="stroke:#000000"/>
-<circle cx="355" cy="406" r="0.5" style="stroke:#000000"/>
-<circle cx="252" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="219" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="217" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="220" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="207" r="0.5" style="stroke:#000000"/>
-<circle cx="266" cy="255" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="200" cy="248" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="360" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="255" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="50" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="231" cy="340" r="0.5" style="stroke:#000000"/>
-<circle cx="189" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="188" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="366" cy="412" r="0.5" style="stroke:#000000"/>
-<circle cx="183" cy="139" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="399" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="289" cy="404" r="0.5" style="stroke:#000000"/>
-<circle cx="346" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="181" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="274" r="0.5" style="stroke:#000000"/>
-<circle cx="246" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="201" cy="395" r="0.5" style="stroke:#000000"/>
-<circle cx="192" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="399" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="202" cy="221" r="0.5" style="stroke:#000000"/>
-<circle cx="361" cy="406" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="180" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="258" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="408" r="0.5" style="stroke:#000000"/>
-<circle cx="247" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="174" cy="346" r="0.5" style="stroke:#000000"/>
-<circle cx="373" cy="334" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="82" r="0.5" style="stroke:#000000"/>
-<circle cx="240" cy="388" r="0.5" style="stroke:#000000"/>
-<circle cx="263" cy="225" r="0.5" style="stroke:#000000"/>
-<circle cx="252" cy="207" r="0.5" style="stroke:#000000"/>
-<circle cx="233" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="234" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="285" cy="264" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="259" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="233" cy="258" r="0.5" style="stroke:#000000"/>
-<circle cx="108" cy="336" r="0.5" style="stroke:#000000"/>
-<circle cx="379" cy="402" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="432" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="347" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="213" r="0.5" style="stroke:#000000"/>
-<circle cx="330" cy="370" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="320" r="0.5" style="stroke:#000000"/>
-<circle cx="280" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="304" cy="209" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="304" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="188" cy="215" r="0.5" style="stroke:#000000"/>
-<circle cx="263" cy="218" r="0.5" style="stroke:#000000"/>
-<circle cx="196" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="371" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="285" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="217" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="335" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="182" r="0.5" style="stroke:#000000"/>
-<circle cx="221" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="333" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="199" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="153" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="419" r="0.5" style="stroke:#000000"/>
-<circle cx="227" cy="173" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="242" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="377" cy="388" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="215" r="0.5" style="stroke:#000000"/>
-<circle cx="438" cy="229" r="0.5" style="stroke:#000000"/>
-<circle cx="446" cy="216" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="238" r="0.5" style="stroke:#000000"/>
-<circle cx="224" cy="229" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="181" r="0.5" style="stroke:#000000"/>
-<circle cx="270" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="416" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="366" cy="244" r="0.5" style="stroke:#000000"/>
-<circle cx="279" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="353" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="70" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="92" r="0.5" style="stroke:#000000"/>
-<circle cx="196" cy="362" r="0.5" style="stroke:#000000"/>
-<circle cx="234" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="321" cy="367" r="0.5" style="stroke:#000000"/>
-<circle cx="251" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="154" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="216" r="0.5" style="stroke:#000000"/>
-<circle cx="421" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="215" cy="269" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="224" r="0.5" style="stroke:#000000"/>
-<circle cx="79" cy="327" r="0.5" style="stroke:#000000"/>
-<circle cx="424" cy="266" r="0.5" style="stroke:#000000"/>
-<circle cx="237" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="355" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="239" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="396" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="83" cy="354" r="0.5" style="stroke:#000000"/>
-<circle cx="236" cy="434" r="0.5" style="stroke:#000000"/>
-<circle cx="439" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="181" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="404" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="362" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="87" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="65" cy="166" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="107" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="60" r="0.5" style="stroke:#000000"/>
-<circle cx="123" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="67" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="37" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="62" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="34" r="0.5" style="stroke:#000000"/>
-<circle cx="36" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="60" cy="70" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="111" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="55" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="171" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="68" r="0.5" style="stroke:#000000"/>
-<circle cx="63" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="86" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="123" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="140" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="85" r="0.5" style="stroke:#000000"/>
-<circle cx="47" cy="77" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="88" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="87" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="113" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="83" r="0.5" style="stroke:#000000"/>
-<circle cx="106" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="80" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="59" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="50" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="20" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="165" r="0.5" style="stroke:#000000"/>
-<circle cx="73" cy="56" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="45" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="59" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="116" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="57" r="0.5" style="stroke:#000000"/>
-<circle cx="89" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="72" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="53" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="81" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="77" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="104" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="98" cy="160" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="81" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="72" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="89" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="98" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="33" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="105" cy="90" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="83" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="43" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="104" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="85" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="47" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="112" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="84" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="77" r="0.5" style="stroke:#000000"/>
-<circle cx="121" cy="44" r="0.5" style="stroke:#000000"/>
-<circle cx="48" cy="72" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="105" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="79" cy="91" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="58" r="0.5" style="stroke:#000000"/>
-<circle cx="97" cy="73" r="0.5" style="stroke:#000000"/>
-<circle cx="88" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="80" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="61" r="0.5" style="stroke:#000000"/>
-<circle cx="109" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="69" r="0.5" style="stroke:#000000"/>
-<circle cx="68" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="121" cy="62" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="50" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="109" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="91" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="97" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="90" cy="92" r="0.5" style="stroke:#000000"/>
-<circle cx="53" cy="72" r="0.5" style="stroke:#000000"/>
-<circle cx="108" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="64" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="166" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="112" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="54" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="40" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="76" r="0.5" style="stroke:#000000"/>
-<circle cx="85" cy="28" r="0.5" style="stroke:#000000"/>
-<circle cx="49" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="37" r="0.5" style="stroke:#000000"/>
-<circle cx="78" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="128" cy="147" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="56" cy="62" r="0.5" style="stroke:#000000"/>
-<circle cx="61" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="44" cy="71" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="86" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="106" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="32" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="170" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="57" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="62" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="61" r="0.5" style="stroke:#000000"/>
-<circle cx="33" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="69" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="73" cy="57" r="0.5" style="stroke:#000000"/>
-<circle cx="162" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="69" cy="71" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="325" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="275" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="171" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="326" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="326" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="288" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="312" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="166" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="171" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="120" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="172" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="143" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="143" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="313" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="275" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="321" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="129" cy="313" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="162" cy="318" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="291" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="325" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="157" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="281" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="321" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="179" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="157" cy="291" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="273" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="276" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="161" cy="318" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="129" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="125" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="328" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="487" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="476" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="476" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="521" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="108" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="516" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="521" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="481" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="470" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="522" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="483" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="493" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="493" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="479" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="519" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="527" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="512" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="507" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="519" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="528" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="529" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="525" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="483" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="477" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="507" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="481" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="511" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="484" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="479" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="526" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="474" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="526" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="484" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="475" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="528" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="523" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="277" r="0.5" style="stroke:#000000"/>
-<circle cx="235" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="312" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="375" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="363" cy="164" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="343" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="372" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="376" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="299" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="182" cy="162" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="328" cy="75" r="0.5" style="stroke:#000000"/>
-<circle cx="180" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="225" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="406" cy="282" r="0.5" style="stroke:#000000"/>
-<circle cx="320" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="328" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="221" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="332" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="140" r="0.5" style="stroke:#000000"/>
-<circle cx="231" cy="259" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="348" cy="208" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="276" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="348" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="269" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="388" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="172" r="0.5" style="stroke:#000000"/>
-<circle cx="200" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="379" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="277" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="187" r="0.5" style="stroke:#000000"/>
-<circle cx="324" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="312" cy="204" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="255" r="0.5" style="stroke:#000000"/>
-<circle cx="262" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="403" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="207" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="268" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="327" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="412" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="329" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="372" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="328" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="279" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="218" r="0.5" style="stroke:#000000"/>
-<circle cx="297" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="308" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="296" cy="312" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="240" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="383" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="247" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="319" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="280" cy="211" r="0.5" style="stroke:#000000"/>
-<circle cx="296" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="243" cy="272" r="0.5" style="stroke:#000000"/>
-<circle cx="392" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="331" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="181" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="288" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="326" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="325" cy="205" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="194" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="397" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="307" cy="204" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="436" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="373" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="172" r="0.5" style="stroke:#000000"/>
-<circle cx="360" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="299" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="201" cy="252" r="0.5" style="stroke:#000000"/>
-<circle cx="323" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="350" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="170" r="0.5" style="stroke:#000000"/>
-<circle cx="349" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="340" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="202" cy="147" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="309" cy="176" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="183" r="0.5" style="stroke:#000000"/>
-<circle cx="391" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="326" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="210" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="364" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="271" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="149" r="0.5" style="stroke:#000000"/>
-<circle cx="278" cy="205" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="363" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="262" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="327" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="194" r="0.5" style="stroke:#000000"/>
-<circle cx="333" cy="231" r="0.5" style="stroke:#000000"/>
-<circle cx="340" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="271" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="395" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="210" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="441" cy="184" r="0.5" style="stroke:#000000"/>
-<circle cx="447" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="191" r="0.5" style="stroke:#000000"/>
-<circle cx="281" cy="184" r="0.5" style="stroke:#000000"/>
-<circle cx="212" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="164" r="0.5" style="stroke:#000000"/>
-<circle cx="425" cy="239" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="322" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="187" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="336" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="272" cy="65" r="0.5" style="stroke:#000000"/>
-<circle cx="204" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="82" r="0.5" style="stroke:#000000"/>
-<circle cx="259" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="288" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="353" cy="288" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="218" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="226" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="195" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="428" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="274" cy="214" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="180" r="0.5" style="stroke:#000000"/>
-<circle cx="172" cy="257" r="0.5" style="stroke:#000000"/>
-<circle cx="431" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="290" cy="187" r="0.5" style="stroke:#000000"/>
-<circle cx="219" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="230" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="192" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="289" cy="338" r="0.5" style="stroke:#000000"/>
-<circle cx="442" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="415" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="384" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="20" cy="98" r="1" style="stroke:#ff0000"/>
-<circle cx="50" cy="246" r="1" style="stroke:#ff0000"/>
-<circle cx="83" cy="354" r="1" style="stroke:#ff0000"/>
-<circle cx="164" cy="416" r="1" style="stroke:#ff0000"/>
-<circle cx="236" cy="434" r="1" style="stroke:#ff0000"/>
-<circle cx="343" cy="427" r="1" style="stroke:#ff0000"/>
-<circle cx="366" cy="412" r="1" style="stroke:#ff0000"/>
-<circle cx="379" cy="402" r="1" style="stroke:#ff0000"/>
-<circle cx="519" cy="143" r="1" style="stroke:#ff0000"/>
-<circle cx="528" cy="126" r="1" style="stroke:#ff0000"/>
-<circle cx="529" cy="115" r="1" style="stroke:#ff0000"/>
-<circle cx="510" cy="96" r="1" style="stroke:#ff0000"/>
-<circle cx="506" cy="95" r="1" style="stroke:#ff0000"/>
-<circle cx="117" cy="33" r="1" style="stroke:#ff0000"/>
-<circle cx="85" cy="28" r="1" style="stroke:#ff0000"/>
-<circle cx="40" cy="64" r="1" style="stroke:#ff0000"/>
-</svg>
diff --git a/testsuite/tests/dph/quickhull/dph-quickhull-vseg-opt.stdout b/testsuite/tests/dph/quickhull/dph-quickhull-vseg-opt.stdout
deleted file mode 100644
index f6b2d92e9a..0000000000
--- a/testsuite/tests/dph/quickhull/dph-quickhull-vseg-opt.stdout
+++ /dev/null
@@ -1,1019 +0,0 @@
-<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
-<polygon points="20,98 50,246 83,354 164,416 236,434 343,427 366,412 379,402 519,143 528,126 529,115 510,96 506,95 117,33 85,28 40,64 " style="fill:#d0d0ff;stroke:#000000;stroke-width:1"/>
-<circle cx="217" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="266" r="0.5" style="stroke:#000000"/>
-<circle cx="191" cy="353" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="416" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="257" r="0.5" style="stroke:#000000"/>
-<circle cx="266" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="350" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="334" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="189" cy="151" r="0.5" style="stroke:#000000"/>
-<circle cx="308" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="347" cy="160" r="0.5" style="stroke:#000000"/>
-<circle cx="251" cy="251" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="397" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="220" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="252" r="0.5" style="stroke:#000000"/>
-<circle cx="191" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="84" r="0.5" style="stroke:#000000"/>
-<circle cx="90" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="391" cy="360" r="0.5" style="stroke:#000000"/>
-<circle cx="277" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="421" r="0.5" style="stroke:#000000"/>
-<circle cx="274" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="187" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="343" cy="427" r="0.5" style="stroke:#000000"/>
-<circle cx="255" cy="170" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="329" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="261" r="0.5" style="stroke:#000000"/>
-<circle cx="214" cy="361" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="219" r="0.5" style="stroke:#000000"/>
-<circle cx="227" cy="351" r="0.5" style="stroke:#000000"/>
-<circle cx="228" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="314" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="209" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="367" cy="217" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="194" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="251" r="0.5" style="stroke:#000000"/>
-<circle cx="355" cy="406" r="0.5" style="stroke:#000000"/>
-<circle cx="252" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="219" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="217" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="220" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="207" r="0.5" style="stroke:#000000"/>
-<circle cx="266" cy="255" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="200" cy="248" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="360" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="255" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="50" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="231" cy="340" r="0.5" style="stroke:#000000"/>
-<circle cx="189" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="188" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="366" cy="412" r="0.5" style="stroke:#000000"/>
-<circle cx="183" cy="139" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="399" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="289" cy="404" r="0.5" style="stroke:#000000"/>
-<circle cx="346" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="181" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="274" r="0.5" style="stroke:#000000"/>
-<circle cx="246" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="201" cy="395" r="0.5" style="stroke:#000000"/>
-<circle cx="192" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="399" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="202" cy="221" r="0.5" style="stroke:#000000"/>
-<circle cx="361" cy="406" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="180" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="258" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="408" r="0.5" style="stroke:#000000"/>
-<circle cx="247" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="174" cy="346" r="0.5" style="stroke:#000000"/>
-<circle cx="373" cy="334" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="82" r="0.5" style="stroke:#000000"/>
-<circle cx="240" cy="388" r="0.5" style="stroke:#000000"/>
-<circle cx="263" cy="225" r="0.5" style="stroke:#000000"/>
-<circle cx="252" cy="207" r="0.5" style="stroke:#000000"/>
-<circle cx="233" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="234" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="285" cy="264" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="259" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="233" cy="258" r="0.5" style="stroke:#000000"/>
-<circle cx="108" cy="336" r="0.5" style="stroke:#000000"/>
-<circle cx="379" cy="402" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="432" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="347" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="213" r="0.5" style="stroke:#000000"/>
-<circle cx="330" cy="370" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="320" r="0.5" style="stroke:#000000"/>
-<circle cx="280" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="304" cy="209" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="304" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="188" cy="215" r="0.5" style="stroke:#000000"/>
-<circle cx="263" cy="218" r="0.5" style="stroke:#000000"/>
-<circle cx="196" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="371" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="285" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="217" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="335" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="182" r="0.5" style="stroke:#000000"/>
-<circle cx="221" cy="256" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="398" r="0.5" style="stroke:#000000"/>
-<circle cx="333" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="199" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="153" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="419" r="0.5" style="stroke:#000000"/>
-<circle cx="227" cy="173" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="242" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="246" r="0.5" style="stroke:#000000"/>
-<circle cx="377" cy="388" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="215" r="0.5" style="stroke:#000000"/>
-<circle cx="438" cy="229" r="0.5" style="stroke:#000000"/>
-<circle cx="446" cy="216" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="238" r="0.5" style="stroke:#000000"/>
-<circle cx="224" cy="229" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="181" r="0.5" style="stroke:#000000"/>
-<circle cx="270" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="416" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="366" cy="244" r="0.5" style="stroke:#000000"/>
-<circle cx="279" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="353" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="70" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="92" r="0.5" style="stroke:#000000"/>
-<circle cx="196" cy="362" r="0.5" style="stroke:#000000"/>
-<circle cx="234" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="321" cy="367" r="0.5" style="stroke:#000000"/>
-<circle cx="251" cy="249" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="154" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="216" r="0.5" style="stroke:#000000"/>
-<circle cx="421" cy="250" r="0.5" style="stroke:#000000"/>
-<circle cx="215" cy="269" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="224" r="0.5" style="stroke:#000000"/>
-<circle cx="79" cy="327" r="0.5" style="stroke:#000000"/>
-<circle cx="424" cy="266" r="0.5" style="stroke:#000000"/>
-<circle cx="237" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="253" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="355" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="239" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="396" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="83" cy="354" r="0.5" style="stroke:#000000"/>
-<circle cx="236" cy="434" r="0.5" style="stroke:#000000"/>
-<circle cx="439" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="181" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="404" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="362" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="87" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="65" cy="166" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="107" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="60" r="0.5" style="stroke:#000000"/>
-<circle cx="123" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="67" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="76" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="37" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="62" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="34" r="0.5" style="stroke:#000000"/>
-<circle cx="36" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="60" cy="70" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="111" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="55" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="171" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="68" r="0.5" style="stroke:#000000"/>
-<circle cx="63" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="86" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="123" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="140" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="78" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="85" r="0.5" style="stroke:#000000"/>
-<circle cx="47" cy="77" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="88" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="87" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="113" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="83" r="0.5" style="stroke:#000000"/>
-<circle cx="106" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="80" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="59" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="50" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="20" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="165" r="0.5" style="stroke:#000000"/>
-<circle cx="73" cy="56" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="45" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="59" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="116" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="115" cy="57" r="0.5" style="stroke:#000000"/>
-<circle cx="89" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="72" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="53" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="81" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="77" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="104" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="98" cy="160" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="81" cy="88" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="72" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="103" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="89" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="98" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="33" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="105" cy="90" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="83" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="43" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="104" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="93" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="70" cy="85" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="99" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="47" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="112" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="122" cy="84" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="77" r="0.5" style="stroke:#000000"/>
-<circle cx="121" cy="44" r="0.5" style="stroke:#000000"/>
-<circle cx="48" cy="72" r="0.5" style="stroke:#000000"/>
-<circle cx="75" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="105" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="79" cy="91" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="114" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="80" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="58" r="0.5" style="stroke:#000000"/>
-<circle cx="97" cy="73" r="0.5" style="stroke:#000000"/>
-<circle cx="88" cy="102" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="80" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="61" r="0.5" style="stroke:#000000"/>
-<circle cx="109" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="91" cy="69" r="0.5" style="stroke:#000000"/>
-<circle cx="68" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="117" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="121" cy="62" r="0.5" style="stroke:#000000"/>
-<circle cx="84" cy="50" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="46" r="0.5" style="stroke:#000000"/>
-<circle cx="102" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="109" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="91" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="87" r="0.5" style="stroke:#000000"/>
-<circle cx="97" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="90" cy="92" r="0.5" style="stroke:#000000"/>
-<circle cx="53" cy="72" r="0.5" style="stroke:#000000"/>
-<circle cx="108" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="110" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="64" cy="81" r="0.5" style="stroke:#000000"/>
-<circle cx="166" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="112" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="54" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="40" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="79" r="0.5" style="stroke:#000000"/>
-<circle cx="96" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="119" cy="76" r="0.5" style="stroke:#000000"/>
-<circle cx="85" cy="28" r="0.5" style="stroke:#000000"/>
-<circle cx="49" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="37" r="0.5" style="stroke:#000000"/>
-<circle cx="78" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="100" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="128" cy="147" r="0.5" style="stroke:#000000"/>
-<circle cx="101" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="56" cy="62" r="0.5" style="stroke:#000000"/>
-<circle cx="61" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="44" cy="71" r="0.5" style="stroke:#000000"/>
-<circle cx="92" cy="86" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="86" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="52" cy="63" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="98" r="0.5" style="stroke:#000000"/>
-<circle cx="106" cy="89" r="0.5" style="stroke:#000000"/>
-<circle cx="32" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="170" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="57" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="62" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="95" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="71" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="61" r="0.5" style="stroke:#000000"/>
-<circle cx="33" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="94" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="69" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="73" cy="57" r="0.5" style="stroke:#000000"/>
-<circle cx="162" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="69" cy="71" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="64" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="137" cy="325" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="275" r="0.5" style="stroke:#000000"/>
-<circle cx="126" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="171" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="326" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="326" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="288" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="312" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="166" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="171" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="120" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="172" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="304" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="143" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="143" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="313" r="0.5" style="stroke:#000000"/>
-<circle cx="156" cy="275" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="321" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="129" cy="313" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="323" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="177" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="165" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="162" cy="318" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="294" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="291" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="130" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="141" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="168" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="155" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="163" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="307" r="0.5" style="stroke:#000000"/>
-<circle cx="164" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="325" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="157" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="158" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="281" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="280" r="0.5" style="stroke:#000000"/>
-<circle cx="151" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="169" cy="321" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="305" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="179" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="149" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="146" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="153" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="293" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="308" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="154" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="133" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="127" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="292" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="157" cy="291" r="0.5" style="stroke:#000000"/>
-<circle cx="144" cy="273" r="0.5" style="stroke:#000000"/>
-<circle cx="131" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="160" cy="276" r="0.5" style="stroke:#000000"/>
-<circle cx="142" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="161" cy="318" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="135" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="129" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="147" cy="295" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="300" r="0.5" style="stroke:#000000"/>
-<circle cx="145" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="132" cy="286" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="299" r="0.5" style="stroke:#000000"/>
-<circle cx="152" cy="296" r="0.5" style="stroke:#000000"/>
-<circle cx="124" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="176" cy="302" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="134" cy="301" r="0.5" style="stroke:#000000"/>
-<circle cx="136" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="298" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="139" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="159" cy="285" r="0.5" style="stroke:#000000"/>
-<circle cx="125" cy="316" r="0.5" style="stroke:#000000"/>
-<circle cx="148" cy="328" r="0.5" style="stroke:#000000"/>
-<circle cx="178" cy="306" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="140" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="173" cy="297" r="0.5" style="stroke:#000000"/>
-<circle cx="138" cy="289" r="0.5" style="stroke:#000000"/>
-<circle cx="167" cy="287" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="487" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="476" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="476" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="521" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="108" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="135" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="516" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="521" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="481" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="470" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="103" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="522" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="483" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="124" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="493" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="493" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="134" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="506" cy="95" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="479" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="519" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="527" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="515" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="512" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="114" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="480" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="491" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="518" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="505" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="513" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="127" r="0.5" style="stroke:#000000"/>
-<circle cx="514" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="507" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="508" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="101" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="501" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="519" cy="141" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="125" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="528" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="529" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="499" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="496" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="503" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="113" r="0.5" style="stroke:#000000"/>
-<circle cx="525" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="504" cy="110" r="0.5" style="stroke:#000000"/>
-<circle cx="483" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="477" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="112" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="507" cy="111" r="0.5" style="stroke:#000000"/>
-<circle cx="494" cy="93" r="0.5" style="stroke:#000000"/>
-<circle cx="481" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="510" cy="96" r="0.5" style="stroke:#000000"/>
-<circle cx="492" cy="137" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="511" cy="138" r="0.5" style="stroke:#000000"/>
-<circle cx="500" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="484" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="485" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="479" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="497" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="526" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="495" cy="123" r="0.5" style="stroke:#000000"/>
-<circle cx="482" cy="106" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="119" r="0.5" style="stroke:#000000"/>
-<circle cx="502" cy="116" r="0.5" style="stroke:#000000"/>
-<circle cx="474" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="526" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="484" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="486" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="118" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="489" cy="142" r="0.5" style="stroke:#000000"/>
-<circle cx="509" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="475" cy="136" r="0.5" style="stroke:#000000"/>
-<circle cx="498" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="528" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="490" cy="104" r="0.5" style="stroke:#000000"/>
-<circle cx="523" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="488" cy="109" r="0.5" style="stroke:#000000"/>
-<circle cx="517" cy="107" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="277" r="0.5" style="stroke:#000000"/>
-<circle cx="235" cy="324" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="312" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="375" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="363" cy="164" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="343" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="372" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="238" cy="232" r="0.5" style="stroke:#000000"/>
-<circle cx="376" cy="310" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="299" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="256" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="182" cy="162" r="0.5" style="stroke:#000000"/>
-<circle cx="229" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="328" cy="75" r="0.5" style="stroke:#000000"/>
-<circle cx="180" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="225" cy="144" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="406" cy="282" r="0.5" style="stroke:#000000"/>
-<circle cx="320" cy="245" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="328" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="115" r="0.5" style="stroke:#000000"/>
-<circle cx="253" cy="221" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="332" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="140" r="0.5" style="stroke:#000000"/>
-<circle cx="231" cy="259" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="348" cy="208" r="0.5" style="stroke:#000000"/>
-<circle cx="273" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="342" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="177" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="276" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="348" cy="222" r="0.5" style="stroke:#000000"/>
-<circle cx="269" cy="159" r="0.5" style="stroke:#000000"/>
-<circle cx="388" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="172" r="0.5" style="stroke:#000000"/>
-<circle cx="200" cy="158" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="99" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="201" r="0.5" style="stroke:#000000"/>
-<circle cx="379" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="277" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="275" cy="187" r="0.5" style="stroke:#000000"/>
-<circle cx="324" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="312" cy="204" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="255" r="0.5" style="stroke:#000000"/>
-<circle cx="262" cy="198" r="0.5" style="stroke:#000000"/>
-<circle cx="403" cy="283" r="0.5" style="stroke:#000000"/>
-<circle cx="223" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="207" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="237" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="150" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="268" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="322" r="0.5" style="stroke:#000000"/>
-<circle cx="250" cy="117" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="97" r="0.5" style="stroke:#000000"/>
-<circle cx="327" cy="122" r="0.5" style="stroke:#000000"/>
-<circle cx="412" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="329" cy="315" r="0.5" style="stroke:#000000"/>
-<circle cx="372" cy="130" r="0.5" style="stroke:#000000"/>
-<circle cx="328" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="279" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="248" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="218" r="0.5" style="stroke:#000000"/>
-<circle cx="297" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="257" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="308" cy="235" r="0.5" style="stroke:#000000"/>
-<circle cx="296" cy="312" r="0.5" style="stroke:#000000"/>
-<circle cx="305" cy="240" r="0.5" style="stroke:#000000"/>
-<circle cx="264" cy="178" r="0.5" style="stroke:#000000"/>
-<circle cx="383" cy="317" r="0.5" style="stroke:#000000"/>
-<circle cx="319" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="247" cy="241" r="0.5" style="stroke:#000000"/>
-<circle cx="306" cy="193" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="319" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="280" cy="211" r="0.5" style="stroke:#000000"/>
-<circle cx="296" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="243" cy="272" r="0.5" style="stroke:#000000"/>
-<circle cx="392" cy="263" r="0.5" style="stroke:#000000"/>
-<circle cx="331" cy="74" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="181" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="168" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="288" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="326" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="325" cy="205" r="0.5" style="stroke:#000000"/>
-<circle cx="287" cy="206" r="0.5" style="stroke:#000000"/>
-<circle cx="194" cy="265" r="0.5" style="stroke:#000000"/>
-<circle cx="397" cy="314" r="0.5" style="stroke:#000000"/>
-<circle cx="307" cy="204" r="0.5" style="stroke:#000000"/>
-<circle cx="286" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="436" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="373" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="298" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="244" cy="172" r="0.5" style="stroke:#000000"/>
-<circle cx="360" cy="290" r="0.5" style="stroke:#000000"/>
-<circle cx="299" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="201" cy="252" r="0.5" style="stroke:#000000"/>
-<circle cx="323" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="350" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="341" cy="170" r="0.5" style="stroke:#000000"/>
-<circle cx="349" cy="157" r="0.5" style="stroke:#000000"/>
-<circle cx="340" cy="94" r="0.5" style="stroke:#000000"/>
-<circle cx="202" cy="147" r="0.5" style="stroke:#000000"/>
-<circle cx="254" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="309" cy="176" r="0.5" style="stroke:#000000"/>
-<circle cx="260" cy="183" r="0.5" style="stroke:#000000"/>
-<circle cx="391" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="326" cy="210" r="0.5" style="stroke:#000000"/>
-<circle cx="210" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="364" cy="163" r="0.5" style="stroke:#000000"/>
-<circle cx="271" cy="121" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="149" r="0.5" style="stroke:#000000"/>
-<circle cx="278" cy="205" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="311" r="0.5" style="stroke:#000000"/>
-<circle cx="363" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="262" cy="236" r="0.5" style="stroke:#000000"/>
-<circle cx="369" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="327" r="0.5" style="stroke:#000000"/>
-<circle cx="283" cy="143" r="0.5" style="stroke:#000000"/>
-<circle cx="239" cy="194" r="0.5" style="stroke:#000000"/>
-<circle cx="333" cy="231" r="0.5" style="stroke:#000000"/>
-<circle cx="340" cy="129" r="0.5" style="stroke:#000000"/>
-<circle cx="271" cy="105" r="0.5" style="stroke:#000000"/>
-<circle cx="302" cy="100" r="0.5" style="stroke:#000000"/>
-<circle cx="303" cy="197" r="0.5" style="stroke:#000000"/>
-<circle cx="395" cy="303" r="0.5" style="stroke:#000000"/>
-<circle cx="210" cy="227" r="0.5" style="stroke:#000000"/>
-<circle cx="317" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="441" cy="184" r="0.5" style="stroke:#000000"/>
-<circle cx="447" cy="175" r="0.5" style="stroke:#000000"/>
-<circle cx="294" cy="191" r="0.5" style="stroke:#000000"/>
-<circle cx="281" cy="184" r="0.5" style="stroke:#000000"/>
-<circle cx="212" cy="148" r="0.5" style="stroke:#000000"/>
-<circle cx="315" cy="179" r="0.5" style="stroke:#000000"/>
-<circle cx="318" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="232" cy="164" r="0.5" style="stroke:#000000"/>
-<circle cx="425" cy="239" r="0.5" style="stroke:#000000"/>
-<circle cx="387" cy="195" r="0.5" style="stroke:#000000"/>
-<circle cx="322" cy="152" r="0.5" style="stroke:#000000"/>
-<circle cx="213" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="187" cy="132" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="161" r="0.5" style="stroke:#000000"/>
-<circle cx="292" cy="202" r="0.5" style="stroke:#000000"/>
-<circle cx="336" cy="155" r="0.5" style="stroke:#000000"/>
-<circle cx="272" cy="65" r="0.5" style="stroke:#000000"/>
-<circle cx="204" cy="190" r="0.5" style="stroke:#000000"/>
-<circle cx="351" cy="82" r="0.5" style="stroke:#000000"/>
-<circle cx="259" cy="284" r="0.5" style="stroke:#000000"/>
-<circle cx="288" cy="189" r="0.5" style="stroke:#000000"/>
-<circle cx="300" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="353" cy="288" r="0.5" style="stroke:#000000"/>
-<circle cx="301" cy="199" r="0.5" style="stroke:#000000"/>
-<circle cx="218" cy="128" r="0.5" style="stroke:#000000"/>
-<circle cx="226" cy="243" r="0.5" style="stroke:#000000"/>
-<circle cx="195" cy="146" r="0.5" style="stroke:#000000"/>
-<circle cx="284" cy="174" r="0.5" style="stroke:#000000"/>
-<circle cx="428" cy="200" r="0.5" style="stroke:#000000"/>
-<circle cx="274" cy="214" r="0.5" style="stroke:#000000"/>
-<circle cx="211" cy="131" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="196" r="0.5" style="stroke:#000000"/>
-<circle cx="310" cy="180" r="0.5" style="stroke:#000000"/>
-<circle cx="172" cy="257" r="0.5" style="stroke:#000000"/>
-<circle cx="431" cy="212" r="0.5" style="stroke:#000000"/>
-<circle cx="290" cy="187" r="0.5" style="stroke:#000000"/>
-<circle cx="219" cy="203" r="0.5" style="stroke:#000000"/>
-<circle cx="230" cy="279" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="192" r="0.5" style="stroke:#000000"/>
-<circle cx="291" cy="254" r="0.5" style="stroke:#000000"/>
-<circle cx="245" cy="309" r="0.5" style="stroke:#000000"/>
-<circle cx="345" cy="126" r="0.5" style="stroke:#000000"/>
-<circle cx="175" cy="278" r="0.5" style="stroke:#000000"/>
-<circle cx="289" cy="338" r="0.5" style="stroke:#000000"/>
-<circle cx="442" cy="228" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="249" cy="120" r="0.5" style="stroke:#000000"/>
-<circle cx="415" cy="186" r="0.5" style="stroke:#000000"/>
-<circle cx="242" cy="145" r="0.5" style="stroke:#000000"/>
-<circle cx="384" cy="133" r="0.5" style="stroke:#000000"/>
-<circle cx="20" cy="98" r="1" style="stroke:#ff0000"/>
-<circle cx="50" cy="246" r="1" style="stroke:#ff0000"/>
-<circle cx="83" cy="354" r="1" style="stroke:#ff0000"/>
-<circle cx="164" cy="416" r="1" style="stroke:#ff0000"/>
-<circle cx="236" cy="434" r="1" style="stroke:#ff0000"/>
-<circle cx="343" cy="427" r="1" style="stroke:#ff0000"/>
-<circle cx="366" cy="412" r="1" style="stroke:#ff0000"/>
-<circle cx="379" cy="402" r="1" style="stroke:#ff0000"/>
-<circle cx="519" cy="143" r="1" style="stroke:#ff0000"/>
-<circle cx="528" cy="126" r="1" style="stroke:#ff0000"/>
-<circle cx="529" cy="115" r="1" style="stroke:#ff0000"/>
-<circle cx="510" cy="96" r="1" style="stroke:#ff0000"/>
-<circle cx="506" cy="95" r="1" style="stroke:#ff0000"/>
-<circle cx="117" cy="33" r="1" style="stroke:#ff0000"/>
-<circle cx="85" cy="28" r="1" style="stroke:#ff0000"/>
-<circle cx="40" cy="64" r="1" style="stroke:#ff0000"/>
-</svg>
diff --git a/testsuite/tests/dph/quickhull/dph-quickhull.T b/testsuite/tests/dph/quickhull/dph-quickhull.T
deleted file mode 100644
index 7d8cf322ab..0000000000
--- a/testsuite/tests/dph/quickhull/dph-quickhull.T
+++ /dev/null
@@ -1,20 +0,0 @@
-
-test ('dph-quickhull-copy-fast'
- , [ outputdir('copy-fast')
- , reqlib('dph-lifted-copy')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -fno-vectorisation-avoidance -package dph-lifted-copy -package dph-prim-par'])
-
-
-test ('dph-quickhull-vseg-fast'
- , [ outputdir('vseg-fast')
- , reqlib('dph-lifted-vseg')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-vseg -package dph-prim-par'])
-
diff --git a/testsuite/tests/dph/smvm/Main.hs b/testsuite/tests/dph/smvm/Main.hs
deleted file mode 100644
index d6b9a0f55c..0000000000
--- a/testsuite/tests/dph/smvm/Main.hs
+++ /dev/null
@@ -1,60 +0,0 @@
-{-# LANGUAGE TypeOperators #-}
-
-import SMVMVect (smvm)
-
-import Control.Exception (evaluate)
-import System.IO
-import System.Environment
-
-import qualified Data.Array.Parallel.Unlifted as U
-import Data.Array.Parallel.Prelude
-import Data.Array.Parallel.PArray as P
-
-
--- Load sparse matrix from a file
-loadSM :: String
- -> IO (PArray (PArray (Int, Double)), PArray Double)
-
-loadSM s
- = do
- (segd, m, v) <- loadSM' s
- return $ (nestUSegd segd (fromUArray2 m), fromUArray v)
-
-
-loadSM' :: String
- -> IO ( U.Segd
- , U.Array (Int, Double)
- , U.Array Double)
-loadSM' fname =
- do
- h <- openBinaryFile fname ReadMode
- lengths <- U.hGet h
- indices <- U.hGet h
- values <- U.hGet h
- dv <- U.hGet h
- let segd = U.lengthsToSegd lengths
- m = U.zip indices values
- evaluate lengths
- evaluate indices
- evaluate values
- evaluate dv
- return (segd, m, dv)
-
-main
- = do [inFile, outFile] <- getArgs
- (m, v) <- loadSM inFile
- let result = smvm m v
-
- -- ignore wibbles in low-order bits
- let output
- = (unlines
- $ map (take 12)
- $ map show
- $ P.toList result)
- ++ ("SUM = "
- ++ (take 12 $ show $ sum $ P.toList result)
- ++ "\n")
-
- -- check our result against the provided outFile
- outputCheck <- readFile outFile
- print $ output == outputCheck
diff --git a/testsuite/tests/dph/smvm/Makefile b/testsuite/tests/dph/smvm/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/smvm/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/smvm/SMVMVect.hs b/testsuite/tests/dph/smvm/SMVMVect.hs
deleted file mode 100644
index 93f3775741..0000000000
--- a/testsuite/tests/dph/smvm/SMVMVect.hs
+++ /dev/null
@@ -1,17 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise #-}
-module SMVMVect (smvm) where
-
-import Data.Array.Parallel
-import Data.Array.Parallel.Prelude.Double as D
-import Data.Array.Parallel.Prelude.Int as I
-
-import qualified Prelude as P
-
-smvm :: PArray (PArray (Int, Double)) -> PArray Double -> PArray Double
-{-# NOINLINE smvm #-}
-smvm m v = toPArrayP (smvm' (fromNestedPArrayP m) (fromPArrayP v))
-
-smvm' :: [:[: (Int, Double) :]:] -> [:Double:] -> [:Double:]
-smvm' m v = [: D.sumP [: x D.* (v !: i) | (i,x) <- row :] | row <- m :]
-
diff --git a/testsuite/tests/dph/smvm/dph-smvm-copy.stdout b/testsuite/tests/dph/smvm/dph-smvm-copy.stdout
deleted file mode 100644
index 0ca95142bb..0000000000
--- a/testsuite/tests/dph/smvm/dph-smvm-copy.stdout
+++ /dev/null
@@ -1 +0,0 @@
-True
diff --git a/testsuite/tests/dph/smvm/dph-smvm-vseg.stdout b/testsuite/tests/dph/smvm/dph-smvm-vseg.stdout
deleted file mode 100644
index 0ca95142bb..0000000000
--- a/testsuite/tests/dph/smvm/dph-smvm-vseg.stdout
+++ /dev/null
@@ -1 +0,0 @@
-True
diff --git a/testsuite/tests/dph/smvm/dph-smvm.T b/testsuite/tests/dph/smvm/dph-smvm.T
deleted file mode 100644
index f2bf31ab82..0000000000
--- a/testsuite/tests/dph/smvm/dph-smvm.T
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-testFile = 'nothing'
-if config.platform.startswith('i386-'):
- testFile = 'test-i386.dat'
- outFile = 'result-i386.txt'
-
-elif config.platform.startswith('x86_64-'):
- testFile = 'test-x86_64.dat'
- outFile = 'result-x86_64.txt'
-
-elif config.platform.startswith('sparc-'):
- testFile = 'test-sparc.dat'
- outFile = 'result-sparc.txt'
-
-
-if testFile != 'nothing':
- test ('dph-smvm-copy'
- , [ outputdir('copy')
- , when(fast(), skip)
- , reqlib('dph-lifted-copy')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2'])
- , extra_run_opts(testFile + " " + outFile)
- ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-copy -package dph-prim-par'])
-
- test ('dph-smvm-vseg'
- , [ outputdir('vseg')
- , when(fast(), skip)
- , reqlib('dph-lifted-vseg')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2'])
- , extra_run_opts(testFile + " " + outFile)
- ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-vseg -package dph-prim-par'])
-
diff --git a/testsuite/tests/dph/smvm/result-i386.txt b/testsuite/tests/dph/smvm/result-i386.txt
deleted file mode 100644
index bf279482ef..0000000000
--- a/testsuite/tests/dph/smvm/result-i386.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-70.911036010
-6.2813390683
-22.790766463
-138.15513262
-52.633427554
-23.459671609
-39.794269586
-37.387466366
-16.666309389
-86.252836326
-2.0045195528
-89.578046705
-15.195705417
-14.397637033
-9.9571970137
-12.966919776
-314.12848526
-106.92515769
-53.308659874
-187.71842503
-19.814258245
-3.5465802997
-26.462654791
-39.989634289
-27.636953710
-14.238025227
-43.040256543
-2.1571625382
-67.541648911
-24.912387408
-7.6904324146
-2.9650091269
-48.668083695
-56.313556473
-285.31615184
-25.595785904
-49.488178849
-25.310153120
-10.706428715
-80.585871589
-225.85945599
-27.813502732
-36.745192736
-157.41617010
-51.501091484
-30.457678049
-254.13030691
-17.469473192
-60.702335620
-52.376229564
-26.517446882
-46.939308590
-19.961999016
-226.11502829
-69.361878263
-206.34127990
-59.002071706
-23.815778535
-101.90955813
-0.3802732664
-41.728371059
-12.021386376
-20.282213202
-17.500045961
-19.148201048
-73.983800195
-7.6944408324
-20.993610043
-58.350721826
-67.038534218
-31.260033960
-14.283638817
-140.68179300
-31.766861701
-46.639106640
-5.2416016510
-175.49192085
-6.1624941117
-3.0550277985
-51.818892673
-7.8677940322
-22.311195092
-258.22325771
-47.475395836
-104.78223912
-38.825154663
-1.6611687222
-63.278567845
-139.86840253
-72.273773546
-71.487712807
-46.823777361
-125.50127870
-3.7203037750
-48.211248191
-79.659040149
-59.672472372
-73.220258924
-63.910310588
-23.405170831
-SUM = 6054.6294998
diff --git a/testsuite/tests/dph/smvm/result-sparc.txt b/testsuite/tests/dph/smvm/result-sparc.txt
deleted file mode 100644
index 8c85795cbc..0000000000
--- a/testsuite/tests/dph/smvm/result-sparc.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-31.171134675
-136.96399669
-99.558688941
-2.3944559306
-132.07457337
-64.316928783
-17.141482371
-363.11345177
-12.350699032
-62.403552077
-25.836846192
-488.62415222
-90.786181827
-2650.5823673
-28.153073045
-29.698154931
-280.42051630
-264.68315963
-0.0
-17.241401450
-103.44167214
-120.25222269
-0.6481556022
-3.8143291874
-57.942419415
-0.9485226158
-11.722857133
-80.685346313
-497.97232376
-7.3021493591
-0.0
-4.9013220836
-61.582851534
-104.83102162
-12.196177619
-16.799924219
-8.8828491057
-20.672947720
-0.0
-8.9693097972
-66.272730332
-145.39838263
-2.6011327691
-80.289657428
-17.075494290
-0.5897431148
-26.250003553
-114.75531349
-57.010466242
-38.222004332
-5.6130133753
-120.90679901
-106.19820538
-0.0
-22.471060597
-50.616335208
-0.7352665245
-13.632854738
-72.201368578
-54.552907983
-3.2165935380
-31.048444965
-3.3117670262
-224.93467543
-110.02973746
-2.0467456318
-0.0
-7.2930317411
-8.6809940997
-41.756667327
-118.07161086
-358.47370477
-8.1013874742
-9.1189573118
-35.367265915
-10.245691446
-25.785856741
-55.679020534
-83.594437531
-34.102347192
-0.2950061972
-16.641363479
-0.0
-29.534024840
-0.0
-26.338163918
-149.17642877
-0.1698288578
-24.176530881
-57.626923103
-33.976034955
-15.977447399
-0.0
-893.79869661
-117.52170252
-60.450794548
-0.5763239875
-4.9690229931
-14.014097678
-275.53547442
-SUM = 9808.1107603
diff --git a/testsuite/tests/dph/smvm/result-x86_64.txt b/testsuite/tests/dph/smvm/result-x86_64.txt
deleted file mode 100644
index ebad60a2b0..0000000000
--- a/testsuite/tests/dph/smvm/result-x86_64.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-2.3160849869
-26.283679649
-76.729994661
-405.68040155
-55.723673494
-33.938026665
-26.505926115
-52.261424813
-33.397325696
-1.1328178441
-5.3697979892
-9.4419428065
-28.678826876
-61.019008268
-4.5301894841
-43.464645691
-0.0
-34.335714653
-20.798359422
-16.561984995
-17.581964787
-23.948149350
-19.120544306
-30.215710069
-0.7009196726
-51.297030554
-4.4591823094
-209.96809687
-47.289681980
-32.498492600
-13.196267290
-0.9989265108
-1.0341069617
-38.917182375
-7.9955088012
-10.355804741
-20.095073245
-36.647037472
-18.786308469
-14.370553796
-6.3265152208
-28.117268967
-65.265404040
-898.53639610
-2.1015959321
-188.65890412
-31.810545943
-14.182075117
-16.239269064
-27.309800346
-126.26472539
-32.948733352
-20.290181336
-0.0
-40.083403468
-81.626718007
-141.59574874
-8.5797914307
-37.726704414
-0.5807127190
-6.3771256902
-6.3486182511
-5.8655193980
-8.1395223932
-32.695645766
-16.964781766
-5.2863815777
-31.967858939
-21.161490986
-61.257464383
-4.1240057418
-18.099623432
-2.1851562467
-3.7220913984
-55.452918211
-10.289474473
-46.276301220
-23.201718136
-7.6338488432
-45.868472148
-12.976885901
-18.483762115
-143.50458515
-24.999794955
-12.121764180
-6.7194800847
-1.8693415211
-23.848562170
-1092.0362340
-67.588787350
-248.07913042
-0.0
-38.838570262
-13.800391661
-1277.9084108
-53.491216504
-14.325720303
-10.152650478
-17.439312837
-40.696348267
-SUM = 6837.6898296
diff --git a/testsuite/tests/dph/smvm/test-i386.dat b/testsuite/tests/dph/smvm/test-i386.dat
deleted file mode 100644
index 4db8d62620..0000000000
--- a/testsuite/tests/dph/smvm/test-i386.dat
+++ /dev/null
Binary files differ
diff --git a/testsuite/tests/dph/smvm/test-sparc.dat b/testsuite/tests/dph/smvm/test-sparc.dat
deleted file mode 100644
index 73d2c201cd..0000000000
--- a/testsuite/tests/dph/smvm/test-sparc.dat
+++ /dev/null
Binary files differ
diff --git a/testsuite/tests/dph/smvm/test-x86_64.dat b/testsuite/tests/dph/smvm/test-x86_64.dat
deleted file mode 100644
index 08a91f5ab1..0000000000
--- a/testsuite/tests/dph/smvm/test-x86_64.dat
+++ /dev/null
Binary files differ
diff --git a/testsuite/tests/dph/sumnats/Main.hs b/testsuite/tests/dph/sumnats/Main.hs
deleted file mode 100644
index 7c3ee7210b..0000000000
--- a/testsuite/tests/dph/sumnats/Main.hs
+++ /dev/null
@@ -1,21 +0,0 @@
-
-import SumNatsVect (sumNats)
-
--- Solution for 1st Euler problem
--- Add all the natural numbers below 1000 that are multiples of 3 or 5.
-
-solutionLists maxN
- = let sumOnetoN n = n * (n+1) `div` 2
- sumStep s n = s * sumOnetoN (n `div` s)
- in sumStep 3 (maxN - 1) + sumStep 5 (maxN - 1) - sumStep 15 (maxN - 1)
-
-solutionLists2 maxN
- = sum [ x | x <- [0.. maxN - 1]
- , (x `mod` 3 == 0) || (x `mod` 5 == 0) ]
-
-main
- = do let n = 1000
- print $ solutionLists n
- print $ solutionLists2 n
- print $ sumNats n
-
diff --git a/testsuite/tests/dph/sumnats/Makefile b/testsuite/tests/dph/sumnats/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/sumnats/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/sumnats/SumNatsVect.hs b/testsuite/tests/dph/sumnats/SumNatsVect.hs
deleted file mode 100644
index 187946da4e..0000000000
--- a/testsuite/tests/dph/sumnats/SumNatsVect.hs
+++ /dev/null
@@ -1,14 +0,0 @@
-{-# LANGUAGE ParallelArrays #-}
-{-# OPTIONS -fvectorise #-}
-module SumNatsVect (sumNats) where
-
-import Data.Array.Parallel.Prelude
-import Data.Array.Parallel.Prelude.Int as I
-
-import qualified Prelude as P
-
-sumNats :: Int -> Int
-sumNats maxN
- = sumP [: x | x <- enumFromToP 0 (maxN I.- 1)
- , (x `mod` 3 I.== 0) || (x `mod` 5 I.== 0) :]
-
diff --git a/testsuite/tests/dph/sumnats/dph-sumnats-copy.stdout b/testsuite/tests/dph/sumnats/dph-sumnats-copy.stdout
deleted file mode 100644
index 8858be2164..0000000000
--- a/testsuite/tests/dph/sumnats/dph-sumnats-copy.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-233168
-233168
-233168
diff --git a/testsuite/tests/dph/sumnats/dph-sumnats-vseg.stdout b/testsuite/tests/dph/sumnats/dph-sumnats-vseg.stdout
deleted file mode 100644
index 8858be2164..0000000000
--- a/testsuite/tests/dph/sumnats/dph-sumnats-vseg.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-233168
-233168
-233168
diff --git a/testsuite/tests/dph/sumnats/dph-sumnats.T b/testsuite/tests/dph/sumnats/dph-sumnats.T
deleted file mode 100644
index 66e4b404d6..0000000000
--- a/testsuite/tests/dph/sumnats/dph-sumnats.T
+++ /dev/null
@@ -1,20 +0,0 @@
-
-test ('dph-sumnats-copy'
- , [ outputdir('copy')
- , reqlib('dph-lifted-copy')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-copy'])
-
-
-test ('dph-sumnats-vseg'
- , [ outputdir('vseg')
- , reqlib('dph-lifted-vseg')
- , reqlib('dph-prim-par')
- , only_ways(['normal', 'threaded1', 'threaded2']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-vseg'])
-
diff --git a/testsuite/tests/dph/words/Main.hs b/testsuite/tests/dph/words/Main.hs
deleted file mode 100644
index b7c266921f..0000000000
--- a/testsuite/tests/dph/words/Main.hs
+++ /dev/null
@@ -1,37 +0,0 @@
-
-import WordsVect
-import Data.Array.Parallel
-import qualified Data.Array.Parallel.Prelude.Word8 as W
-import qualified Data.Array.Parallel.PArray as P
-import qualified Data.Array.Parallel.Unlifted as U
-import Data.Char
-
-main
- = do -- take the filename containing the words as the first arg
- let str = "When I look into the looking glass I'm always sure to see"
- ++ " no matter how I dodge about, me looking back at me."
-
- -- convert string to a PArray
- let paStr :: PArray W.Word8
- paStr = P.fromUArray $ U.map W.fromInt $ U.fromList $ map ord str
-
-
- -- break the string into words then flatten it back
- let str' :: String
- str' = map chr
- $ map fromIntegral
- $ P.toList
- $ wordsOfPArray paStr
-
-
- -- count the number of words in the string, using the vectorised program
- let wordCountVect = fromIntegral $ wordCountOfPArray paStr
-
- -- count the number of words with the ye'olde list way
- let wordCountList = length $ words str
-
- --
- putStr $ show str' ++ "\n"
- ++ "word count vect = " ++ show wordCountVect ++ "\n"
- ++ "word count lists = " ++ show wordCountList ++ "\n"
-
diff --git a/testsuite/tests/dph/words/Makefile b/testsuite/tests/dph/words/Makefile
deleted file mode 100644
index 9101fbd40a..0000000000
--- a/testsuite/tests/dph/words/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/dph/words/WordsVect.hs b/testsuite/tests/dph/words/WordsVect.hs
deleted file mode 100644
index 218e885dac..0000000000
--- a/testsuite/tests/dph/words/WordsVect.hs
+++ /dev/null
@@ -1,125 +0,0 @@
-
--- Break up a string into words in parallel.
--- Based on the presentation "Breaking Sequential Habits of Thought", Guy Steele.
--- http://groups.csail.mit.edu/mac/users/gjs/6.945/readings/MITApril2009Steele.pdf
---
--- NOTE: This is a naive implementation, and I haven't benchmarked it.
--- Using parallel arrays in Seg probably isn't helpful for performance,
--- but it's a stress test for the vectoriser.
---
--- If we actually cared about performance we wouldn't want to recursively
--- subdivide the string right down to individual characters.
---
-{-# LANGUAGE ParallelArrays, ParallelListComp #-}
-{-# OPTIONS -fvectorise #-}
-
-module WordsVect
- ( wordsOfPArray
- , wordCountOfPArray )
-where
-import qualified Data.Array.Parallel.Prelude.Word8 as W
-import Data.Array.Parallel.Prelude.Word8 (Word8)
-import Data.Array.Parallel.Prelude.Int as I
-import Data.Array.Parallel
-
-import qualified Prelude as Prel
-
-
--- We can't use the Prelude Char and String types in vectorised code yet..
-type Char = Word8
-char_space = W.fromInt 32
-
-type String = [: Char :]
-
-
--- | Word state
-data State
- = Chunk String
- | Seg String -- initial word chunk
- [:String:] -- complete words in the middle of the segment
- String -- final word chunk
-
-
--- | Compose two wordstates.
-plusState :: State -> State -> State
-plusState str1 str2
- = case (str1, str2) of
- (Chunk as, Chunk bs) -> Chunk (as +:+ bs)
- (Chunk as, Seg bl bss br) -> Seg (as +:+ bl) bss br
- (Seg al ass ar, Chunk bs) -> Seg al ass (ar +:+ bs)
- (Seg al ass ar, Seg bl bss br) -> Seg al (ass +:+ joinEmpty [:ar +:+ bl:] +:+ bss) br
-
-joinEmpty :: [:[:Word8:]:] -> [:[:Word8:]:]
-joinEmpty ws
- | lengthP ws I.== 1 && lengthP (ws !: 0) I.== 0 = [::]
- | otherwise = ws
-
-
--- | Convert a single char to a wordstate.
-stateOfChar :: Char -> State
-stateOfChar c
- | c W.== char_space = Seg [::] [::] [::]
- | otherwise = Chunk [:c:]
-
-
--- | Break this string into words.
-stateOfString :: String -> State
-stateOfString str
- = let len = lengthP str
- result
- | len I.== 0 = Chunk [::]
- | len I.== 1 = stateOfChar (str !: 0)
- | otherwise
- = let half = len `div` 2
- s1 = sliceP 0 half str
- s2 = sliceP half (len I.- half) str
- in plusState (stateOfString s1) (stateOfString s2)
- in result
-
-
--- | Count the number of words in a string.
-countWordsOfState :: State -> Int
-countWordsOfState state
- = case state of
- Chunk c -> wordsInChunkArr c
- Seg c1 ws c2 -> wordsInChunkArr c1 I.+ lengthP ws I.+ wordsInChunkArr c2
-
-wordsInChunkArr :: [:Word8:] -> Int
-wordsInChunkArr arr
- | lengthP arr I.== 0 = 0
- | otherwise = 1
-
-
--- | Flatten a state back to an array of Word8s,
--- inserting spaces between the words.
-flattenState :: State -> [:Word8:]
-flattenState ss
- = case ss of
- Chunk s -> s
-
- Seg w1 ws w2
- -> w1
- +:+ [:char_space:]
- +:+ concatP [: w +:+ [:char_space:] | w <- ws :]
- +:+ w2
-
--- Interface ------------------------------------------------------------------
-
--- | Break up an array of chars into words then flatten it back.
-wordsOfPArray :: PArray Word8 -> PArray Word8
-{-# NOINLINE wordsOfPArray #-}
-wordsOfPArray arr
- = let str = fromPArrayP arr
- state = stateOfString str
- strOut = flattenState state
- in toPArrayP strOut
-
-
--- | Count the number of words in an array
-wordCountOfPArray :: PArray Word8 -> Int
-{-# NOINLINE wordCountOfPArray #-}
-wordCountOfPArray arr
- = let str = fromPArrayP arr
- state = stateOfString str
- in countWordsOfState state
-
diff --git a/testsuite/tests/dph/words/dph-words-copy-fast.stdout b/testsuite/tests/dph/words/dph-words-copy-fast.stdout
deleted file mode 100644
index a7ad9be6b6..0000000000
--- a/testsuite/tests/dph/words/dph-words-copy-fast.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-"When I look into the looking glass I'm always sure to see no matter how I dodge about, me looking back at me."
-word count vect = 23
-word count lists = 23
diff --git a/testsuite/tests/dph/words/dph-words-copy-opt.stdout b/testsuite/tests/dph/words/dph-words-copy-opt.stdout
deleted file mode 100644
index a7ad9be6b6..0000000000
--- a/testsuite/tests/dph/words/dph-words-copy-opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-"When I look into the looking glass I'm always sure to see no matter how I dodge about, me looking back at me."
-word count vect = 23
-word count lists = 23
diff --git a/testsuite/tests/dph/words/dph-words-vseg-fast.stdout b/testsuite/tests/dph/words/dph-words-vseg-fast.stdout
deleted file mode 100644
index a7ad9be6b6..0000000000
--- a/testsuite/tests/dph/words/dph-words-vseg-fast.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-"When I look into the looking glass I'm always sure to see no matter how I dodge about, me looking back at me."
-word count vect = 23
-word count lists = 23
diff --git a/testsuite/tests/dph/words/dph-words-vseg-opt.stdout b/testsuite/tests/dph/words/dph-words-vseg-opt.stdout
deleted file mode 100644
index a7ad9be6b6..0000000000
--- a/testsuite/tests/dph/words/dph-words-vseg-opt.stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-"When I look into the looking glass I'm always sure to see no matter how I dodge about, me looking back at me."
-word count vect = 23
-word count lists = 23
diff --git a/testsuite/tests/dph/words/dph-words.T b/testsuite/tests/dph/words/dph-words.T
deleted file mode 100644
index 7173278914..0000000000
--- a/testsuite/tests/dph/words/dph-words.T
+++ /dev/null
@@ -1,20 +0,0 @@
-
-test ('dph-words-copy-fast'
- , [ outputdir('copy-fast')
- , reqlib('dph-lifted-copy')
- , reqlib('dph-prim-par')
- , only_ways(['normal']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-copy -package dph-prim-par'])
-
-
-test ('dph-words-vseg-fast'
- , [ outputdir('vseg-fast')
- , reqlib('dph-lifted-vseg')
- , reqlib('dph-prim-par')
- , only_ways(['normal']) ]
- , multimod_compile_and_run
- , [ 'Main'
- , '-O0 -package dph-lifted-vseg -package dph-prim-par'])
-
diff --git a/testsuite/tests/ghc-api/T9015.hs b/testsuite/tests/ghc-api/T9015.hs
index 6f7efec8d0..977390b88e 100644
--- a/testsuite/tests/ghc-api/T9015.hs
+++ b/testsuite/tests/ghc-api/T9015.hs
@@ -13,7 +13,6 @@ testStrings = [
, "add a b = a+b"
, "data Foo = Foo String"
, "deriving instance Show Foo"
- , "{-# NOVECTORISE foo #-}"
, "{-# WARNING Foo \"Just a warning\" #-}"
, "{-# ANN foo (Just \"Hello\") #-}"
, "{-# RULES \"map/map\" forall f g xs. map f (map g xs) = map (f.g) xs #-}"
diff --git a/testsuite/tests/ghc-api/T9015.stdout b/testsuite/tests/ghc-api/T9015.stdout
index 7b9b6e92de..0d0394eb39 100644
--- a/testsuite/tests/ghc-api/T9015.stdout
+++ b/testsuite/tests/ghc-api/T9015.stdout
@@ -5,7 +5,6 @@ import Data.Maybe (isJust): True
add a b = a+b: False
data Foo = Foo String: False
deriving instance Show Foo: False
-{-# NOVECTORISE foo #-}: False
{-# WARNING Foo "Just a warning" #-}: False
{-# ANN foo (Just "Hello") #-}: False
{-# RULES "map/map" forall f g xs. map f (map g xs) = map (f.g) xs #-}: False
@@ -34,7 +33,6 @@ import Data.Maybe (isJust): False
add a b = a+b: True
data Foo = Foo String: True
deriving instance Show Foo: True
-{-# NOVECTORISE foo #-}: True
{-# WARNING Foo "Just a warning" #-}: True
{-# ANN foo (Just "Hello") #-}: True
{-# RULES "map/map" forall f g xs. map f (map g xs) = map (f.g) xs #-}: True
@@ -63,7 +61,6 @@ import Data.Maybe (isJust): False
add a b = a+b: False
data Foo = Foo String: False
deriving instance Show Foo: False
-{-# NOVECTORISE foo #-}: False
{-# WARNING Foo "Just a warning" #-}: False
{-# ANN foo (Just "Hello") #-}: False
{-# RULES "map/map" forall f g xs. map f (map g xs) = map (f.g) xs #-}: False
@@ -84,3 +81,4 @@ x <- foo y: True
a <-: False
2 +: False
@#: False
+
diff --git a/testsuite/tests/ghci/should_run/T7253.script b/testsuite/tests/ghci/should_run/T7253.script
index 0ab8337bae..cad4a19746 100644
--- a/testsuite/tests/ghci/should_run/T7253.script
+++ b/testsuite/tests/ghci/should_run/T7253.script
@@ -55,7 +55,6 @@ upcase foo
{-# RULES "map/map" forall f g xs. map f (map g xs) = map (f.g) xs #-}
{-# ANN foo (Just "Hello") #-}
-{-# NOVECTORISE foo #-}
:seti -XRoleAnnotations
:{
diff --git a/testsuite/tests/ghci/should_run/T7253.stderr b/testsuite/tests/ghci/should_run/T7253.stderr
index f7dedda51b..448f91865d 100644
--- a/testsuite/tests/ghci/should_run/T7253.stderr
+++ b/testsuite/tests/ghci/should_run/T7253.stderr
@@ -2,7 +2,7 @@
<interactive>:19:1: warning: [-Wunrecognised-pragmas (in -Wdefault)]
Unrecognised pragma
-<interactive>:62:1: error:
+<interactive>:61:1: error:
• Role mismatch on variable b:
Annotation says phantom but role representational is required
• while checking a role annotation for ‘T1’
diff --git a/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr b/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
index 30c08d28b1..4ca996fde0 100644
--- a/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
+++ b/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
@@ -445,7 +445,6 @@
[]
[]
[]
- []
[])
[({ DumpRenamedAst.hs:4:8-21 }
(ImportDecl
diff --git a/testsuite/tests/parser/should_compile/T14189.stderr b/testsuite/tests/parser/should_compile/T14189.stderr
index b7c9f3c414..e8e5e6ad3d 100644
--- a/testsuite/tests/parser/should_compile/T14189.stderr
+++ b/testsuite/tests/parser/should_compile/T14189.stderr
@@ -99,7 +99,6 @@
[]
[]
[]
- []
[])
[({ T14189.hs:1:8-13 }
(ImportDecl
diff --git a/utils/ghctags/Main.hs b/utils/ghctags/Main.hs
index febbd79492..6f5564d8ea 100644
--- a/utils/ghctags/Main.hs
+++ b/utils/ghctags/Main.hs
@@ -301,7 +301,6 @@ boundThings modname lbinding =
BangPat _ p -> patThings p tl
ListPat _ ps -> foldr patThings tl ps
TuplePat _ ps _ -> foldr patThings tl ps
- PArrPat _ ps -> foldr patThings tl ps
ConPatIn _ conargs -> conArgs conargs tl
ConPatOut{ pat_args = conargs } -> conArgs conargs tl
LitPat _ _ -> tl
diff --git a/utils/haddock b/utils/haddock
-Subproject 90ad5b5c3a1d8532babac7934ee5189c09ef484
+Subproject f77c9c5cc8bb669f584d36494630589ea80eb79
diff --git a/validate b/validate
index 77bc002fb2..0332e5b1ec 100755
--- a/validate
+++ b/validate
@@ -207,12 +207,6 @@ if [ $be_quiet -eq 1 ]; then
echo "V=0" >> mk/are-validating.mk # Less gunk
fi
-if [ $use_dph -eq 1 ]; then
- echo "BUILD_DPH=YES" >> mk/are-validating.mk
-else
- echo "BUILD_DPH=NO" >> mk/are-validating.mk
-fi
-
$make -j$threads
# For a "debug make", add "--debug=b --debug=m"