A Toy Dialect for ML Workload
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
}
}
About define Toy Dialect
toy.add
: Add operandtoy.sub
: Sub operand
Writing a simple pass about ConvertToyToArith
Lowering Toy Dialect to other Dialect