module Futhark.Pass.Simplify
  ( simplify,
    simplifySOACS,
    simplifySeq,
    simplifyMC,
    simplifyGPU,
    simplifyGPUMem,
    simplifySeqMem,
    simplifyMCMem,
  )
where

import Futhark.IR.GPU.Simplify qualified as GPU
import Futhark.IR.GPUMem qualified as GPUMem
import Futhark.IR.MC qualified as MC
import Futhark.IR.MCMem qualified as MCMem
import Futhark.IR.SOACS.Simplify qualified as SOACS
import Futhark.IR.Seq qualified as Seq
import Futhark.IR.SeqMem qualified as SeqMem
import Futhark.IR.Syntax
import Futhark.Pass

simplify ::
  (Prog rep -> PassM (Prog rep)) ->
  Pass rep rep
simplify :: forall rep. (Prog rep -> PassM (Prog rep)) -> Pass rep rep
simplify = String -> String -> (Prog rep -> PassM (Prog rep)) -> Pass rep rep
forall fromrep torep.
String
-> String
-> (Prog fromrep -> PassM (Prog torep))
-> Pass fromrep torep
Pass String
"simplify" String
"Perform simple enabling optimisations."

simplifySOACS :: Pass SOACS.SOACS SOACS.SOACS
simplifySOACS :: Pass SOACS SOACS
simplifySOACS = (Prog SOACS -> PassM (Prog SOACS)) -> Pass SOACS SOACS
forall rep. (Prog rep -> PassM (Prog rep)) -> Pass rep rep
simplify Prog SOACS -> PassM (Prog SOACS)
SOACS.simplifySOACS

simplifyGPU :: Pass GPU.GPU GPU.GPU
simplifyGPU :: Pass GPU GPU
simplifyGPU = (Prog GPU -> PassM (Prog GPU)) -> Pass GPU GPU
forall rep. (Prog rep -> PassM (Prog rep)) -> Pass rep rep
simplify Prog GPU -> PassM (Prog GPU)
GPU.simplifyGPU

simplifySeq :: Pass Seq.Seq Seq.Seq
simplifySeq :: Pass Seq Seq
simplifySeq = (Prog Seq -> PassM (Prog Seq)) -> Pass Seq Seq
forall rep. (Prog rep -> PassM (Prog rep)) -> Pass rep rep
simplify Prog Seq -> PassM (Prog Seq)
Seq.simplifyProg

simplifyMC :: Pass MC.MC MC.MC
simplifyMC :: Pass MC MC
simplifyMC = (Prog MC -> PassM (Prog MC)) -> Pass MC MC
forall rep. (Prog rep -> PassM (Prog rep)) -> Pass rep rep
simplify Prog MC -> PassM (Prog MC)
MC.simplifyProg

simplifyGPUMem :: Pass GPUMem.GPUMem GPUMem.GPUMem
simplifyGPUMem :: Pass GPUMem GPUMem
simplifyGPUMem = (Prog GPUMem -> PassM (Prog GPUMem)) -> Pass GPUMem GPUMem
forall rep. (Prog rep -> PassM (Prog rep)) -> Pass rep rep
simplify Prog GPUMem -> PassM (Prog GPUMem)
GPUMem.simplifyProg

simplifySeqMem :: Pass SeqMem.SeqMem SeqMem.SeqMem
simplifySeqMem :: Pass SeqMem SeqMem
simplifySeqMem = (Prog SeqMem -> PassM (Prog SeqMem)) -> Pass SeqMem SeqMem
forall rep. (Prog rep -> PassM (Prog rep)) -> Pass rep rep
simplify Prog SeqMem -> PassM (Prog SeqMem)
SeqMem.simplifyProg

simplifyMCMem :: Pass MCMem.MCMem MCMem.MCMem
simplifyMCMem :: Pass MCMem MCMem
simplifyMCMem = (Prog MCMem -> PassM (Prog MCMem)) -> Pass MCMem MCMem
forall rep. (Prog rep -> PassM (Prog rep)) -> Pass rep rep
simplify Prog MCMem -> PassM (Prog MCMem)
MCMem.simplifyProg