llvm::MachineIRBuilder::buildGlobalValue

Build and insert Res = G_GLOBAL_VALUE GV

Synopsis

Declared in <llvm/CodeGen/GlobalISel/MachineIRBuilder.h>

MachineInstrBuilder
buildGlobalValue(
    DstOp const& Res,
    GlobalValue const* GV);

Description

G_GLOBAL_VALUE materializes the address of the specified global into Res.

Return Value

a MachineInstrBuilder for the newly created instruction.

Parameters

NameDescription
ResDestination operand for the result.
GVGlobal value whose address is materialized.

Preconditions

  • setBasicBlock or setMI must have been called.
  • Res must be a generic virtual register with pointer type in the same address space as GV.