Paran0idy / mlir-toy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MLIR-Toy

A Toy Dialect for ML Workload

Example

module {
  func.func @test(%arg0: i32, %arg1: i32) -> i32 {
    %0 = toy.add %arg0 %arg1 : i32 i32 -> i32
    %1 = toy.sub %arg0 %arg1 : i32 i32 -> i32
    %2 = arith.addi %arg0, %arg1 : i32
    return %2 : i32
  }
}

Dialect

About define Toy Dialect

Operation

  • toy.add: Add operand
  • toy.sub: Sub operand

Pass

Writing a simple pass about ConvertToyToArith

Conversion

Lowering Toy Dialect to other Dialect

About


Languages

Language:C++ 74.1%Language:CMake 17.3%Language:C 4.9%Language:MLIR 3.7%