-
Notifications
You must be signed in to change notification settings - Fork 74
Notes on compilation pipeline from Devito MLIR llvm IR .so
Anton Lydike edited this page Mar 14, 2023
·
5 revisions
The current example.py
can be found on our branch, it applies the iet_to_standard_mlir
pass
python3 example.py > raw.mlir
This lowers devito to something that's mlir-compatible
cat raw.mlir | mlir-opt -cse -loop-invariant-code-motion --mlir-print-op-generic > optimized.mlir
cat optimized.mlir | mlir-opt -convert-scf-to-cf -convert-cf-to-llvm -convert-arith-to-llvm -convert-math-to-llvm -convert-func-to-llvm -reconcile-unrealized-casts > llvm.mlir
cat llvm.mlir | mlir-translate --mlir-to-llvmir > llvm.ll
clang -shared llvm.ll -o kernel.so