Commit e415eeaf authored by rl@cse.unsw.edu.au's avatar rl@cse.unsw.edu.au
Browse files

Remove ndpFlatten

This patch removes the ndpFlatten directory and the -fflatten static flag.
This code has never worked and has now been superceded by vectorisation.
parent c0f21abc
......@@ -433,7 +433,7 @@ SRC_HC_OPTS += -Istage$(stage)
ALL_DIRS = \
utils basicTypes types hsSyn prelude rename typecheck deSugar coreSyn \
vectorise specialise simplCore stranal stgSyn simplStg codeGen main \
profiling parser cprAnalysis ndpFlatten iface cmm
profiling parser cprAnalysis iface cmm
# Make sure we include Config.hs even if it doesn't exist yet...
ALL_SRCS += $(CONFIG_HS)
......
......@@ -286,7 +286,6 @@ Allocation of unique supply characters:
d desugarer
f AbsC flattener
g SimplStg
l ndpFlatten
n Native codegen
r Hsc name cache
s simplifier
......
......@@ -40,7 +40,6 @@ import ByteCodeGen ( byteCodeGen, coreExprToBCOs )
import Linker ( HValue, linkExpr )
import CoreTidy ( tidyExpr )
import CorePrep ( corePrepExpr )
import Flattening ( flattenExpr )
import Desugar ( deSugarExpr )
import SimplCore ( simplifyExpr )
import TcRnDriver ( tcRnStmt, tcRnExpr, tcRnType )
......@@ -961,11 +960,8 @@ compileExpr hsc_env srcspan ds_expr
= do { let { dflags = hsc_dflags hsc_env ;
lint_on = dopt Opt_DoCoreLinting dflags }
-- Flatten it
; flat_expr <- flattenExpr hsc_env ds_expr
-- Simplify it
; simpl_expr <- simplifyExpr dflags flat_expr
; simpl_expr <- simplifyExpr dflags ds_expr
-- Tidy it (temporary, until coreSat does cloning)
; let tidy_expr = tidyExpr emptyTidyEnv simpl_expr
......
......@@ -44,7 +44,6 @@ module StaticFlags (
opt_IrrefutableTuples,
opt_Parallel,
opt_RuntimeTypes,
opt_Flatten,
-- optimisation opts
opt_NoMethodSharing,
......@@ -301,7 +300,6 @@ opt_Hpc = lookUp FSLIT("-fhpc")
opt_DictsStrict = lookUp FSLIT("-fdicts-strict")
opt_IrrefutableTuples = lookUp FSLIT("-firrefutable-tuples")
opt_Parallel = lookUp FSLIT("-fparallel")
opt_Flatten = lookUp FSLIT("-fflatten")
-- optimisation opts
opt_SpecInlineJoinPoints = lookUp FSLIT("-fspec-inline-join-points")
......@@ -367,7 +365,6 @@ isStaticFlag f =
"fspec-inline-join-points",
"firrefutable-tuples",
"fparallel",
"fflatten",
"fgransim",
"fno-hi-version-check",
"dno-black-holing",
......@@ -604,7 +601,7 @@ way_details =
(WayNDP, Way "ndp" False "Nested data parallelism"
[ "-fparr"
, "-fflatten"]),
, "-fvectorise"]),
(WayUser_a, Way "a" False "User way 'a'" ["$WAY_a_REAL_OPTS"]),
(WayUser_b, Way "b" False "User way 'b'" ["$WAY_b_REAL_OPTS"]),
......
-- $Id$
--
-- Copyright (c) 2002 Manuel M T Chakravarty & Gabriele Keller
--
-- Information for modules outside of the flattening module collection.
--
--- DESCRIPTION ---------------------------------------------------------------
--
-- This module contains information that is needed, and thus imported, by
-- modules that are otherwise independent of flattening and may in fact be
-- directly or indirectly imported by some of the flattening-related
-- modules. This is to avoid cyclic module dependencies.
--
--- DOCU ----------------------------------------------------------------------
--
-- Language: Haskell 98
--
--- TODO ----------------------------------------------------------------------
--
module FlattenInfo (
namesNeededForFlattening
) where
import StaticFlags (opt_Flatten)
import NameSet (FreeVars, emptyFVs, mkFVs)
import PrelNames (fstName, andName, orName, lengthPName, replicatePName,
mapPName, bpermutePName, bpermuteDftPName, indexOfPName)
-- this is a list of names that need to be available if flattening is
-- performed (EXPORTED)
--
-- * needs to be kept in sync with the names used in Core generation in
-- `FlattenMonad' and `NDPCoreUtils'
--
namesNeededForFlattening :: FreeVars
namesNeededForFlattening
| not opt_Flatten = emptyFVs -- none without -fflatten
| otherwise
= mkFVs [fstName, andName, orName, lengthPName, replicatePName, mapPName,
bpermutePName, bpermuteDftPName, indexOfPName]
-- stuff from PrelGHC doesn't have to go here
-- $Id$
--
-- Copyright (c) [2001..2002] Manuel M T Chakravarty & Gabriele Keller
--
-- Monad maintaining parallel contexts and substitutions for flattening.
--
--- DESCRIPTION ---------------------------------------------------------------
--
-- The flattening transformation needs to perform a fair amount of plumbing.
-- It needs to mainatin a set of variables, called the parallel context for
-- lifting, variable substitutions in case alternatives, and so on.
-- Moreover, we need to manage uniques to create new variables. The monad
-- defined in this module takes care of maintaining this state.
--
--- DOCU ----------------------------------------------------------------------
--
-- Language: Haskell 98
--
-- * a parallel context is a set of variables that get vectorised during a
-- lifting transformations (ie, their type changes from `t' to `[:t:]')
--
-- * all vectorised variables in a parallel context have the same size; we
-- call this also the size of the parallel context
--
-- * we represent contexts by maps that give the lifted version of a variable
-- (remember that in GHC, variables contain type information that changes
-- during lifting)
--
--- TODO ----------------------------------------------------------------------
--
-- * Assumptions currently made that should (if they turn out to be true) be
-- documented in The Commentary:
--
-- - Local bindings can be copied without any need to alpha-rename bound
-- variables (or their uniques). Such renaming is only necessary when
-- bindings in a recursive group are replicated; implying that this is
-- required in the case of top-level bindings). (Note: The CoreTidy path
-- generates global uniques before code generation.)
--
-- * One FIXME left to resolve.
--
{-# OPTIONS -w #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the module. See
-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
-- for details
module FlattenMonad (
-- monad definition
--
Flatten, runFlatten,
-- variable generation
--
newVar, mkBind,
-- context management & query operations
--
extendContext, packContext, liftVar, liftConst, intersectWithContext,
-- construction of prelude functions
--
mk'fst, mk'eq, mk'neq, mk'and, mk'or, mk'lengthP, mk'replicateP, mk'mapP,
mk'bpermuteP, mk'bpermuteDftP, mk'indexOfP
) where
-- standard
import Monad (mplus)
-- GHC
import Panic (panic)
import Outputable (Outputable(ppr), pprPanic)
import UniqSupply (UniqSupply, splitUniqSupply, uniqFromSupply)
import Var (Var, idType)
import Id (Id, mkSysLocal)
import Name (Name)
import VarSet (VarSet, emptyVarSet, extendVarSet, varSetElems )
import VarEnv (VarEnv, emptyVarEnv, zipVarEnv, plusVarEnv,
elemVarEnv, lookupVarEnv, lookupVarEnv_NF, delVarEnvList)
import Type (Type, tyConAppTyCon)
import HscTypes (HomePackageTable,
ExternalPackageState(eps_PTE), HscEnv(..),
TyThing(..), lookupType)
import PrelNames ( fstName, andName, orName,
lengthPName, replicatePName, mapPName, bpermutePName,
bpermuteDftPName, indexOfPName)
import TysPrim ( charPrimTyCon, intPrimTyCon, floatPrimTyCon, doublePrimTyCon )
import PrimOp ( PrimOp(..) )
import PrelInfo ( primOpId )
import DynFlags (DynFlags)
import CoreSyn (Expr(..), Bind(..), CoreBndr, CoreExpr, CoreBind, mkApps)
import CoreUtils (exprType)
import FastString (FastString)
-- friends
import NDPCoreUtils (parrElemTy)
-- definition of the monad
-- -----------------------
-- state maintained by the flattening monad
--
data FlattenState = FlattenState {
-- our source for uniques
--
us :: UniqSupply,
-- environment containing all known names (including all
-- Prelude functions)
--