scair.clair.macros

Members list

Type members

Classlikes

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait DerivedOperation[name <: String, T] extends Operation

Attributes

Supertypes
trait Operation
trait IRNode
class Object
trait Matchable
class Any
Known subtypes
class Apply
class For
class If
class Load
class Min
class Parallel
class Store
class Yield
class Addf
class Addi
class Andi
class Cmpi
class Divf
class Divsi
class Divui
class Index_Cast
class Mulf
class Muli
class Ori
class Remsi
class Remui
class Sitofp
class Subi
class Mul
class Norm
class Call
class Func
class Return
class Load
class Alloc
class Dealloc
class Load
class Store
class Condition
class ForOp
class ForallOp
class IfOp
class InParallelOp
class ParallelOp
class ReduceOp
class WhileOp
class YieldOp
Show all
Self type
T

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait MLIRName[name <: String]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Complex
class Ptr

Types

Type helper to get the defined input type of a construct definition.

Type helper to get the defined input type of a construct definition.

Attributes

type DefinedInputOf[T <: OpInputDef, A <: Attribute] = T match { case OperandDef => Value[A] case ResultDef => Result[A] case RegionDef => Region case SuccessorDef => Successor case OpPropertyDef => A }

Type helper to get the defined input type of a construct definition.

Type helper to get the defined input type of a construct definition.

Attributes

Value members

Concrete methods

def ADTFlatInputMacro[Def <: OpInputDef : Type](opInputDefs: Seq[Def], adtOpExpr: Expr[_])(using evidence$1: Type[Def], Quotes): Expr[Seq[DefinedInput[Def]]]

Get all constructs of the specified type flattened from the ADT expression.

Get all constructs of the specified type flattened from the ADT expression.

Type parameters

Def

The construct definition type.

Value parameters

adtOpExpr

The ADT expression.

opInputDefs

The construct definitions.

Attributes

