Skip to content

LLVM Vulkan 1.1.0 - Drop-In Standard Passes & Clang Integration

Latest

Choose a tag to compare

@HECer HECer released this 02 Nov 22:13
· 1 commit to main since this release

LLVM Vulkan 1.1.0 — Drop-in Standard LLVM Passes (GVN, CSE, CFG, DCE) & Clang Integration

LLVM Vulkan version 1.1.0 expands the project from a scoped compute prototype into a full, drop-in replacement pipeline for LLVM middle-end optimization passes, with automatic hook-in support for Clang -O2/-O3 compilations.

What's New in 1.1.0

  • Cross-Block Dominator GVN (lv-gvn / gvn): Connected the Vulkan GPU dense dominator matrix solver (dominators_rounds.comp, dominators_local_banked.comp) into GVNPass to eliminate common subexpressions across basic blocks dominated by the definition.
  • Commutative CSE Canonicalization: Normalized operand IDs for commutative operations (add, mul, and, or, xor, eq, ne) before hashing so that reversed operand pairs (a + b and b + a) produce matching candidate hashes and are deduplicated.
  • Drop-in Standard Pass Aliasing: Standard LLVM pass names (early-cse, gvn, simplifycfg, dce, adce, instcombine) are registered as aliases to allow direct invocation in standard -passes=... pipelines.
  • Automatic Clang Pipeline Integration: Implemented EP (Extension Point) callbacks (registerPipelineStartEPCallback, registerPipelineEarlySimplificationEPCallback, registerOptimizerLastEPCallback) so that clang -fpass-plugin=LLVMVulkan.so -O2 automatically hooks into the compilation pipeline when LV_AUTO_INSERT=1.
  • End-to-End Native Compilation Verification: Validated full pipeline from opt -> llc -> gcc -> native binary execution with 100% semantic equivalence.
  • Test Suite Expansion: Added tests/llvm/gvn.ll and tests/llvm/cse_commutative.ll. All 19 fixtures, 8,192 constant oracle cases, and semantic fuzzing passed with 0 errors.

Usage Example

# Standard opt invocation using standard pass names:
opt -load-pass-plugin=LLVMVulkan.so -passes='early-cse,gvn,simplifycfg,dce' input.ll -S -o output.ll

# Automatic Clang -O2 integration:
export LV_AUTO_INSERT=1
clang -fpass-plugin=LLVMVulkan.so -O2 -c main.c -o main.o

Verified Assets

  • LLVMVulkan-1.1.0-Windows-AMD64.zip (MSVC Release static library, tools, headers, CMake configs)
  • LLVMVulkan-1.1.0-Linux-x86_64.tar.gz (Linux shared library, tools, headers, CMake configs)
  • SHA256SUMS (checksum manifest)