[][src]Module walrus::ir

Intermediate representation for instructions.

The goal is to match wasm instructions as closely as possible, but translate the stack machine into an instruction tree. Additionally all control frames are representd as Blocks.

Structs

AtomicFence

The atomic.fence instruction

AtomicNotify

The atomic.notify instruction to wake up threads.

AtomicRmw

An atomic read/modify/write operation.

AtomicWait

The *.atomic.wait instruction to block threads.

Binop

Binary operations, those requiring two operands

Block

block ... end

Br

br

BrIf

br_if

BrTable

br_table

Call

call

CallIndirect

call_indirect

Cmpxchg

An atomic compare-and-exchange operation.

Const

*.const

DataDrop

data.drop

Drop

drop

GlobalGet

global.get n

GlobalSet

global.set n

IfElse

if <consequent> else <alternative> end

InstrLocId

A symbolic original wasm operator source location.

InstrSeq

A sequence of instructions.

Load

*.load

LoadSplat

iaaxbb.load_splat

Local

A local variable or parameter.

LocalGet

local.get n

LocalSet

local.set n

LocalTee

local.tee n

Loop

loop ... end

MemArg

Arguments to memory operations, containing a constant offset from a dynamic address as well as a predicted alignment.

MemoryCopy

memory.copy

MemoryFill

memory.fill

MemoryGrow

memory.grow

MemoryInit

memory.init

MemorySize

memory.size

RefIsNull

ref.is_null

RefNull

ref.null

Return

return

Select

select

Store

*.store

TableGet

table.get

TableGrow

table.grow

TableSet

table.set

TableSize

table.size

Unop

Unary operations, those requiring one operand

Unreachable

unreachable

V128Bitselect

v128.bitselect

V128Swizzle

v128.swizzle

V128Shuffle

v128.shuffle

Enums

AtomicOp

The different kinds of atomic rmw operations

AtomicWidth

The different kinds of atomic rmw operations

BinaryOp

Possible binary operations in wasm

ExtendedLoad

The kinds of extended loads which can happen

Instr

An enum of all the different kinds of wasm instructions.

InstrSeqType

The type of an instruction sequence.

LoadKind

The different kinds of load instructions that are part of a Load IR node

LoadSplatKind

The different kinds of load instructions that are part of a LoadSplat IR node

StoreKind

The different kinds of store instructions that are part of a Store IR node

UnaryOp

Possible unary operations in wasm

Value

Constant values that can show up in WebAssembly

Traits

Visitor

A visitor is a set of callbacks that are called when a traversal (such as dfs_in_order) is walking an instruction tree.

VisitorMut

A mutable version of Visitor.

Functions

dfs_in_order

Perform an intra-procedural, depth-first, in-order traversal of the IR.

dfs_pre_order_mut

Perform an intra-procedural, depth-first, pre-order, mutable traversal of the IR.

Type Definitions

InstrSeqId

The identifier for a InstrSeq within some LocalFunction.

LocalId

The id of a local.

ShuffleIndices

Argument in V128Shuffle of lane indices to select