{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_HADDOCK hide, prune, not-home #-}
module MLIR.AST.Dialect.Generated.Func where
import Prelude (Int, Double, Maybe(..), Bool(..), (++), (<$>), ($), (<>), Show)
import qualified Prelude
import Data.Int (Int64)
import qualified Data.Maybe
import Data.Array (Ix)
import qualified Data.Array.IArray as IArray
import qualified Data.ByteString as BS
import qualified Data.Map.Strict as M
import qualified Control.Monad
import MLIR.AST ( Attribute(..), Type(..), AbstractOperation(..), ResultTypes(..)
, Location(..), Signedness(..), DenseElements(..)
, NamedAttributes, Name
, pattern NoAttrs )
import qualified MLIR.AST as AST
import MLIR.AST.Builder (Value, EndOfBlock, MonadBlockBuilder, RegionBuilderT)
import qualified MLIR.AST.Builder as AST
import qualified MLIR.AST.IStorableArray as AST
import qualified MLIR.AST.PatternUtil as PatternUtil
import qualified MLIR.AST.Dialect.Affine as Affine
call_indirect :: () => MonadBlockBuilder m => [Type] -> Value -> [Value] -> m Value
call_indirect :: [Type] -> Value -> [Value] -> m Value
call_indirect [Type]
ty0 Value
callee_ [Value]
callee_operands_ = do
([Value] -> Value) -> m [Value] -> m Value
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
Control.Monad.liftM [Value] -> Value
forall a. [a] -> a
Prelude.head (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
{ opName :: Name
opName = Name
"func.call_indirect"
, opLocation :: Location
opLocation = Location
UnknownLocation
, opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit ([Type]
ty0)
, opOperands :: [Name]
opOperands = ([(Value -> Name
AST.operand Value
callee_)] [Name] -> [Name] -> [Name]
forall a. [a] -> [a] -> [a]
++ ([Value] -> [Name]
AST.operands [Value]
callee_operands_))
, opRegions :: [Region]
opRegions = []
, opSuccessors :: [Name]
opSuccessors = []
, opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
}))
pattern Return :: () => () => Location -> [operand] -> AbstractOperation operand
pattern $bReturn :: Location -> [operand] -> AbstractOperation operand
$mReturn :: forall r operand.
AbstractOperation operand
-> (Location -> [operand] -> r) -> (Void# -> r) -> r
Return loc operands_ = Operation
{ opName = "func.return"
, opLocation = loc
, opResultTypes = Explicit []
, opOperands = operands_
, opRegions = []
, opSuccessors = []
, opAttributes = (NoAttrs)
}
return :: () => MonadBlockBuilder m => [Value] -> m EndOfBlock
return :: [Value] -> m EndOfBlock
return [Value]
operands_ = do
m [Value] -> m ()
forall (f :: * -> *) a. Functor f => f a -> f ()
Control.Monad.void (Operation -> m [Value]
forall (m :: * -> *). MonadBlockBuilder m => Operation -> m [Value]
AST.emitOp (Operation :: forall operand.
Name
-> Location
-> ResultTypes
-> [operand]
-> [Region]
-> [Name]
-> Map Name Attribute
-> AbstractOperation operand
Operation
{ opName :: Name
opName = Name
"func.return"
, opLocation :: Location
opLocation = Location
UnknownLocation
, opResultTypes :: ResultTypes
opResultTypes = [Type] -> ResultTypes
Explicit []
, opOperands :: [Name]
opOperands = ([Value] -> [Name]
AST.operands [Value]
operands_)
, opRegions :: [Region]
opRegions = []
, opSuccessors :: [Name]
opSuccessors = []
, opAttributes :: Map Name Attribute
opAttributes = (Map Name Attribute
NoAttrs)
}))
m EndOfBlock
forall (m :: * -> *). Monad m => m EndOfBlock
AST.terminateBlock