cfallin opened issue #4135:
We should update our documentation in
cranelift/docsat least in the following ways:
- We should make a pass to ensure that outdated concepts related to the old backend framework, like encodings and recipes, are removed;
- We should fill out documentation about the new backend framework's architecture, beyond the doc-comments in the source (but likely borrowing from them);
- We should provide more "purpose-directed guides":
- How to add a new backend (#4126);
- How to add a new instruction to CLIF;
- How to add a new instruction to a machine backend;
- How to add a new lowering from CLIF to a machine backend;
- Strategies to debug codegen issues (minimization, diffing output, using "optimization fuel" (#4134)).
cfallin labeled issue #4135:
We should update our documentation in
cranelift/docsat least in the following ways:
- We should make a pass to ensure that outdated concepts related to the old backend framework, like encodings and recipes, are removed;
- We should fill out documentation about the new backend framework's architecture, beyond the doc-comments in the source (but likely borrowing from them);
- We should provide more "purpose-directed guides":
- How to add a new backend (#4126);
- How to add a new instruction to CLIF;
- How to add a new instruction to a machine backend;
- How to add a new lowering from CLIF to a machine backend;
- Strategies to debug codegen issues (minimization, diffing output, using "optimization fuel" (#4134)).
cfallin labeled issue #4135:
We should update our documentation in
cranelift/docsat least in the following ways:
- We should make a pass to ensure that outdated concepts related to the old backend framework, like encodings and recipes, are removed;
- We should fill out documentation about the new backend framework's architecture, beyond the doc-comments in the source (but likely borrowing from them);
- We should provide more "purpose-directed guides":
- How to add a new backend (#4126);
- How to add a new instruction to CLIF;
- How to add a new instruction to a machine backend;
- How to add a new lowering from CLIF to a machine backend;
- Strategies to debug codegen issues (minimization, diffing output, using "optimization fuel" (#4134)).
cfallin labeled issue #4135:
We should update our documentation in
cranelift/docsat least in the following ways:
- We should make a pass to ensure that outdated concepts related to the old backend framework, like encodings and recipes, are removed;
- We should fill out documentation about the new backend framework's architecture, beyond the doc-comments in the source (but likely borrowing from them);
- We should provide more "purpose-directed guides":
- How to add a new backend (#4126);
- How to add a new instruction to CLIF;
- How to add a new instruction to a machine backend;
- How to add a new lowering from CLIF to a machine backend;
- Strategies to debug codegen issues (minimization, diffing output, using "optimization fuel" (#4134)).
AnnieSld commented on issue #4135:
Good afternoon, while reading through the Cranelift documentation, I noticed that several guides no longer matched the current implementation. I updated the documentation to reflect the current codebase.
The changes include:
backend-architecture.md: updated the description of the CLIF to VCode to binary pipeline and documented the current roles of ISLE, regalloc2, and MachInst.
add-new-backend.md: updated outdated function signatures, file names, PRegSet usage, and MachInst trait methods.
add-clif-instruction.md: corrected the instruction format API, builder methods, generated file names, and interpreter support.
add-machine-instruction.md: fixed register access in emit(), corrected the ISLE file path, and updated the testing commands.
debugging-codegen.md: replaced the deprecated CRANELIFT_VERBOSE environment variable with RUST_LOG, updated the clif-util commands, and corrected the chaos mode instructions.
testing.md: replaced the deprecated test legalizer command with test compile, updated the RISC-V flag, and corrected the CRANELIFT_TEST_BLESS environment variable.
index.md: refreshed the guide descriptions and restored the missing link to isle-integration.md.
compare-llvm.md: updated the description of the current compilation pipeline.Would a PR with these changes be welcome?
AnnieSld edited a comment on issue #4135:
While reviewing the Cranelift documentation I found several guides that
no longer matched the current codebase. This PR updates them to reflect
the current implementation.New pages
backend-architecture.md: Documents the CLIF-to-VCode-to-binary
pipeline and the current roles of ISLE, regalloc2, andMachInst.
add-new-backend.md: Step-by-step guide for creating a new ISA
backend: directory layout, registration, settings,MachInsttrait,
PRegSetusage, ABI, ISLE lowering rules, and tests.
add-clif-instruction.md: Guide for adding a new CLIF opcode:
instruction format API, builder methods, generated file names,
verifier checks, and interpreter support.
add-machine-instruction.md: Guide for adding a machine
instruction variant: register access inemit(), ISLE file paths,
and testing commands.
debugging-codegen.md: Guide for debugging the code generator
usingRUST_LOG,clif-util, and chaos mode.Updates to existing pages
testing.md: Replaced the deprecatedtest legalizercommand
withtest compile, updated the RISC-V feature flag name, and
corrected theCRANELIFT_TEST_BLESSenvironment variable.
index.md: Refreshed guide descriptions and restored the missing
link toisle-integration.md.
compare-llvm.md: Updated the description of the current
compilation pipeline.Test plan
- [ ]
cargo test -p cranelift-filetestspasses- [ ]
cargo doc -p cranelift-codegenbuilds without warnings
AnnieSld edited a comment on issue #4135:
While reviewing the Cranelift documentation I found several guides that
no longer matched the current codebase.New pages
backend-architecture.md: Documents the CLIF-to-VCode-to-binary
pipeline and the current roles of ISLE, regalloc2, andMachInst.
add-new-backend.md: Step-by-step guide for creating a new ISA
backend: directory layout, registration, settings,MachInsttrait,
PRegSetusage, ABI, ISLE lowering rules, and tests.
add-clif-instruction.md: Guide for adding a new CLIF opcode:
instruction format API, builder methods, generated file names,
verifier checks, and interpreter support.
add-machine-instruction.md: Guide for adding a machine
instruction variant: register access inemit(), ISLE file paths,
and testing commands.
debugging-codegen.md: Guide for debugging the code generator
usingRUST_LOG,clif-util, and chaos mode.Updates to existing pages
testing.md: Replaced the deprecatedtest legalizercommand
withtest compile, updated the RISC-V feature flag name, and
corrected theCRANELIFT_TEST_BLESSenvironment variable.
index.md: Refreshed guide descriptions and restored the missing
link toisle-integration.md.
compare-llvm.md: Updated the description of the current
compilation pipeline.
Last updated: Jul 29 2026 at 05:03 UTC