summaryrefslogtreecommitdiff
path: root/compiler/basicTypes
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-06-02 11:56:58 -0400
committerBen Gamari <ben@smart-cactus.org>2018-06-02 16:21:12 -0400
commitfaee23bb69ca813296da484bc177f4480bcaee9f (patch)
tree28e1c99f0de9d505c1df81ae7459839f5db4121c /compiler/basicTypes
parent13a86606e51400bc2a81a0e04cfbb94ada5d2620 (diff)
downloadhaskell-faee23bb69ca813296da484bc177f4480bcaee9f.tar.gz
vectorise: Put it out of its misery
Poor DPH and its vectoriser have long been languishing; sadly it seems there is little chance that the effort will be rekindled. Every few years we discuss what to do with this mass of code and at least once we have agreed that it should be archived on a branch and removed from `master`. Here we do just that, eliminating heaps of dead code in the process. Here we drop the ParallelArrays extension, the vectoriser, and the `vector` and `primitive` submodules. Test Plan: Validate Reviewers: simonpj, simonmar, hvr, goldfire, alanz Reviewed By: simonmar Subscribers: goldfire, rwbarton, thomie, mpickering, carter Differential Revision: https://phabricator.haskell.org/D4761
Diffstat (limited to 'compiler/basicTypes')
-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
5 files changed, 4 insertions, 91 deletions
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