Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00
..

Minimal MLIR binaries

This folder contains example of minimal MLIR setups that can showcase the intended binary footprint of the framework.

  • mlir-cat: This includes the Core IR, the builtin dialect, the textual parser/printer, the support for bytecode serialization.
  • mlir-minimal-opt: This adds all the tooling for an mlir-opt tool: the pass infrastructure and all the instrumentation associated with it.
  • mlir-miminal-opt-canonicalize: This add the canonicalizer pass, which pulls in all the pattern/rewrite machinery, including the PDL compiler and intepreter.

Below are some example measurements taken at the time of the LLVM 17 release, using clang-14 on a X86 Ubuntu and bloaty.

Base Os Oz Os LTO Oz LTO
mlir-cat 1024KB 840KB 885KB 706KB 657KB
mlir-minimal-opt 1.62MB 1.32MB 1.36MB 1.17MB 1.07MB
mlir-minimal-opt-canonicalize 1.83MB 1.40MB 1.45MB 1.25MB 1.14MB

Base configuration:

cmake ../llvm/ -G Ninja \
   -DCMAKE_BUILD_TYPE=RelWithDebInfo \
   -DLLVM_CCACHE_BUILD=ON \
   -DLLVM_ENABLE_PROJECTS=mlir \
   -DLLVM_BUILD_EXAMPLES=ON \
   -DLLVM_TARGETS_TO_BUILD="Native" \
   -DCMAKE_C_COMPILER=clang \
   -DCMAKE_CXX_COMPILER=clang++ \
   -DLLVM_ENABLE_LLD=ON \
   -DLLVM_ENABLE_BACKTRACES=OFF \
   -DMLIR_ENABLE_PDL_IN_PATTERNMATCH=OFF \
   -DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO=-Wl,-icf=all

Note: to measure the on-disk size, you need to run strip bin/mlir-cat first to remove all the debug info (which are useful for bloaty though).

The optimization level can be tuned with -Os or -Oz:

  • -DCMAKE_C_FLAGS_RELWITHDEBINFO="-Os -g -DNDEBUG" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-Os -g -DNDEBUG"
  • -DCMAKE_C_FLAGS_RELWITHDEBINFO="-Oz -g -DNDEBUG" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-Oz -g -DNDEBUG"

Finally LTO can also be enabled with -DLLVM_ENABLE_LTO=FULL.

Bloaty can provide measurements using: bloaty bin/mlir-cat -d compileunits --domain=vm or bloaty bin/mlir-cat -d symbols --demangle=full --domain=vm