Skip to content

Update LLVM to 22.1.7 - #142

Open
mbertuletti wants to merge 19 commits into
mainfrom
mbertuletti/llvm-update
Open

mbertuletti wants to merge 19 commits into
mainfrom
mbertuletti/llvm-update

Conversation

@mbertuletti

@mbertuletti mbertuletti commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

This PR updates the LLVM toolchain to v22.1.7.

The PR can be merged once the corresponding PRs on riscv-opcodes PR#50 and llvm toolchain PR#37 are also merged.

Changelog

  • Update riscv-opcodes, provide target to generate the backend support for new instruction encodings.
  • Update LLVM to v22.1.7, use LLVM as default compiler for software (except for systolic and omp code).
  • Update the riscv-tests (compile and run the tests externally). Currently the riscv-tests are a flattened dependency, ideally they should be also tracking the master repository.

Checklist

  • Automated tests pass
  • Changelog updated
  • Code style guideline is observed

mbertuletti and others added 10 commits October 28, 2026 09:59
Build the riscv-tests for RTL simulation from software/riscv_tests.mk
instead of the riscv-tests build system, and move snitch_isa.mk to
software/.
LLVM now uses the riscv-opcodes mnemonics with the CORE-V XCVmem syntax,
e.g. p.lw.irpost rd, (rs1), imm instead of p.lw rd, imm(rs1!).
Kernels built only with LLVM use it directly. The matmul_i32p asm
kernels are built by both compilers and use the macros of the new
xpulp_postmod.h header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mbertuletti and others added 9 commits October 29, 2026 14:17
The MemPool changes to Halide are small, so instead of maintaining a fork
the submodule points to upstream Halide and `make halide` applies
`toolchain/halide.patch`. The CI cache key includes the patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sources are formatted with the clang-format of the LLVM 22 toolchain,
so the lint job uses the same major version from PyPI instead of
clang-format 14. Wrap the lines of gen_trace.py longer than 79 characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Do not clone the riscv-opcodes submodule of llvm-project, which uses an
  SSH URL and is not needed to build LLVM.
- Install the Python requirements (riscv_opcodes) in check-opcodes and
  unit-test.
- Build the BootROM with GCC, as LLVM is not available in that job.
- Skip the floating-point applications when compiling with GCC and build
  all the applications with LLVM.
- Download LLVM in the run-apps jobs, as the traces are disassembled with
  llvm-mc, and pass all the MemPool extensions to llvm-mc.
- Do not crash the trace generation on instructions llvm-mc cannot decode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
update_opcodes.sh ran riscv_opcodes in the MemPool root, so encoding.h
was stamped with MemPool's HEAD and check-opcodes failed after any new
commit. It now runs in a scratch directory with GIT_DIR set to the
riscv-opcodes repository.

Cache install/bender per Bender version, so the installer only runs when 
the version changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mbertuletti
mbertuletti force-pushed the mbertuletti/llvm-update branch from eba7ada to baf0b08 Compare October 29, 2026 13:17
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