third_party/xla/xla/mlir/tools/mlir_interpreter/README.md
MLIR interpreter is a development tool, mainly intended for debugging. As the name implies, it executes MLIR programs. What makes it special is that it implements dialects at all levels of abstraction and all standard data types (tensor, memref, vector, scalar). One use case is to track down compiler bugs by executing the IR after each one and looking for changed results.
Features:
To create a new dialect, follow the following steps:
.cc implementation file in dialects/. The name of the file
should match your dialect name.dialects:dialects target.void.InterpreterValue.int64_t, float)SmallVector if your op has multiple results.InterpreterState&, an instance of
your op and any arguments your op takes.InterpreterValues, as
scalar C++ types or as SmallVector thereof (for variadic
arguments).InterpreterState::AddFailure to report this.REGISTER_MLIR_INTERPRETER_OP(YourOp).dialects/tests.