tree: 7d2b187e2cab661ad8355be8a6bfa79edefc250f [path history] [tgz]
  1. API/
  2. Bindings/
  3. Codegen/
  4. ConstEval/
  5. Dialect/
  6. InputConversion/
  7. Modules/
  8. Pipelines/
  9. PluginAPI/
  10. Preprocessing/
  11. Tools/
  12. Utils/
  13. CMakeLists.txt
  14. README.md
compiler/src/iree/compiler/README.md

IREE Compiler

This directory contains IREE's main MLIR-based compiler.

Paths of particular interest include:

└── compiler/
    ├── API/         (C and Python APIs)
    ├── Bindings/    (used to generate different ABI bindings)
    ├── Codegen/     (device code generation for assorted APIs)
    ├── Dialect/
    │   ├── Flow/    (tensor program modeling and compute workload partitioning)
    │   ├── HAL/     (Hardware Abstraction Layer for buffer and execution management)
    │   │   └── Target/
    │   │       ├── LLVM/
    │   │       ├── VMVX/
    │   │       ├── VulkanSPIRV/
    │   │       └── etc.
    │   ├── Stream/  (device placement and asynchronous scheduling)
    │   ├── Util/    (common types across other IREE dialects)
    │   └── VM/      (abstract Virtual Machine)
    ├── InputConversion/  (conversions from frontend/input dialects)
    └── Translation/      (translation pipeline definitions)

Noteworthy compiler components not included here include:

├── integrations/
│   └── tensorflow/
│       └── iree_tf_compiler/  (passes and tools for importing TensorFlow programs)
└── llvm-external-projects/
    ├── iree-compiler-api/     (C and Python APIs for the compiler)
    └── iree-dialects/         (public IREE dialects for other projects to target)

The general flow of data from a frontend framework down to a compiled program is:

program written in framework

    |
    |  import tool
    V

imported .mlir file

    |
    |  main IREE compiler
    V

compiled program

where import tools live outside of the compiler/ directory (and possibly outside of the IREE repo itself).

Refer to IREE's presentations and talks and this architecture diagram for details on how the pieces fit together:

IREE Architecture

Coding Style

Like the rest of the project, the compiler/ directory uses clang-format with the BasedOnStyle: Google option. However, since the code in this directory makes heavy use of LLVM and MLIR, it also adheres to LLVM style for variable naming (use int variableName instead of int variable_name and pointer alignment (use int *a instead of int* a).

Read more: