Skip to main content

Module insn

Module insn 

Source
Expand description

Core SSA value type: instructions. An instruction is a value that is defined by an operation and can be used by other instructions. Each instruction has a mnemonic, which is the operation that it performs, and a size in bytes of the value it defines. Instructions that do not define a value (e.g. terminators) have a size of 0.

Modules§

segment
Token-segment rendering of instructions for rich (colored, clickable) display.

Structs§

Apply
Assert
BadInsn
Control flow reached bytes that do not decode to a valid instruction.
Binary
Branch
BranchInd
CBranch
Call
CallInd
Carry
Extract
Projects field index out of an aggregate value. The instruction’s result type is that field’s type.
FloatToFloat
FloatToInt
Gep
Computes the address of a struct field: gep(base, offset)base + offset, but the result is typed PtrTo<field.type> and prints by field name instead of the raw offset.
Instruction
A local SSA value, which is a value that is defined by an instruction and can be used by other instructions. Local values are not associated with any particular memory location.
InstructionId
InstructionRef
InstructionStatement
A formattable wrapper around an instruction reference, which formats the instruction as a string with its mnemonic and operands.
IntToFloat
IntrinsicApp
A pure intrinsic instruction: an IntrinsicId applied to its operands.
IntrinsicId
A stable-by-name handle into the intrinsic registry.
IntrinsicRegistration
One intrinsic’s registration, submitted via inventory::submit! (see register_intrinsic!) and collected into the global registry.
IsFloatNaN
Load
LocalInsnId
Function-local instruction index. Storage detail: indexes the owning FunctionBody’s instruction arena. Pass composite InstructionIds around in pass code, not these.
LzCount
Map
A total element-wise map out[i] = body(src[i], captures…). The result is [U; N] where N is src’s length and U is the body’s return type.
PCodeOp
PCodeOpId
A stable identifier for a user-defined p-code operation.
PopCount
Range
Return
ReturnValue
SBorrow
SCarry
Scan
A total left-scan out[i] = acc_i+1 where acc_i+1 = body(acc_i, src[i], captures…) and acc_0 = init. The result is [U; N] where N is src’s length and U is the body’s return type (also the accumulator’s type).
Sext
Store
Switch
Multi-way dispatch on an integer scrutinee: the resolved form of a jump table.
SwitchArm
One arm of a Switch: the scrutinee value that selects it, the block it transfers to, and that block’s parameter arguments.
TailCall
A tail call: an unconditional transfer of control to another function’s entry (a thunk jmp realfunc, or a tail jmp/jcc that the disassembler resolved to a sibling function). Unlike Branch, whose target is a BlockId within the same function, a TailCall carries a Callee: normally a real FunctionId, or temporarily a pass-local minted placeholder. It is a function-level terminator with no intra-function CFG successor. This is the honest encoding of cross-function control flow — the IR never stores a foreign BlockId. See the context-split design, ruling 2 (“strict IR locality”).
Tuple
Builds an aggregate value from its ordered fields. The instruction’s result type is the Aggregate of the fields’ types.
Unary
Zext

Enums§

Binop
CallTag
Per-call-site binding-convention tag (argpromote v2, ARGPROMOTE_REGISTERS_V2.md).
Callee
A statically named callee. Real refers to an installed function; Minted is a pass-local placeholder that must be resolved before execution.
FloatBinop
IntBinop
Mnemonic
The operation performed by an Instruction.
RootOp
The IR shape an intrinsic’s idiom is rooted at, used to gate recognition so only relevant recognizers run per instruction.
Simplified
The result of an intrinsic’s simplify hook.
Unop

Traits§

Intrinsic
The definition of one kind of intrinsic — its name, arity, result typing, shared evaluator, and optional recognition / simplification behaviour.

Functions§

recognizers_for
Every intrinsic whose recognition idiom roots at root. Empty if none.

Type Aliases§

InstructionMutRef