Conversion passes

-address-native-state-through-bases

Address native state planes through one base per function

Loads each native state plane’s address once from a private constant base global the optimizer cannot fold. Accesses remain GEPs from that base, so code generation shares materialized offsets across blocks. When both planes are used, an assumption preserves their separate storage and dereferenceability for alias analysis. Functions that access state in only one block, and coroutines, keep direct addresses. Run just before translation.

-convert-native-function-body-to-llvm

Convert one prepared native function body to LLVM

Run nested under llvm.func after prepare-native-llvm-functions. Workers own their type converters and mutate only their function, using the published ABI and locked symbol index. MLIR schedules functions in parallel unless threading is disabled.

-convert-native-schedule-actions-to-llvm

Expand verified executable scheduling actions into the native ABI

Options

-coalesce : Combine unobservable pending-set updates before physical expansion

-convert-prepared-sim-processes-to-llvm-coroutines

Lower simulation processes to switched-resume LLVM coroutines

Builds a deterministic target-layout canonical process frame, lowers only semantic suspension terminators to switched-resume LLVM coroutine points, and fully converts packed values, typed runtime operations, functions, arithmetic, and control flow without unrealized conversion casts.

-convert-runtime-to-llvm

Convert prepared runtime operations and types to the LLVM C ABI

Converts runtime operations and function/CFG boundary types, and emits exact external C declarations and ABI out-parameter storage. Requires prepare-runtime-to-llvm. The convert-talos-runtime-to-llvm pipeline composes preparation and conversion for callers that need both stages.

-convert-schedule-word-regions

Lower proven word regions without scalarizing packed values

-convert-simulation-to-native-schedule

Convert simulation to native schedule

Runs as a module pass in the native scheduling pipeline. Requires the Captures phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-convert-slang-to-talos

Convert elaborated Slang IR to exact Talos semantic IR

Exhaustively converts every concrete Slang operation and type to its verifier-backed Talos counterpart. Slang entities are illegal after this pass and conversion fails if any source semantics remain.

-convert-talos-sim-to-runtime

Lower precise simulation display and file I/O to runtime calls

Lowers literal bytes, display/write, and the supported packed file service subset to typed runtime calls and target-independent materializers. It also lowers four-state packed arguments to value/unknown planes, while leaving context projection and fragment status propagation as explicit hooks for native fragment lowering.

-convert-talos-sim-values-to-standard

Lower pure four-state packed values to standard integer IR

Converts each !simulation.logic value to an iW value plane and an iW unknown plane, lowers the complete pure packed-value operation family, and converts standard function and control-flow boundaries. Runtime resources, scheduling, time, and simulation code-unit structure are left untouched.

-encode-talos-sim-to-bytecode

Strictly encode the normalized executable simulation boundary

Builds one deterministic, pointer-free design bytecode image while leaving source simulation.func operations intact for native lowering. Every retained function must use the encoder’s closed normalized legality set: integer arith constants, arithmetic, bitwise, shifts, comparisons, select, extensions/truncation/index casts; cf branches and switches; and the explicitly implemented simulation value, aggregate, reference, state, scheduling, suspension, call, formatting, and file operations. Any other executable operation is rejected at that operation instead of being silently omitted. Optional VPI reflection is emitted as a separate DWARF-like database image.

Options

-vpi              : Reflection profile: auto, off, read, or full
-require-bytecode : Require scheduler execution through the embedded bytecode tier
-prune-native     : Omit native actors without interpreter fallbacks

-finalize-native-llvm

Finalize native scheduling, proofs and LLVM partition manifests

-fold-native-scalar-values

Fold SSA values proved constant by scoped scalar evolution

-materialize-native-group-promotion-readiness

Materialize exact knownness queries for planned native groups

Consumes the typed domain inventory on the private group latch array. Each domain is the exact union of existing member certificates; querying it changes no runnable owner or member proof. Native ranked materialization invokes the same phase after planning its code-size chunks, before the reverse dependency index and unknown-write publication are built.

-materialize-native-processes

Materialize native processes

Runs as a module pass in the native scheduling pipeline. Requires the Resolved phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-materialize-native-promotion-range-index

Materialize verified reverse dependencies for native proofs

Consumes typed kernel, group, route and NBA proof dependencies after native specialization. Defines the declared invalidation/recheck hooks and their immutable interval tables. Large bounded indexes additionally use compact buckets for narrow queries; wide queries retain the interval lookup. The coroutine conversion invokes this same materializer before publishing unknown-plane writes.

Options

-bucket-min-entries : Minimum dependency count for compact buckets

-materialize-runtime-byte-globals

Emit immutable byte globals remaining after reachability

-prepare-native-fragments

Prepare native fragments

Runs as a module pass in the native scheduling pipeline. Requires the EvalVariants phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-prepare-native-llvm-functions

Publish native LLVM function ABIs and shared runtime symbols

Requires materialize-native-processes. Serializes shared globals and runtime declarations and replaces every func.func with an LLVM function shell. Function bodies may still contain arithmetic, control-flow and Schedule operations. Caches immutable ABI and symbol inputs for the following llvm.func-anchored conversion.

-prepare-native-managed-roots

Prepare native managed roots

Runs as a module pass in the native scheduling pipeline. Requires the Schedule phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-prepare-native-process-frames

Prepare native process frames

Runs as a module pass in the native scheduling pipeline. Requires the State phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-prepare-native-schedule-inputs

Prepare native schedule inputs

Runs as a module pass in the native scheduling pipeline. Requires the Empty phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-prepare-runtime-to-llvm

Prepare runtime ownership, embedded design, and LLVM byte globals

Validates the explicit little-endian 32-bit or 64-bit target layout and runtime buffer ownership, materializes embedded design descriptors, and reserves deterministic byte-global symbols. Runtime operations and types remain available for inspection. Run before convert-runtime-to-llvm.

-schedule-plan-native-actors

Schedule plan native actors

Runs as a module pass in the native scheduling pipeline. Requires the Frames phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-schedule-plan-native-eval-ownership

Schedule plan native eval ownership

Runs as a module pass in the native scheduling pipeline. Requires the Fragments phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-schedule-plan-native-executable-nodes

Plan native executable schedule nodes

Runs as a module pass in the native scheduling pipeline. Requires the Ownership phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-schedule-plan-native-state

Schedule plan native state

Runs as a module pass in the native scheduling pipeline. Requires the Inputs phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-schedule-resolve-native-eval

Schedule resolve native eval

Runs as a module pass in the native scheduling pipeline. Requires the ExecutableNodes phase of the preserved native frame and schedule analysis; this preserves the canonical fallback ABI across native-only rewrites.

-talos-materialize-native-eval-groups

Materialize certified native activation bodies and boundary state

Expands certified executor calls in LLVM dialect after value-domain routes are specialized and the canonical bytecode fallback is frozen. Preserves activation predicates and publishes SSA state at retained boundaries. Run before computing the final native partition manifest. The coroutine conversion invokes the same materializer at that point in its pipeline.

-talos-native-share-scoped-temporaries

Share stack slots between lifetime-scoped temporaries

Gives allocas whose every use lies between one llvm.intr.lifetime.start and lifetime.end in a single block a shared entry-block slot per element type and alignment. Generated runtime-call buffers would otherwise each own a frame slot. Presplit coroutines keep their allocations.

-talos-sim-build-compute-graph

Derive descriptor-range summaries and a deterministic schedule

Propagates stable descriptor provenance through SSA and CFG edges, computes interprocedural bit-range mod/ref summaries, assigns fixed continuation, timing, and NBA sites, and derives the late fragment compute graph. The graph is diagnostic compiler metadata, not the primary simulation IR.

Options

-workers           : Number of generated static worker lanes
-vpi               : VPI observability mode: off, read, or full
-prune-effect-free : Erase processes that only read and wait before deriving the graph (VPI off)

-talos-sim-extract-periodic-clocks

Extract private toggle clocks from uniform periodic processes

