Instruction

public protocol Instruction : CustomStringConvertible, Sendable

A Hylo IR instruction.

  • result Default implementation

    The type of the instruction’s result, if any.

    Default Implementation

    Declaration

    Swift

    var result: IR.Type? { get }
  • operands Default implementation

    The operands of the instruction.

    Default Implementation

    Declaration

    Swift

    var operands: [Operand] { get }
  • The site of the code corresponding to that instruction.

    Declaration

    Swift

    var site: SourceRange { get }
  • Replaces the operand at position i with o.

    Do not call this method directly. Use Module.replaceUses(of:with:) instead to ensure def-use ensure def-use chains are kept updated.

    Declaration

    Swift

    mutating func replaceOperand(at i: Int, with new: Operand)
  • isTransparentOffset Extension method

    true iff self is an instruction computing an address derived from its operand without accessing them.

    Declaration

    Swift

    fileprivate var isTransparentOffset: Bool { get }
  • isAccess(_:) Extension method

    Returns true iff self is an access [k] instruction.

    Declaration

    Swift

    func isAccess(_ k: AccessEffect) -> Bool
  • isAccess(in:) Extension method

    Returns true iff self is an access k instruction where k is subset of ks.

    Declaration

    Swift

    func isAccess(in ks: AccessEffectSet) -> Bool
  • description Extension method

    Declaration

    Swift

    public var description: String { get }