MLIR Syntax AST #
This file contains the AST datastructures for generic MLIR syntax
Equations
- MLIR.AST.instReprAffineExpr = { reprPrec := MLIR.AST.reprAffineExpr✝ }
Instances For
Equations
- MLIR.AST.instReprAffineTuple = { reprPrec := MLIR.AST.reprAffineTuple✝ }
Instances For
Equations
- MLIR.AST.instReprAffineMap = { reprPrec := MLIR.AST.reprAffineMap✝ }
Equations
- MLIR.AST.instReprBBName = { reprPrec := MLIR.AST.reprBBName✝ }
Equations
- MLIR.AST.instReprSSAVal = { reprPrec := MLIR.AST.reprSSAVal✝ }
Equations
Instances For
Equations
- MLIR.AST.instToStringSSAVal = { toString := MLIR.AST.SSAValToString }
- Signless: MLIR.AST.Signedness
- Unsigned: MLIR.AST.Signedness
- Signed: MLIR.AST.Signedness
Instances For
Equations
- MLIR.AST.instDecidableEqSignedness x y = if h : x.toCtorIdx = y.toCtorIdx then isTrue ⋯ else isFalse ⋯
Equations
- MLIR.AST.instReprSignedness = { reprPrec := MLIR.AST.reprSignedness✝ }
@[reducible, inline]
Equations
Instances For
- int: {φ : ℕ} → MLIR.AST.Signedness → MLIR.AST.Width φ → MLIR.AST.MLIRType φ
- float: {φ : ℕ} → ℕ → MLIR.AST.MLIRType φ
- tensor1d: {φ : ℕ} → MLIR.AST.MLIRType φ
- tensor2d: {φ : ℕ} → MLIR.AST.MLIRType φ
- tensor4d: {φ : ℕ} → MLIR.AST.MLIRType φ
- index: {φ : ℕ} → MLIR.AST.MLIRType φ
- undefined: {φ : ℕ} → String → MLIR.AST.MLIRType φ
Instances For
Equations
- MLIR.AST.instReprMLIRType = { reprPrec := MLIR.AST.reprMLIRType✝ }
Equations
- MLIR.AST.instDecidableEqMLIRType = MLIR.AST.decEqMLIRType✝
Equations
- MLIR.AST.instToFormatWidth φ = { format := repr }
Equations
- MLIR.AST.instToFormatMLIRType φ = { format := repr }
@[reducible, inline]
Equations
Instances For
Shorthand to build <iN>
Equations
Instances For
@[reducible, inline]
Instances For
@[reducible, inline]
Instances For
Equations
Instances For
@[reducible, inline]
An ssa value (variable name) with a type
Equations
Instances For
- symbol: {φ : ℕ} → String → MLIR.AST.AttrValue φ
- str: {φ : ℕ} → String → MLIR.AST.AttrValue φ
- int: {φ : ℕ} → ℤ → MLIR.AST.MLIRType φ → MLIR.AST.AttrValue φ
- nat: {φ : ℕ} → ℕ → MLIR.AST.AttrValue φ
- bool: {φ : ℕ} → Bool → MLIR.AST.AttrValue φ
- float: {φ : ℕ} → Float → MLIR.AST.MLIRType φ → MLIR.AST.AttrValue φ
- type: {φ : ℕ} → MLIR.AST.MLIRType φ → MLIR.AST.AttrValue φ
- affine: {φ : ℕ} → MLIR.AST.AffineMap → MLIR.AST.AttrValue φ
- permutation: {φ : ℕ} → List ℕ → MLIR.AST.AttrValue φ
- list: {φ : ℕ} → List (MLIR.AST.AttrValue φ) → MLIR.AST.AttrValue φ
- nestedsymbol: {φ : ℕ} → MLIR.AST.AttrValue φ → MLIR.AST.AttrValue φ → MLIR.AST.AttrValue φ
- alias: {φ : ℕ} → String → MLIR.AST.AttrValue φ
- dict: {φ : ℕ} → MLIR.AST.AttrDict φ → MLIR.AST.AttrValue φ
- opaque_: {φ : ℕ} → String → String → MLIR.AST.AttrValue φ
- opaqueElements: {φ : ℕ} → String → String → MLIR.AST.MLIRType φ → MLIR.AST.AttrValue φ
- unit: {φ : ℕ} → MLIR.AST.AttrValue φ
Instances For
- mk: {φ : ℕ} → String → MLIR.AST.AttrValue φ → MLIR.AST.AttrEntry φ
Instances For
- mk: {φ : ℕ} → List (MLIR.AST.AttrEntry φ) → MLIR.AST.AttrDict φ
Instances For
Equations
- (MLIR.AST.AttrEntry.mk name value).destructure = (name, value)
Instances For
Equations
- (MLIR.AST.AttrDict.mk attrs).getAttr x = List.lookup x (List.map MLIR.AST.AttrEntry.destructure attrs)
Instances For
@[reducible, inline]
Equations
Instances For
- mk: {φ : ℕ} → String → List (MLIR.AST.TypedSSAVal φ) → List (MLIR.AST.TypedSSAVal φ) → List (MLIR.AST.Region φ) → MLIR.AST.AttrDict φ → MLIR.AST.Op φ
Instances For
- mk: {φ : ℕ} → String → List (MLIR.AST.TypedSSAVal φ) → List (MLIR.AST.Op φ) → MLIR.AST.Region φ
Instances For
- mk: {φ : ℕ} → String → MLIR.AST.AttrValue φ → MLIR.AST.AttrDefn φ
Instances For
- mk: {φ : ℕ} → List (MLIR.AST.Op φ) → List (MLIR.AST.AttrDefn φ) → MLIR.AST.Module φ
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).name = name
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).res = res
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).resNames = List.map Prod.fst res
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).resTypes = List.map Prod.snd res
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).args = args
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).argNames = List.map Prod.fst args
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).argTypes = List.map Prod.snd args
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).regions = regions
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).attrs = attrs
Instances For
Equations
- MLIR.AST.instCoeStringSSAVal = { coe := fun (s : String) => MLIR.AST.SSAVal.SSAVal s }
Equations
- MLIR.AST.instCoeStringAttrValue φ = { coe := fun (s : String) => MLIR.AST.AttrValue.str s }
Equations
- MLIR.AST.instCoeIntAttrValue φ = { coe := fun (i : ℤ) => MLIR.AST.AttrValue.int i (MLIR.AST.MLIRType.int MLIR.AST.Signedness.Signless 64) }
instance
MLIR.AST.instCoeMLIRTypeAttrValue
(φ : ℕ)
:
Coe (MLIR.AST.MLIRType φ) (MLIR.AST.AttrValue φ)
Equations
- MLIR.AST.instCoeMLIRTypeAttrValue φ = { coe := MLIR.AST.AttrValue.type }
instance
MLIR.AST.instCoeProdStringAttrValueAttrEntry
(φ : ℕ)
:
Coe (String × MLIR.AST.AttrValue φ) (MLIR.AST.AttrEntry φ)
Equations
- MLIR.AST.instCoeProdStringAttrValueAttrEntry φ = { coe := fun (v : String × MLIR.AST.AttrValue φ) => MLIR.AST.AttrEntry.mk v.1 v.2 }
instance
MLIR.AST.instCoeProdStringMLIRTypeAttrEntry
(φ : ℕ)
:
Coe (String × MLIR.AST.MLIRType φ) (MLIR.AST.AttrEntry φ)
Equations
- MLIR.AST.instCoeProdStringMLIRTypeAttrEntry φ = { coe := fun (v : String × MLIR.AST.MLIRType φ) => MLIR.AST.AttrEntry.mk v.1 (MLIR.AST.AttrValue.type v.2) }
instance
MLIR.AST.instCoeAttrEntryProdStringAttrValue
(φ : ℕ)
:
Coe (MLIR.AST.AttrEntry φ) (String × MLIR.AST.AttrValue φ)
Equations
- MLIR.AST.instCoeAttrEntryProdStringAttrValue φ = { coe := fun (x : MLIR.AST.AttrEntry φ) => match x with | MLIR.AST.AttrEntry.mk key val => (key, val) }
instance
MLIR.AST.instCoeListAttrEntryAttrDict
(φ : ℕ)
:
Coe (List (MLIR.AST.AttrEntry φ)) (MLIR.AST.AttrDict φ)
Equations
- MLIR.AST.instCoeListAttrEntryAttrDict φ = { coe := fun (x : List (MLIR.AST.AttrEntry φ)) => let v := x; MLIR.AST.AttrDict.mk v }
instance
MLIR.AST.instCoeAttrDictListAttrEntry
(φ : ℕ)
:
Coe (MLIR.AST.AttrDict φ) (List (MLIR.AST.AttrEntry φ))
Equations
- MLIR.AST.instCoeAttrDictListAttrEntry φ = { coe := fun (x : MLIR.AST.AttrDict φ) => match x with | MLIR.AST.AttrDict.mk as => as }
Equations
- MLIR.AST.Region.name φ (MLIR.AST.Region.mk name args ops) = MLIR.AST.BBName.mk name
Instances For
Equations
- MLIR.AST.Region.args φ (MLIR.AST.Region.mk name args ops) = args
Instances For
Equations
- MLIR.AST.Region.ops φ (MLIR.AST.Region.mk name args ops) = ops
Instances For
Equations
- MLIR.AST.instReprAttrValue φ = { reprPrec := fun (x : MLIR.AST.AttrValue φ) (x_1 : ℕ) => MLIR.AST.docAttrVal x }
Equations
- MLIR.AST.instReprAttrEntry φ = { reprPrec := fun (x : MLIR.AST.AttrEntry φ) (x_1 : ℕ) => MLIR.AST.docAttrEntry x }
Equations
- MLIR.AST.instReprAttrDict φ = { reprPrec := fun (x : MLIR.AST.AttrDict φ) (x_1 : ℕ) => MLIR.AST.docAttrDict x }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- MLIR.AST.instToFormatSSAVal = { format := repr }
Equations
- MLIR.AST.instReprOp φ = { reprPrec := fun (x : MLIR.AST.Op φ) (x_1 : ℕ) => MLIR.AST.op_to_format x }
Equations
- MLIR.AST.instReprRegion φ = { reprPrec := fun (x : MLIR.AST.Region φ) (x_1 : ℕ) => MLIR.AST.rgn_to_format x }
Equations
- (MLIR.AST.AttrEntry.mk name value).key = name
Instances For
Equations
- (MLIR.AST.AttrEntry.mk name value).value = value
Instances For
Equations
- MLIR.AST.AttrDict.empty = MLIR.AST.AttrDict.mk []
Instances For
Equations
- MLIR.AST.Op.empty name = MLIR.AST.Op.mk name [] [] [] MLIR.AST.AttrDict.empty
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).addArg arg = MLIR.AST.Op.mk name res (args ++ [arg]) regions attrs
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).addResult new_res = MLIR.AST.Op.mk name (res ++ [new_res]) args regions attrs
Instances For
Equations
- (MLIR.AST.Op.mk name res args regions attrs).appendRegion r = MLIR.AST.Op.mk name res args (regions ++ [r]) attrs
Instances For
Instances For
Equations
- (MLIR.AST.AttrDict.mk as).find name = match List.find? (fun (entry : MLIR.AST.AttrEntry φ) => entry.key == name) as with | some v => some v.value | none => none
Instances For
Equations
- attrs.find_nat name = match attrs.find name with | some (MLIR.AST.AttrValue.nat i) => some i | x => none
Instances For
def
MLIR.AST.AttrDict.find_int
{φ : ℕ}
(attrs : MLIR.AST.AttrDict φ)
(name : String)
:
Option (ℤ × MLIR.AST.MLIRType φ)
Equations
- attrs.find_int name = match attrs.find name with | some (MLIR.AST.AttrValue.int i ty) => some (i, ty) | x => none
Instances For
Equations
- attrs.find_str name = match attrs.find name with | some (MLIR.AST.AttrValue.str s) => some s | x => none
Instances For
Equations
- attrs.find_int' name = match attrs.find name with | some (MLIR.AST.AttrValue.int i a) => some i | x => none
Instances For
@[simp]
@[simp]
theorem
MLIR.AST.AttrDict.find_next
(φ : ℕ)
{n : String}
{n' : String}
(v : MLIR.AST.AttrValue φ)
(l : List (MLIR.AST.AttrEntry φ))
:
(MLIR.AST.AttrDict.mk (MLIR.AST.AttrEntry.mk n v :: l)).find n' = if (n == n') = true then some v else (MLIR.AST.AttrDict.mk l).find n'
Equations
Instances For
def
MLIR.AST.AttrDict.addType
(φ : ℕ)
(attrs : MLIR.AST.AttrDict φ)
(k : String)
(v : MLIR.AST.MLIRType φ)
:
Equations
- MLIR.AST.AttrDict.addType φ (MLIR.AST.AttrDict.mk as) k v = MLIR.AST.AttrDict.mk (MLIR.AST.AttrEntry.mk k (MLIR.AST.AttrValue.type v) :: as)
Instances For
Equations
- MLIR.AST.Op.addAttr φ (MLIR.AST.Op.mk name res args regions attrs) k v = MLIR.AST.Op.mk name res args regions (attrs.add (MLIR.AST.AttrEntry.mk (k, v).1 (k, v).2))
Instances For
Equations
- MLIR.AST.Region.empty name = MLIR.AST.Region.mk name [] []
Instances For
Equations
- MLIR.AST.Region.appendOp φ (MLIR.AST.Region.mk name args ops) op = MLIR.AST.Region.mk name args (ops ++ [op])
Instances For
Equations
- MLIR.AST.Region.appendOps φ (MLIR.AST.Region.mk name args ops_1) ops = MLIR.AST.Region.mk name args (ops_1 ++ ops)
Instances For
Equations
- MLIR.AST.instInhabitedMLIRType φ = { default := MLIR.AST.MLIRType.undefined "INHABITANT" }
Equations
- MLIR.AST.instInhabitedAttrValue φ = { default := MLIR.AST.AttrValue.str "INHABITANT" }
Equations
- MLIR.AST.instInhabitedOp φ = { default := MLIR.AST.Op.empty "INHABITANT" }
Equations
- MLIR.AST.instInhabitedRegion φ = { default := MLIR.AST.Region.empty "INHABITANT" }
Equations
- One or more equations did not get rendered due to their size.
Equations
- MLIR.AST.Region.fromOps os name = MLIR.AST.Region.mk name [] os
Instances For
def
MLIR.AST.Region.setArgs
{φ : ℕ}
(bb : MLIR.AST.Region φ)
(args : List (MLIR.AST.SSAVal × MLIR.AST.MLIRType φ))
:
Equations
- (MLIR.AST.Region.mk name args_1 ops).setArgs args = MLIR.AST.Region.mk name args ops