Replaces equal positive constant delays in a singleton, nonterminating process with waits on a private periodic clock. All original assignments, including NBA publication and initialization, remain in the source process. Runs before suspension threading and persistent compute-graph construction.

Options

-vpi : VPI observability mode: off, read, or full

-talos-sim-finalize

Remove semantic IR and verify the executable simulation boundary

-talos-sim-instrument-managed-roots

Bind live managed SSA values to precise GC roots

Uses MLIR liveness to allocate and maintain precise managed-root slots around collection points and process activation boundaries. By default every allocation and call is a collection point. Under polled collection (talos-sim-insert-gc-polls) only simulation.gc.safepoint polls and calls not marked simulation.gc_poll_free are, and a function without one registers no roots.

Options

-polled : Collect only at GC polls and calls that may reach one

-talos-sim-instrument-reference-lifetimes

Release automatic simulation references on CFG exits

Uses MLIR dominance and liveness to insert one owner release on every control-flow edge where an automatic simulation reference dies.

-talos-sim-instrument-vpi-frames

Bind exact source call sites to procedural frame handoffs

-talos-sim-lower-real-conversions

Normalize pure simulation real conversions to arith

Rewrites simulation time-to-real and integer/real conversions whose operands and results already have standard types. The pass introduces no runtime calls. Time-valued operations are normalized later with their backend type boundary.

-talos-sim-lower-unit

Lower one frozen simulation code unit to SSA and CF

Requires talos-sim-prepare-unit-lowering at the enclosing module anchor. Workers resolve external symbols through the cached parent analysis and never read mutable sibling function attribute dictionaries.

-talos-sim-materialize-clocked-control

Make singleton initial clock-control state explicit

Coalesces same-edge waits in a statically spawned initial process into one dispatch boundary. Scalar continuation operands and the resume phase live in private design storage shared by native evaluation and coroutine fallback. Startup side effects remain in the canonical process entry.

-talos-sim-materialize-clocked-samples

Materialize deferred assertion and coverage clock samplers

-talos-sim-materialize-dpi-exports

Materialize scope-specific zero-time DPI export bridges

Builds one capture-free bridge for every elaborated exported function. Each bridge resolves the owning scope’s immutable descriptor captures from its runtime context, so native and bytecode export dispatch share the same ordinary simulation function body and result ordering.

-talos-sim-plan-native-partitions

Plan stable semantic native compilation partitions

Groups executable simulation functions by semantic class or code-unit ownership, keeps direct-call SCCs indivisible, and records deterministic members, imports, exports, and dependencies. Partition identity never depends on IR order, worker count, or host load, so the same manifest can drive parallel object emission, ThinLTO, and incremental cache keys.

-talos-sim-prepare

Resolve and freeze semantic IR into isolated simulation units

Options

-prune-unused-coverage        : Prune unreferenced embedded covergroups before declaration materialization
-preserve-vpi-method-bindings : Retain executable class method bindings for VPI reflection
-preserve-vpi-box-bindings    : Retain exact untyped mailbox value type bindings for VPI reflection
-preserve-vpi-frames          : Preserve exact procedural frame activations and statement checkpoints

-talos-sim-prepare-coverage

Inventory coverage obligations and emit the native schema

Runs after early symbol DCE and before per-unit lowering so stable coverage identities do not depend on the optimization level. The pass owns all IR analysis and schema construction; the driver only supplies policy attrs.

-talos-sim-prepare-unit-lowering

Cache symbol tables and callable metadata before parallel unit lowering

-talos-sim-thread-process-cfg

Make process state explicit on every CFG edge

Threads non-capture SSA values that cross a suspension through block arguments to make process continuation state explicit. Values defined earlier in the same activation keep their SSA definitions. Constant continuation operands and design views of process arguments are rematerialized instead of being stored in the canonical process frame.

-talos-sim-thread-runtime-statuses

Thread runtime failures through simulation calls

Computes the transitive set of simulation functions that may fail, appends a runtime status result to their signatures and call sites, and lowers status checks to explicit success and failure control flow.