futhark-0.25.32: An optimising compiler for a functional, array-oriented language.

Safe Haskell | Safe-Inferred
Language | GHC2021

Futhark.IR.SOACS.Simplify

Contents

- Orphan instances

Synopsis

- simplifySOACS :: Prog SOACS -> PassM (Prog SOACS)
- simplifyLambda :: (HasScope SOACS m, MonadFreshNames m) => Lambda SOACS -> m (Lambda SOACS)
- simplifyFun :: MonadFreshNames m => SymbolTable (Wise SOACS) -> FunDef SOACS -> m (FunDef SOACS)
- simplifyStms :: (HasScope SOACS m, MonadFreshNames m) => Stms SOACS -> m (Stms SOACS)
- simplifyConsts :: MonadFreshNames m => Stms SOACS -> m (Stms SOACS)
- simpleSOACS :: SimpleOps SOACS
- simplifySOAC :: SimplifiableRep rep => SimplifyOp rep (SOAC (Wise rep))
- soacRules :: RuleBook (Wise SOACS)
- class HasSOAC rep where
  - asSOAC :: Op rep -> Maybe (SOAC rep)
  - soacOp :: SOAC rep -> Op rep
- simplifyKnownIterationSOAC :: (Buildable rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep
- removeReplicateMapping :: (Aliased rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep
- removeUnusedSOACInput :: forall rep. (Aliased rep, Buildable rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep
- liftIdentityMapping :: forall rep. (Buildable rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep
- simplifyMapIota :: forall rep. (Buildable rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep
- data SOACS

# Documentation

simplifySOACS :: Prog SOACS -> PassM (Prog SOACS) Source #

simplifyLambda :: (HasScope SOACS m, MonadFreshNames m) => Lambda SOACS -> m (Lambda SOACS) Source #

simplifyFun :: MonadFreshNames m => SymbolTable (Wise SOACS) -> FunDef SOACS -> m (FunDef SOACS) Source #

simplifyStms :: (HasScope SOACS m, MonadFreshNames m) => Stms SOACS -> m (Stms SOACS) Source #

simplifyConsts :: MonadFreshNames m => Stms SOACS -> m (Stms SOACS) Source #

simpleSOACS :: SimpleOps SOACS Source #

simplifySOAC :: SimplifiableRep rep => SimplifyOp rep (SOAC (Wise rep)) Source #

soacRules :: RuleBook (Wise SOACS) Source #

class HasSOAC rep where Source #

Does this rep contain `SOAC`s in its `Op`s? A rep must be an instance of this class for the simplification rules to work.

Methods

asSOAC :: Op rep -> Maybe (SOAC rep) Source #

soacOp :: SOAC rep -> Op rep Source #

#### Instances

Instances details

HasSOAC (Wise GPU) Source # |
Instance details Defined in Futhark.IR.GPU.Simplify Methods asSOAC :: Op (Wise GPU) -> Maybe (SOAC (Wise GPU)) Source # soacOp :: SOAC (Wise GPU) -> Op (Wise GPU) Source #
HasSOAC (Wise SOACS) Source # |
Instance details Defined in Futhark.IR.SOACS.Simplify Methods asSOAC :: Op (Wise SOACS) -> Maybe (SOAC (Wise SOACS)) Source # soacOp :: SOAC (Wise SOACS) -> Op (Wise SOACS) Source #

simplifyKnownIterationSOAC :: (Buildable rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep Source #

removeReplicateMapping :: (Aliased rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep Source #

Remove all arguments to the map that are simply replicates. These can be turned into free variables instead.

removeUnusedSOACInput :: forall rep. (Aliased rep, Buildable rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep Source #

Remove inputs that are not used inside the SOAC.

liftIdentityMapping :: forall rep. (Buildable rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep Source #

simplifyMapIota :: forall rep. (Buildable rep, BuilderOps rep, HasSOAC rep) => TopDownRuleOp rep Source #

data SOACS Source #

The rep for the basic representation.

#### Instances

Instances details

Analyse SOACS Source # |
Instance details Defined in Futhark.Analysis.AccessPattern Methods analyseOp :: Op SOACS -> Context SOACS -> [VName] -> (Context SOACS, IndexTable SOACS)
BuilderOps SOACS Source # |
Instance details Defined in Futhark.IR.SOACS Methods mkExpDecB :: (MonadBuilder m, Rep m ~ SOACS) => Pat (LetDec SOACS) -> Exp SOACS -> m (ExpDec SOACS) Source # mkBodyB :: (MonadBuilder m, Rep m ~ SOACS) => Stms SOACS -> Result -> m (Body SOACS) Source # mkLetNamesB :: (MonadBuilder m, Rep m ~ SOACS) => [VName] -> Exp SOACS -> m (Stm SOACS) Source #
Buildable SOACS Source # |
Instance details Defined in Futhark.IR.SOACS Methods mkExpPat :: [Ident] -> Exp SOACS -> Pat (LetDec SOACS) Source # mkExpDec :: Pat (LetDec SOACS) -> Exp SOACS -> ExpDec SOACS Source # mkBody :: Stms SOACS -> Result -> Body SOACS Source # mkLetNames :: (MonadFreshNames m, HasScope SOACS m) => [VName] -> Exp SOACS -> m (Stm SOACS) Source #
PrettyRep SOACS Source # |
Instance details Defined in Futhark.IR.SOACS Methods ppExpDec :: ExpDec SOACS -> Exp SOACS -> Maybe (Doc a) Source #
ASTRep SOACS Source # |
Instance details Defined in Futhark.IR.SOACS Methods expTypesFromPat :: (HasScope SOACS m, Monad m) => Pat (LetDec SOACS) -> m [BranchType SOACS] Source #
RepTypes SOACS Source # |
Instance details Defined in Futhark.IR.SOACS Associated Types type LetDec SOACS Source # type ExpDec SOACS Source # type BodyDec SOACS Source # type FParamInfo SOACS Source # type LParamInfo SOACS Source # type RetType SOACS Source # type BranchType SOACS Source # type OpC SOACS :: Type -> Type Source #
Checkable SOACS Source # |

Instance details

Defined in Futhark.IR.SOACS

Methods

checkExpDec :: ExpDec SOACS -> TypeM SOACS () Source #

checkBodyDec :: BodyDec SOACS -> TypeM SOACS () Source #

checkFParamDec :: VName -> FParamInfo SOACS -> TypeM SOACS () Source #

checkLParamDec :: VName -> LParamInfo SOACS -> TypeM SOACS () Source #

checkLetBoundDec :: VName -> LetDec SOACS -> TypeM SOACS () Source #

checkRetType :: [RetType SOACS] -> TypeM SOACS () Source #

matchPat :: Pat (LetDec (Aliases SOACS)) -> Exp (Aliases SOACS) -> TypeM SOACS () Source #

primFParam :: VName -> PrimType -> TypeM SOACS (FParam (Aliases SOACS)) Source #

matchReturnType :: [RetType SOACS] -> Result -> TypeM SOACS () Source #

matchBranchType :: [BranchType SOACS] -> Body (Aliases SOACS) -> TypeM SOACS () Source #

matchLoopResult :: [FParam (Aliases SOACS)] -> Result -> TypeM SOACS () Source #

checkOp :: Op (Aliases SOACS) -> TypeM SOACS () Source #

HasScope SOACS ADM Source # |
Instance details Defined in Futhark.AD.Rev.Monad Methods lookupType :: VName -> ADM Type Source # lookupInfo :: VName -> ADM (NameInfo SOACS) Source # askScope :: ADM (Scope SOACS) Source # asksScope :: (Scope SOACS -> a) -> ADM a Source #
HasScope SOACS InternaliseM Source # |
Instance details Defined in Futhark.Internalise.Monad Methods lookupType :: VName -> InternaliseM Type Source # lookupInfo :: VName -> InternaliseM (NameInfo SOACS) Source # askScope :: InternaliseM (Scope SOACS) Source # asksScope :: (Scope SOACS -> a) -> InternaliseM a Source #
LocalScope SOACS ADM Source # |
Instance details Defined in Futhark.AD.Rev.Monad Methods localScope :: Scope SOACS -> ADM a -> ADM a Source #
LocalScope SOACS InternaliseM Source # |
Instance details Defined in Futhark.Internalise.Monad Methods localScope :: Scope SOACS -> InternaliseM a -> InternaliseM a Source #
HasScope SOACS (ImpM rep r op) Source # |
Instance details Defined in Futhark.CodeGen.ImpGen Methods lookupType :: VName -> ImpM rep r op Type Source # lookupInfo :: VName -> ImpM rep r op (NameInfo SOACS) Source # askScope :: ImpM rep r op (Scope SOACS) Source # asksScope :: (Scope SOACS -> a) -> ImpM rep r op a Source #
BuilderOps (Wise SOACS) Source # |

Instance details

Defined in Futhark.IR.SOACS.Simplify

Methods

mkExpDecB :: (MonadBuilder m, Rep m ~ Wise SOACS) => Pat (LetDec (Wise SOACS)) -> Exp (Wise SOACS) -> m (ExpDec (Wise SOACS)) Source #

mkBodyB :: (MonadBuilder m, Rep m ~ Wise SOACS) => Stms (Wise SOACS) -> Result -> m (Body (Wise SOACS)) Source #

mkLetNamesB :: (MonadBuilder m, Rep m ~ Wise SOACS) => [VName] -> Exp (Wise SOACS) -> m (Stm (Wise SOACS)) Source #

HasSOAC (Wise SOACS) Source # |
Instance details Defined in Futhark.IR.SOACS.Simplify Methods asSOAC :: Op (Wise SOACS) -> Maybe (SOAC (Wise SOACS)) Source # soacOp :: SOAC (Wise SOACS) -> Op (Wise SOACS) Source #
TraverseOpStms (Wise SOACS) Source # |
Instance details Defined in Futhark.IR.SOACS.Simplify Methods traverseOpStms :: Monad m => OpStmsTraverser m (Op (Wise SOACS)) (Wise SOACS) Source #
type BodyDec SOACS Source # |
Instance details Defined in Futhark.IR.SOACS type BodyDec SOACS = ()
type BranchType SOACS Source # |
Instance details Defined in Futhark.IR.SOACS type BranchType SOACS = ExtType
type ExpDec SOACS Source # |
Instance details Defined in Futhark.IR.SOACS type ExpDec SOACS = ()
type FParamInfo SOACS Source # |
Instance details Defined in Futhark.IR.SOACS type FParamInfo SOACS = DeclType
type LParamInfo SOACS Source # |
Instance details Defined in Futhark.IR.SOACS type LParamInfo SOACS = Type
type LetDec SOACS Source # |
Instance details Defined in Futhark.IR.SOACS type LetDec SOACS = Type
type OpC SOACS Source # |
Instance details Defined in Futhark.IR.SOACS type OpC SOACS = SOAC
type RetType SOACS Source # |
Instance details Defined in Futhark.IR.SOACS type RetType SOACS = DeclExtType

# Orphan instances

BuilderOps (Wise SOACS) Source # |
Instance details Methods mkExpDecB :: (MonadBuilder m, Rep m ~ Wise SOACS) => Pat (LetDec (Wise SOACS)) -> Exp (Wise SOACS) -> m (ExpDec (Wise SOACS)) Source # mkBodyB :: (MonadBuilder m, Rep m ~ Wise SOACS) => Stms (Wise SOACS) -> Result -> m (Body (Wise SOACS)) Source # mkLetNamesB :: (MonadBuilder m, Rep m ~ Wise SOACS) => [VName] -> Exp (Wise SOACS) -> m (Stm (Wise SOACS)) Source #
TraverseOpStms (Wise SOACS) Source # |
Instance details Methods traverseOpStms :: Monad m => OpStmsTraverser m (Op (Wise SOACS)) (Wise SOACS) Source #