llvm::MachineIRBuilder::buildSub

Build and insert Res = G_SUB Op0, Op1

Synopsis

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

MachineInstrBuilder
buildSub(
    DstOp const& Dst,
    SrcOp const& Src0,
    SrcOp const& Src1,
    std::optional<unsigned int> Flags = std::nullopt);

Description

G_SUB sets Res to the difference of integer parameters Op0 and Op1, truncated to their width.

Return Value

a MachineInstrBuilder for the newly created instruction.

Parameters

NameDescription
DstDestination operand for the result.
Src0First source operand.
Src1Second source operand.
FlagsOptional instruction flags to attach.

Preconditions

  • setBasicBlock or setMI must have been called.
  • Res, Op0 and Op1 must be generic virtual registers with the same (scalar or vector) type).