def constructorArgs(opDef: OperationDef, op: Expr[DerivedOperationCompanion[_]#UnverifiedOp])(using Quotes): Seq[x$3.reflect.NamedArg]

Return all named arguments for the primary constructor of an ADT. Those are verified, in the sense that they are checked to be of the correct types and numbers.

Return all named arguments for the primary constructor of an ADT. Those are verified, in the sense that they are checked to be of the correct types and numbers.

Value parameters

op

The UnverifiedOp instance.

opDef

The OperationDef derived from the ADT.

Attributes

Returns

The verified named arguments for the primary constructor of the ADT.

def expectSegmentSizes[Def <: OpInputDef : Type](op: Expr[DerivedOperationCompanion[_]#UnverifiedOp])(using evidence$1: Type[Def], Quotes): Expr[Seq[Int]]

Expect a segmentSizes property of DenseArrayAttr type, and return it as a list of integers.

Expect a segmentSizes property of DenseArrayAttr type, and return it as a list of integers.

Type parameters

Def

The construct definition type.

Value parameters

op

The UnverifiedOp expression.

Attributes

def fromUnverifiedOperationMacro[T : Type](opDef: OperationDef, genExpr: Expr[DerivedOperationCompanion[T]#UnverifiedOp])(using evidence$1: Type[T], Quotes): Expr[T]

Attempt to create an ADT from an UnverifiedO[ADT]

Attempt to create an ADT from an UnverifiedO[ADT]

Type parameters

T

The ADT Type.

Value parameters

genExpr

The expression of the UnverifiedOp[ADT].

opDef

The OperationDef derived from the ADT.

Attributes

Returns

The ADT instance.

def generateCheckedPropertyArgument[A <: Attribute : Type](list: Expr[Map[String, Attribute]], propName: String)(using evidence$1: Type[A], Quotes): Expr[A]

Helper to verify a property argument.

Helper to verify a property argument.

Attributes

def getAttrConstructor[T : Type](attrDef: AttributeDef, attributes: Expr[Seq[Attribute]])(using evidence$1: Type[T], Quotes): Expr[T]
def getConstructConstraint(_def: OpInputDef)(using Quotes): Type[_ <: AnyKind]

Helper to get the expected type of a construct definition's construct.

Helper to get the expected type of a construct definition's construct.

Attributes

def getConstructName[Def <: OpInputDef : Type](using evidence$1: Type[Def], Quotes): String

Helper to get the name of a construct definition type.

Helper to get the name of a construct definition type.

Attributes

def getConstructSeq[Def <: OpInputDef : Type](op: Expr[DerivedOperationCompanion[_]#UnverifiedOp])(using evidence$1: Type[Def], Quotes): Expr[Seq[Value[Attribute]] | Seq[Region] | Seq[Block] | Seq[(String, Attribute)]]

Helper to access the right sequence of constructs from an UnverifiedOp, given a construct definition type.

Helper to access the right sequence of constructs from an UnverifiedOp, given a construct definition type.

Attributes

def getConstructVariadicity(_def: OpInputDef)(using Quotes): Variadicity

Helper to get the variadicity of a construct definition's construct.

Helper to get the variadicity of a construct definition's construct.

Attributes

def makeSegmentSizes[T <: MayVariadicOpInputDef : Type](hasMultiVariadic: Boolean, defs: Seq[T], adtOpExpr: Expr[_])(using evidence$1: Type[T], Quotes): Expr[Map[String, Attribute]]
def operandsMacro(opDef: OperationDef, adtOpExpr: Expr[_])(using Quotes): Expr[Seq[Value[Attribute]]]
def partitionedConstructs[Def <: OpInputDef : Type](defs: Seq[Def], op: Expr[DerivedOperationCompanion[_]#UnverifiedOp])(using evidence$1: Type[Def], Quotes): Seq[Expr[Value[Attribute] | Region | Block | (String, Attribute) | Seq[Value[Attribute] | Region | Block | (String, Attribute)]]]

Partion constructs of a specified type. That is, verify that they are in a coherent quantity, and partition them into the provided definitions.

Partion constructs of a specified type. That is, verify that they are in a coherent quantity, and partition them into the provided definitions.

Type parameters

Def

The construct definition type.

Value parameters

defs

The construct definitions.

op

The UnverifiedOp expression.

Attributes

def propertiesMacro(opDef: OperationDef, adtOpExpr: Expr[_])(using Quotes): Expr[Map[String, Attribute]]
def regionsMacro(opDef: OperationDef, adtOpExpr: Expr[_])(using Quotes): Expr[Seq[Region]]
def resultsMacro(opDef: OperationDef, adtOpExpr: Expr[_])(using Quotes): Expr[Seq[Result[Attribute]]]
def selectMember(obj: Expr[_], name: String)(using Quotes): Expr[Any]

Small helper to select a member of an expression.

Small helper to select a member of an expression.

Value parameters

name

The name of the member to select.

obj

The object to select the member from.

Attributes

def successorsMacro(opDef: OperationDef, adtOpExpr: Expr[_])(using Quotes): Expr[Seq[Successor]]
inline def summonAttributeTraits[T <: Tuple]: Seq[DerivedAttributeCompanion[_]]
inline def summonDialect[Attributes <: Tuple, Operations <: Tuple](attributes: Seq[AttributeCompanion]): Dialect
inline def summonMLIRTraits[T <: Tuple]: Seq[DerivedOperationCompanion[_]]
def verifiedConstructs[Def <: OpInputDef : Type](defs: Seq[Def], op: Expr[DerivedOperationCompanion[_]#UnverifiedOp])(using evidence$1: Type[Def], Quotes): Seq[Expr[Def match { case OperandDef => Value[_ <: Attribute] case ResultDef => Result[_ <: Attribute] case RegionDef => Region case SuccessorDef => Successor case OpPropertyDef => <: Attribute } | Seq[Def match { case OperandDef => Value[_ <: Attribute] case ResultDef => Result[_ <: Attribute] case RegionDef => Region case SuccessorDef => Successor case OpPropertyDef => <: Attribute }]]]

Get all verified constructs of a specified type from an UnverifiedOp. That is, of the expected types and variadicities, as specified by the OperationDef.

Get all verified constructs of a specified type from an UnverifiedOp. That is, of the expected types and variadicities, as specified by the OperationDef.

Type parameters

Def

The construct definition type.

Value parameters

defs

The constructs definitions.

op

The UnverifiedOp expression.

Attributes