SPIR-V binaries to MLIR -> LLVM IR
Go to file
kim d523862608
Initial
2025-12-19 21:07:20 +00:00
include Initial 2025-12-19 21:07:20 +00:00
lib Initial 2025-12-19 21:07:20 +00:00
test/SPIRV Initial 2025-12-19 21:07:20 +00:00
CMakeLists.txt Initial 2025-12-19 21:07:20 +00:00
README.md Initial 2025-12-19 21:07:20 +00:00
main.cpp Initial 2025-12-19 21:07:20 +00:00

README.md

lume

lume is a compiler that converts SPIR-V binaries to MLIR and then to LLVM IR. This enables cross compilation of SPIR-V shaders to various target architectures through the LLVM toolchain

Building

Prerequisites

  • CMake 3.20 or higher
  • LLVM (w/ MLIR support)
  • C++17 compatible compiler

Build

mkdir build
cd build
cmake .. -DLLVM_DIR=/path/to/llvm/build/lib/cmake/llvm \
         -DMLIR_DIR=/path/to/mlir/build/lib/cmake/mlir
make

Usage

lume input.spv -o output.mlir
lume input.spv --dump-mlir
lume input.spv --dump-all
lume - -o output.mlir

Options

  • Input file
    <input file>
    Input SPIR-V binary file (use - for stdin)
  • Output file
    -o <output file>
    Specify output file (default: stdout)
  • SPIR-V MLIR Dump
    --dump-mlir
    Dump the SPIR-V MLIR dialect
  • Full Dump
    --dump-all
    Dump all dialects and LLVM IR