Instructions in Val IR may accept operands embodying values to be operated upon. There exists 5 types of operands:

  • Type references: A type reference denotes a lowered type definition.

  • Basic block references: A basic block reference denotes a basic block.

  • Constants: A constant is a value that is computed at compile time and immutable at runtime.

  • Basic block arguments: A basic block argument denotes the value passed to a basic block when control flow entered to its entry point.

  • Instruction results: An instruction result denotes the one of the values produced by the evaluation of an instruction.

A thin function reference is a constant because it is immutable. Similarly, the memory location of a global binding's storage is a constant.

Each basic block argument and instruction result is assigned to a unique local register in the function. The value of a register


An instruction i is said to be a user of an operand o if o is argument of i. Each occurence of an operand in one of its users is called a use.

Given two uses u1 and u2, u2 is sequenced after u1 (or, equivalently, u1 is sequenced before u2) if and only if:

  • the user of u2 is sequenced after the user of u1, or

  • u1 and u2 have the same user and u1 appears before u2.

Last updated