feat/fixed point ir pass#386
Merged
Merged
Conversation
nahime0
commented
Jun 17, 2026
Member
- feat(ir): add fixed-point EIR pass driver and identity arithmetic folding
- docs: add Compiling section and document the EIR optimization passes
- docs(claude): document the EIR pass driver and Compiling docs
- chore(skills): refresh verify-release and doc-update
…ding Add a fixed-point optimization pass driver over EIR functions, run after lowering and before codegen. In debug/test builds it re-validates each function after every pass (panicking and naming the pass on malformed IR) and panics on non-convergence within the iteration cap; both guards compile out of --release. First registered pass: identity arithmetic folding (x+0, x*1, x|0, x<<0, x&x, x*1.0 -> operand; x^x, x-x, x*0, x&0, x%1 -> 0), keeping PHP-equivalent behavior (integer x/0, x%0 still trap; float additive-zero and *0.0 excluded). Shared RAUW helper in src/ir_passes/rewrite.rs; chains resolve transitively. Toggle with --ir-opt=on|off / --no-ir-opt (env ELEPHC_IR_OPT), default on. Adds unit tests (driver convergence, cap/validation panics, every fold family) and end-to-end optimizer tests; marks both v0.25.x roadmap items done.
Add a new docs/compiling/ section dividing the compilation story into overview, pipeline, full CLI reference, targets, optimization controls, output/diagnostics, and linking/conditional compilation; register it in the docs index. Document the EIR fixed-point pass driver and identity folding in the-ir.md and the-optimizer.md, add the ir-opt phase to how-elephc-works.md, broaden the ir_passes/ description in architecture.md, and add a --no-ir-opt example to the README usage.
Add the EIR optimization-passes phase to the architecture pipeline, add an src/ir_passes/ row to the key modules table, add an "Adding a new EIR optimization pass" guide, point IR-level transforms at src/ir_passes/ in the optimizer section, and register the docs/compiling/ section.
Add the docs/compiling/ and docs/how-to/ sections to both skills, including a check that cli-reference.md stays in sync with every src/cli.rs flag/env var. Point builtin audits at the canonical catalog.rs (legacy src/codegen/builtins/ is frozen), extend the assembly-comment check to the active src/codegen_ir/ backend, and fix stale paths (platform.rs -> platform/, drop the removed x86_minimal runtime reference).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.