fhelium.ir._analysis
Read-only analyses over mixed-level Programs.
ProgramInventory
class View source
ProgramInventory(operation_counts: Mapping[str, int], dialects: frozenset[str], functions: tuple[str, ...])Operation counts and dialect/function names found in a Program.
operation_counts counts every walked operation by its registered or textual name. dialects contains the first namespace component of those names. functions preserves top-level function order. The inventory does not classify semantic validity, backend support, or executability.
Attributes
| Name | Type | Default/value |
|---|---|---|
operation_counts | Mapping[str, int] | |
dialects | frozenset[str] | |
functions | tuple[str, ...] |
ValueState
class View source
ValueState(role: str | None, type: Attribute, metadata: Mapping[str, Attribute])Expose one SSA value's type, known role, and open metadata.
Attributes
| Name | Type | Default/value |
|---|---|---|
role | str | None | |
type | Attribute | |
metadata | Mapping[str, Attribute] |
analyze_evaluation_key_requirements
function View source
def analyze_evaluation_key_requirements(program: Program, *, entry: str='main') -> EvaluationKeyRequirements: ...List the evaluation-key capabilities requested by entry.
The analysis reads logical/CKKS operations and lowered evaluation-key operand uses from the selected single-block function and its nested regions. It returns symbolic requirements only; it does not generate, load, bind, or validate key objects. Re-run it after any transformation that may add or remove those operations. Unresolved logical rolls contribute their integer shift; resolved rotation operations contribute the normalized step represented by their key operand. entry must name one single-block function. Generic key switching remains caller-named and is not representable by EvaluationKeyRequirements.
analyze_value_states
function View source
def analyze_value_states(program: Program, *, function: str='main') -> Mapping[SSAValue, ValueState]: ...Return represented state for one single-block function's SSA values.
inventory_program
function View source
def inventory_program(program: Program) -> ProgramInventory: ...Count operations and list dialect and function names in program.
The result contains operation counts, dialect namespace prefixes, and ordered top-level function names. This read-only inspection does not validate CKKS state, derive resource requirements, query backend coverage, or modify the Program.