Skip to content

Update LLVM from 18 to 22#4951

Open
stertl wants to merge 1 commit into
bytecodealliance:mainfrom
siemens:dev/update_to_llvm_22
Open

Update LLVM from 18 to 22#4951
stertl wants to merge 1 commit into
bytecodealliance:mainfrom
siemens:dev/update_to_llvm_22

Conversation

@stertl
Copy link
Copy Markdown

@stertl stertl commented May 22, 2026

Changes

Bumps the LLVM version from LLVM 18 (llvmorg-18.1.8) to LLVM 22 (llvmorg-22.1.6). The ARC architecture target branch is updated accordingly from release/18.x to release/22.x.

Motivation

LLVM 22 delivers a significant AoT compilation speedup compared to LLVM 18. Compiling an example program (example.c.zip — a large C file with many global variables) to AOT shows:

wamrc version Wall time
wamrc 2.4.4 (LLVM 18) 66.79 s
wamrc with LLVM 22 12.59 s

~5× speedup — the updated compiler takes roughly one fifth of the time of the previous version for this workload.

Testing

# Compile C to Wasm
$ time clang-21 -target wasm32 -O3 -nostdlib example.c -Wl,--no-entry,--export=function -o example.wasm

# Compile Wasm to AoT with wamrc-2.4.4 with LLVM 18
$ time wamrc-2.4.4 -o example.aot example.wasm                                                                    
Create AoT compiler with:
  target:        x86_64
  target cpu:    skylake
  target triple: x86_64-unknown-linux-gnu
  cpu features:  
  opt level:     3
  size level:    3
  output format: AoT file
Compile success, file example.aot was generated.
wamrc -o example.aot example.wasm  66.79s user 0.04s system 99% cpu 1:06.83 total

# Compile Wasm to AoT with wamrc with LLVM22
$ time ./wamr-compiler/build/wamrc -o example.aot example.wasm
Create AoT compiler with:
  target:        x86_64
  target cpu:    skylake
  target triple: x86_64-unknown-linux-gnu
  cpu features:  
  opt level:     3
  size level:    3
  output format: AoT file
Compile success, file example.aot was generated.
/home/stefan/git/siemens-wasm-micro-runtime/wamr-compiler/build/wamrc -o    12.59s user 0.13s system 99% cpu 12.719 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant