Reference: https://mlir.llvm.org/docs/Tutorials/Toy/Ch-3/

Note: Check Setup the Environment of MLIR for the environment setup.

1. Run Example

Emit MLIR:

toyc-ch3 $MLIR_HOME/test/Examples/Toy/Ch3/codegen.toy -emit=mlir -opt

Key Points:

  • Pattern-match and rewrite;
  • Declarative, rule-based pattern-match and rewrite (DRR);