class BinaryOperator

Declaration

class BinaryOperator : public Instruction { /* full declaration omitted */ };

Description

LLVM Value Representation This is a very important LLVM class. It is the base class of all values computed by a program that may be used as operands to other values. Value is the super class of other important classes such as Instruction and Function. All Values have a Type. Type is not a subclass of Value. Some values can have a name and they belong to some Module. Setting the name on the Value automatically updates the module's symbol table. Every value has a "use list" that keeps track of which other Values are using this Value. A Value can also have an arbitrary number of ValueHandle objects that watch it and listen to RAUW and Destroy events. See llvm/IR/ValueHandle.h for details.

Declared at: llvm/include/llvm/IR/InstrTypes.h:188

Inherits from: Instruction

Member Variables

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasMetadata
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 32
public static MaximumAlignment = 1ULL << MaxAlignmentExponent

Method Overview

  • private void AssertOK()
  • protected BinaryOperator(llvm::Instruction::BinaryOps iType, llvm::Value * S1, llvm::Value * S2, llvm::Type * Ty, const llvm::Twine & Name, llvm::Instruction * InsertBefore)
  • protected BinaryOperator(llvm::Instruction::BinaryOps iType, llvm::Value * S1, llvm::Value * S2, llvm::Type * Ty, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public static llvm::BinaryOperator * Create(llvm::Instruction::BinaryOps Op, llvm::Value * S1, llvm::Value * S2, const llvm::Twine & Name = llvm::Twine(), llvm::Instruction * InsertBefore = nullptr)
  • public static llvm::BinaryOperator * Create(llvm::Instruction::BinaryOps Op, llvm::Value * S1, llvm::Value * S2, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public static llvm::BinaryOperator * CreateExact(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name = "")
  • public static llvm::BinaryOperator * CreateExact(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name, llvm::BasicBlock * BB)
  • public static llvm::BinaryOperator * CreateExact(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name, llvm::Instruction * I)
  • public static llvm::BinaryOperator * CreateFAddFMF(llvm::Value * V1, llvm::Value * V2, llvm::Instruction * FMFSource, const llvm::Twine & Name = "")
  • public static llvm::BinaryOperator * CreateFDivFMF(llvm::Value * V1, llvm::Value * V2, llvm::Instruction * FMFSource, const llvm::Twine & Name = "")
  • public static llvm::BinaryOperator * CreateFMulFMF(llvm::Value * V1, llvm::Value * V2, llvm::Instruction * FMFSource, const llvm::Twine & Name = "")
  • public static llvm::BinaryOperator * CreateFRemFMF(llvm::Value * V1, llvm::Value * V2, llvm::Instruction * FMFSource, const llvm::Twine & Name = "")
  • public static llvm::BinaryOperator * CreateFSubFMF(llvm::Value * V1, llvm::Value * V2, llvm::Instruction * FMFSource, const llvm::Twine & Name = "")
  • public static llvm::BinaryOperator * CreateNSW(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name = "")
  • public static llvm::BinaryOperator * CreateNSW(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name, llvm::BasicBlock * BB)
  • public static llvm::BinaryOperator * CreateNSW(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name, llvm::Instruction * I)
  • public static llvm::BinaryOperator * CreateNSWNeg(llvm::Value * Op, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
  • public static llvm::BinaryOperator * CreateNSWNeg(llvm::Value * Op, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public static llvm::BinaryOperator * CreateNUW(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name, llvm::BasicBlock * BB)
  • public static llvm::BinaryOperator * CreateNUW(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name, llvm::Instruction * I)
  • public static llvm::BinaryOperator * CreateNUW(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, const llvm::Twine & Name = "")
  • public static llvm::BinaryOperator * CreateNUWNeg(llvm::Value * Op, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
  • public static llvm::BinaryOperator * CreateNUWNeg(llvm::Value * Op, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public static llvm::BinaryOperator * CreateNeg(llvm::Value * Op, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
  • public static llvm::BinaryOperator * CreateNeg(llvm::Value * Op, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public static llvm::BinaryOperator * CreateNot(llvm::Value * Op, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
  • public static llvm::BinaryOperator * CreateNot(llvm::Value * Op, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public static llvm::BinaryOperator * CreateWithCopiedFlags(llvm::Instruction::BinaryOps Opc, llvm::Value * V1, llvm::Value * V2, llvm::Instruction * CopyO, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
  • public static bool classof(const llvm::Instruction * I)
  • public static bool classof(const llvm::Value * V)
  • protected llvm::BinaryOperator * cloneImpl() const
  • public llvm::Instruction::BinaryOps getOpcode() const
  • public bool swapOperands()

Inherited from Instruction:

Inherited from User:

Inherited from Value:

Methods

void AssertOK()

Declared at: llvm/include/llvm/IR/InstrTypes.h:189

BinaryOperator(llvm::Instruction::BinaryOps iType,
               llvm::Value* S1,
               llvm::Value* S2,
               llvm::Type* Ty,
               const llvm::Twine& Name,
               llvm::Instruction* InsertBefore)

Declared at: llvm/include/llvm/IR/InstrTypes.h:192

Parameters

llvm::Instruction::BinaryOps iType
llvm::Value* S1
llvm::Value* S2
llvm::Type* Ty
const llvm::Twine& Name
llvm::Instruction* InsertBefore

BinaryOperator(llvm::Instruction::BinaryOps iType,
               llvm::Value* S1,
               llvm::Value* S2,
               llvm::Type* Ty,
               const llvm::Twine& Name,
               llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/InstrTypes.h:194

Parameters

llvm::Instruction::BinaryOps iType
llvm::Value* S1
llvm::Value* S2
llvm::Type* Ty
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

static llvm::BinaryOperator* Create(
    llvm::Instruction::BinaryOps Op,
    llvm::Value* S1,
    llvm::Value* S2,
    const llvm::Twine& Name = llvm::Twine(),
    llvm::Instruction* InsertBefore = nullptr)

Description

Construct a binary instruction, given the opcode and the two operands. Optionally (if InstBefore is specified) insert the instruction into a BasicBlock right before the specified instruction. The specified Instruction is allowed to be a dereferenced end iterator.

Declared at: llvm/include/llvm/IR/InstrTypes.h:215

Parameters

llvm::Instruction::BinaryOps Op
llvm::Value* S1
llvm::Value* S2
const llvm::Twine& Name = llvm::Twine()
llvm::Instruction* InsertBefore = nullptr

static llvm::BinaryOperator* Create(
    llvm::Instruction::BinaryOps Op,
    llvm::Value* S1,
    llvm::Value* S2,
    const llvm::Twine& Name,
    llvm::BasicBlock* InsertAtEnd)

Description

Construct a binary instruction, given the opcode and the two operands. Also automatically insert this instruction to the end of the BasicBlock specified.

Declared at: llvm/include/llvm/IR/InstrTypes.h:223

Parameters

llvm::Instruction::BinaryOps Op
llvm::Value* S1
llvm::Value* S2
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

static llvm::BinaryOperator* CreateExact(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name = "")

Declared at: llvm/include/llvm/IR/InstrTypes.h:321

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name = ""

static llvm::BinaryOperator* CreateExact(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name,
    llvm::BasicBlock* BB)

Declared at: llvm/include/llvm/IR/InstrTypes.h:327

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name
llvm::BasicBlock* BB

static llvm::BinaryOperator* CreateExact(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name,
    llvm::Instruction* I)

Declared at: llvm/include/llvm/IR/InstrTypes.h:333

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name
llvm::Instruction* I

static llvm::BinaryOperator* CreateFAddFMF(
    llvm::Value* V1,
    llvm::Value* V2,
    llvm::Instruction* FMFSource,
    const llvm::Twine& Name = "")

Declared at: llvm/include/llvm/IR/InstrTypes.h:257

Parameters

llvm::Value* V1
llvm::Value* V2
llvm::Instruction* FMFSource
const llvm::Twine& Name = ""

static llvm::BinaryOperator* CreateFDivFMF(
    llvm::Value* V1,
    llvm::Value* V2,
    llvm::Instruction* FMFSource,
    const llvm::Twine& Name = "")

Declared at: llvm/include/llvm/IR/InstrTypes.h:272

Parameters

llvm::Value* V1
llvm::Value* V2
llvm::Instruction* FMFSource
const llvm::Twine& Name = ""

static llvm::BinaryOperator* CreateFMulFMF(
    llvm::Value* V1,
    llvm::Value* V2,
    llvm::Instruction* FMFSource,
    const llvm::Twine& Name = "")

Declared at: llvm/include/llvm/IR/InstrTypes.h:267

Parameters

llvm::Value* V1
llvm::Value* V2
llvm::Instruction* FMFSource
const llvm::Twine& Name = ""

static llvm::BinaryOperator* CreateFRemFMF(
    llvm::Value* V1,
    llvm::Value* V2,
    llvm::Instruction* FMFSource,
    const llvm::Twine& Name = "")

Declared at: llvm/include/llvm/IR/InstrTypes.h:277

Parameters

llvm::Value* V1
llvm::Value* V2
llvm::Instruction* FMFSource
const llvm::Twine& Name = ""

static llvm::BinaryOperator* CreateFSubFMF(
    llvm::Value* V1,
    llvm::Value* V2,
    llvm::Instruction* FMFSource,
    const llvm::Twine& Name = "")

Declared at: llvm/include/llvm/IR/InstrTypes.h:262

Parameters

llvm::Value* V1
llvm::Value* V2
llvm::Instruction* FMFSource
const llvm::Twine& Name = ""

static llvm::BinaryOperator* CreateNSW(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name = "")

Declared at: llvm/include/llvm/IR/InstrTypes.h:283

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name = ""

static llvm::BinaryOperator* CreateNSW(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name,
    llvm::BasicBlock* BB)

Declared at: llvm/include/llvm/IR/InstrTypes.h:289

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name
llvm::BasicBlock* BB

static llvm::BinaryOperator* CreateNSW(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name,
    llvm::Instruction* I)

Declared at: llvm/include/llvm/IR/InstrTypes.h:295

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name
llvm::Instruction* I

static llvm::BinaryOperator* CreateNSWNeg(
    llvm::Value* Op,
    const llvm::Twine& Name = "",
    llvm::Instruction* InsertBefore = nullptr)

Declared at: llvm/include/llvm/IR/InstrTypes.h:379

Parameters

llvm::Value* Op
const llvm::Twine& Name = ""
llvm::Instruction* InsertBefore = nullptr

static llvm::BinaryOperator* CreateNSWNeg(
    llvm::Value* Op,
    const llvm::Twine& Name,
    llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/InstrTypes.h:381

Parameters

llvm::Value* Op
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

static llvm::BinaryOperator* CreateNUW(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name,
    llvm::BasicBlock* BB)

Declared at: llvm/include/llvm/IR/InstrTypes.h:308

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name
llvm::BasicBlock* BB

static llvm::BinaryOperator* CreateNUW(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name,
    llvm::Instruction* I)

Declared at: llvm/include/llvm/IR/InstrTypes.h:314

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name
llvm::Instruction* I

static llvm::BinaryOperator* CreateNUW(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    const llvm::Twine& Name = "")

Declared at: llvm/include/llvm/IR/InstrTypes.h:302

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
const llvm::Twine& Name = ""

static llvm::BinaryOperator* CreateNUWNeg(
    llvm::Value* Op,
    const llvm::Twine& Name = "",
    llvm::Instruction* InsertBefore = nullptr)

Declared at: llvm/include/llvm/IR/InstrTypes.h:383

Parameters

llvm::Value* Op
const llvm::Twine& Name = ""
llvm::Instruction* InsertBefore = nullptr

static llvm::BinaryOperator* CreateNUWNeg(
    llvm::Value* Op,
    const llvm::Twine& Name,
    llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/InstrTypes.h:385

Parameters

llvm::Value* Op
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

static llvm::BinaryOperator* CreateNeg(
    llvm::Value* Op,
    const llvm::Twine& Name = "",
    llvm::Instruction* InsertBefore = nullptr)

Description

Helper functions to construct and inspect unary operations (NEG and NOT) via binary operators SUB and XOR: Create the NEG and NOT instructions out of SUB and XOR instructions.

Declared at: llvm/include/llvm/IR/InstrTypes.h:375

Parameters

llvm::Value* Op
const llvm::Twine& Name = ""
llvm::Instruction* InsertBefore = nullptr

static llvm::BinaryOperator* CreateNeg(
    llvm::Value* Op,
    const llvm::Twine& Name,
    llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/InstrTypes.h:377

Parameters

llvm::Value* Op
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

static llvm::BinaryOperator* CreateNot(
    llvm::Value* Op,
    const llvm::Twine& Name = "",
    llvm::Instruction* InsertBefore = nullptr)

Declared at: llvm/include/llvm/IR/InstrTypes.h:387

Parameters

llvm::Value* Op
const llvm::Twine& Name = ""
llvm::Instruction* InsertBefore = nullptr

static llvm::BinaryOperator* CreateNot(
    llvm::Value* Op,
    const llvm::Twine& Name,
    llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/InstrTypes.h:389

Parameters

llvm::Value* Op
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

static llvm::BinaryOperator*
CreateWithCopiedFlags(
    llvm::Instruction::BinaryOps Opc,
    llvm::Value* V1,
    llvm::Value* V2,
    llvm::Instruction* CopyO,
    const llvm::Twine& Name = "",
    llvm::Instruction* InsertBefore = nullptr)

Declared at: llvm/include/llvm/IR/InstrTypes.h:249

Parameters

llvm::Instruction::BinaryOps Opc
llvm::Value* V1
llvm::Value* V2
llvm::Instruction* CopyO
const llvm::Twine& Name = ""
llvm::Instruction* InsertBefore = nullptr

static bool classof(const llvm::Instruction* I)

Declared at: llvm/include/llvm/IR/InstrTypes.h:404

Parameters

const llvm::Instruction* I

static bool classof(const llvm::Value* V)

Declared at: llvm/include/llvm/IR/InstrTypes.h:407

Parameters

const llvm::Value* V

llvm::BinaryOperator* cloneImpl() const

Declared at: llvm/include/llvm/IR/InstrTypes.h:200

llvm::Instruction::BinaryOps getOpcode() const

Declared at: llvm/include/llvm/IR/InstrTypes.h:392

bool swapOperands()

Description

Exchange the two operands to this instruction. This instruction is safe to use on any binary instruction and does not modify the semantics of the instruction. If the instruction cannot be reversed (ie, it's a Div), then return true.

Declared at: llvm/include/llvm/IR/InstrTypes.h:401