Skip to content

feat/fixed point ir pass#386

Merged
nahime0 merged 4 commits into
mainfrom
feat/fixed-point-ir-pass
Jun 17, 2026
Merged

feat/fixed point ir pass#386
nahime0 merged 4 commits into
mainfrom
feat/fixed-point-ir-pass

Conversation

@nahime0

@nahime0 nahime0 commented Jun 17, 2026

Copy link
Copy Markdown
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

nahime0 added 4 commits June 17, 2026 12:09
…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).
@nahime0
nahime0 merged commit 9b676f4 into main Jun 17, 2026
21 checks passed
@nahime0
nahime0 deleted the feat/fixed-point-ir-pass branch June 17, 2026 10:47
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