Skip to content

Abc

Pass dataclass

Pass(dialects: DialectGroup, *, no_raise: bool = True)

Bases: ABC

A pass is a transformation that is applied to a method. It wraps the analysis and rewrites needed to transform the method as an independent unit.

Unlike LLVM/MLIR passes, a pass in Kirin does not apply to a module, this is because we focus on individual methods defined within python modules. This is a design choice to allow seamless integration within the Python interpreter.

A Kirin compile unit is a ir.Method object, which is always equivalent to a LLVM/MLIR module if it were lowered to LLVM/MLIR just like other JIT compilers.