HECer · version 1.0 · November 2026

LLVM
Vulkan

Portable compute for selected compiler calculations.

LLVM Vulkan iconGeometric LV monogram for LLVM Vulkan. AI-assisted vector design; not an official LLVM or Khronos mark.

A C++ compute library and real LLVM optimization passes.
Defined scope. Reproducible evidence. No CUDA dependency.

Hermann Fischer / HECer · Apache-2.0 WITH LLVM-exception
AI-assisted presentation and vector design. Not an official LLVM or Khronos project.

What the project delivers

LLVM passes

Integer foldingBatched pure scalar operations through 64 bits.
Local CSEGPU hashing; exact equality and dominance stay on the host.
CFG cleanup and DCEGraph reachability with conservative roots and LLVM-owned IR edits.

Standalone compute API

Folding, reachability, dense dominators, gen/kill liveness, unsigned scan, key sorting and record hashing.

The standalone primitives do not replace LLVM’s register allocator, linker or native DominatorTree.

Complete implementation and coverage ledger

How a request runs

LLVM retains semantic authority.

CPU references and independent LLVM oracles check the accepted subset. Unsupported instructions remain for upstream passes.

Integration, semantics and exact LLVM ABI requirements

Portable Vulkan by capability

Vulkan 1.1 baselineFixed 128-thread workgroups and embedded SPIR-V.
Optional accelerationSubgroup scans and shared-memory solvers run only when the device supports them.
Portable fallbacksGeneral shaders remain available when optional paths are disabled or unsupported.
Strict backend selectionAn explicit Vulkan request dispatches Vulkan or fails; it never reports a scalar fallback as GPU work.

Wide folding requires shaderInt64. Physical RTX 5090 and software lavapipe are tested; physical AMD/Intel validation remains open.

First optimization iteration

Pooled buffers, persistent mappings, combined submissions, subgroup scan, radix sort and local graph solvers.

Warm API time, msOriginal VulkanIteration 1Speedup
Integer fold · 32-bit9.8196.5011.51×
Exclusive scan6.6502.5712.59×
Sort keys7.5002.7852.69×

1,048,576 array elements · 27 warm samples per side · Earlier Vulkan versus optimized Vulkan, not CPU versus GPU.
Iteration-one evidence

Second optimization iteration

Small components converge locally around one oversized component. Per-round flags and adaptive batching reduce host polling.

7.61×64 chains of 128 + star
10.50×64 chains of 512 + star
3.58×64 chains of 128 + chain

Isolated batching reduced submissions from 257 to 36, yielding a 4.15× API speedup in that measured case.

Mixed components add one 2,048-node star or chain. Ratios compare iteration 1 with iteration 2. The isolated batching baseline already includes mixed execution and per-round flags.
All changes, discarded variants and counter evidence

Fresh CPU versus GPU

1,048,576 elementsCPU msGPU msCPU / GPU
Integer fold · 32-bit12.6574.1663.04×
Integer fold · 64-bit16.1787.1032.28×
Exclusive scan1.2801.4690.87×
Sort keys55.9641.66633.59×
Hash records3.3302.6461.26×

Ratios above one favor GPU. Ryzen 9 5950X single-threaded project reference; sorting uses std::sort. RTX 5090 includes transfers/readback. 55 warm samples per side; every output checked. Not a comparison with upstream LLVM or a parallel CPU library.
All 37 rows and measurement boundaries

Where the CPU still wins

151×

The CPU is faster on the tested long-chain mixed graph.

CPU: 0.0642 ms
GPU: 9.7100 ms

The CPU uses a work list. Vulkan still spends substantial work on convergence rounds.

CPU also wins every 1,024-element workload and scan at every measured size.

An improvement over earlier Vulkan does not imply a win over CPU. Work-efficient GPU frontiers and measured offload decisions remain future work.

Validation that can be rerun

Native RTX 5090Differential arithmetic and graph tests, large dispatches, forced fallbacks and synchronization validation.
Package relocationInstall, move the package, build an external CMake consumer, then run CPU and Vulkan operations.
Linux and LLVMOptimized/fallback lavapipe, 17 IR fixtures per mode, 8,192 arithmetic oracle cases and 64-function semantic comparison.
Failure recoveryAllocation fault injection checks that submitted work is joined before pooled resources are reused.

Reproduction instructions · Validation records and remaining limits

The version 1.0 contract

Documented source APIC++17, defined integer and graph semantics, explicit errors and one compute instance per worker.
Relocatable distributionInstalled headers and static library, find_package support, benchmark CLI, embedded validated shaders and offline documentation.
Exact LLVM linkageBuild each plugin against the host LLVM installation. No cross-version LLVM binary ABI promise.
Performance by measurementCPU remains the conservative plugin default. No universal GPU offload or compiler-speedup guarantee.

Supported scope, platforms, compatibility and release gates

Remaining engineering work

Work-efficient GPU graph frontiersReduce redundant rounds before further tuning fixed-round kernels.
Measured offload decisionsUse representative compiler workloads; keep unprofitable work on CPU.
Broader compatibility and real buildsPhysical AMD/Intel devices, native Windows LLVM plugin ABI, more LLVM revisions and whole-compiler performance.

These are unimplemented follow-ups, not features or measured gains of version 1.0. Frontends, code generation, register allocation and linking remain upstream.

Build. Verify. Measure.

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
  -DLV_BUILD_LLVM_PLUGIN=OFF
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failure
cmake --install build --config Release --prefix install

Explore the interactive benchmark graphs →

Build the LLVM plugin separately against the exact host installation. Measure complete compiler processes before deciding to offload.

github.com/HECer/llvm-vulkan · Release guide
Apache-2.0 WITH LLVM-exception · AI-assisted development, presentation and vector assets.

← / → navigate · Home / End jump · Browser print exports the full deck · Works offline