LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
llvm::BinaryOperator Class Reference

#include <InstrTypes.h>

Inheritance diagram for llvm::BinaryOperator:
Inheritance graph
[legend]
Collaboration diagram for llvm::BinaryOperator:
Collaboration graph
[legend]

Public Member Functions

void * operator new (size_t s)
 
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Transparently provide more efficient getOperand methods. More...
 
 DEFINE_HELPERS (Add, NSW) DEFINE_HELPERS(Add
 
NUW DEFINE_HELPERS (Sub, NSW) DEFINE_HELPERS(Sub
 
NUW NUW DEFINE_HELPERS (Mul, NSW) DEFINE_HELPERS(Mul
 
NUW NUW NUW DEFINE_HELPERS (Shl, NSW) DEFINE_HELPERS(Shl
 
NUW NUW NUW NUW DEFINE_HELPERS (SDiv, Exact) DEFINE_HELPERS(UDiv
 
NUW NUW NUW NUW Exact DEFINE_HELPERS (AShr, Exact) DEFINE_HELPERS(LShr
 
BinaryOps getOpcode () const
 
bool swapOperands ()
 
void setHasNoUnsignedWrap (bool b=true)
 
void setHasNoSignedWrap (bool b=true)
 
void setIsExact (bool b=true)
 
bool hasNoUnsignedWrap () const
 hasNoUnsignedWrap - Determine whether the no unsigned wrap flag is set. More...
 
bool hasNoSignedWrap () const
 hasNoSignedWrap - Determine whether the no signed wrap flag is set. More...
 
bool isExact () const
 isExact - Determine whether the exact flag is set. More...
 
- Public Member Functions inherited from llvm::Instruction
 ~Instruction ()
 
Instructionuse_back ()
 
const Instructionuse_back () const
 
const BasicBlockgetParent () const
 
BasicBlockgetParent ()
 
void removeFromParent ()
 
void eraseFromParent ()
 
void insertBefore (Instruction *InsertPos)
 
void insertAfter (Instruction *InsertPos)
 
void moveBefore (Instruction *MovePos)
 
unsigned getOpcode () const
 getOpcode() returns a member of one of the enums like Instruction::Add. More...
 
const char * getOpcodeName () const
 
bool isTerminator () const
 
bool isBinaryOp () const
 
bool isShift ()
 
bool isCast () const
 
bool isLogicalShift () const
 
bool isArithmeticShift () const
 isArithmeticShift - Return true if this is an arithmetic shift right. More...
 
bool hasMetadata () const
 
bool hasMetadataOtherThanDebugLoc () const
 
MDNodegetMetadata (unsigned KindID) const
 
MDNodegetMetadata (StringRef Kind) const
 
void getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const
 
void getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode * > > &MDs) const
 
void setMetadata (unsigned KindID, MDNode *Node)
 
void setMetadata (StringRef Kind, MDNode *Node)
 
void setDebugLoc (const DebugLoc &Loc)
 setDebugLoc - Set the debug location information for this instruction. More...
 
const DebugLocgetDebugLoc () const
 getDebugLoc - Return the debug location for this node as a DebugLoc. More...
 
void setHasUnsafeAlgebra (bool B)
 
void setHasNoNaNs (bool B)
 
void setHasNoInfs (bool B)
 
void setHasNoSignedZeros (bool B)
 
void setHasAllowReciprocal (bool B)
 
void setFastMathFlags (FastMathFlags FMF)
 
bool hasUnsafeAlgebra () const
 Determine whether the unsafe-algebra flag is set. More...
 
bool hasNoNaNs () const
 Determine whether the no-NaNs flag is set. More...
 
bool hasNoInfs () const
 Determine whether the no-infs flag is set. More...
 
bool hasNoSignedZeros () const
 Determine whether the no-signed-zeros flag is set. More...
 
bool hasAllowReciprocal () const
 Determine whether the allow-reciprocal flag is set. More...
 
FastMathFlags getFastMathFlags () const
 
void copyFastMathFlags (const Instruction *I)
 Copy I's fast-math flags. More...
 
bool isAssociative () const
 
bool isCommutative () const
 
bool isIdempotent () const
 
bool isNilpotent () const
 
bool mayWriteToMemory () const
 
bool mayReadFromMemory () const
 
bool mayReadOrWriteMemory () const
 
bool mayThrow () const
 
bool mayReturn () const
 
bool mayHaveSideEffects () const
 
Instructionclone () const
 
bool isIdenticalTo (const Instruction *I) const
 
bool isIdenticalToWhenDefined (const Instruction *I) const
 
bool isSameOperationAs (const Instruction *I, unsigned flags=0) const
 Determine if one instruction is the same operation as another. More...
 
bool isUsedOutsideOfBlock (const BasicBlock *BB) const
 
- Public Member Functions inherited from llvm::User
 ~User ()
 
void operator delete (void *Usr)
 operator delete - free memory allocated for User and Use objects More...
 
void operator delete (void *, unsigned)
 placement delete - required by std, but never called. More...
 
void operator delete (void *, unsigned, bool)
 placement delete - required by std, but never called. More...
 
ValuegetOperand (unsigned i) const
 
void setOperand (unsigned i, Value *Val)
 
const UsegetOperandUse (unsigned i) const
 
UsegetOperandUse (unsigned i)
 
unsigned getNumOperands () const
 
op_iterator op_begin ()
 
const_op_iterator op_begin () const
 
op_iterator op_end ()
 
const_op_iterator op_end () const
 
value_op_iterator value_op_begin ()
 
value_op_iterator value_op_end ()
 
void dropAllReferences ()
 
void replaceUsesOfWith (Value *From, Value *To)
 
- Public Member Functions inherited from llvm::Value
virtual ~Value ()
 
void dump () const
 dump - Support for debugging, callable in GDB: V->dump() More...
 
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
 
TypegetType () const
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 
void setName (const Twine &Name)
 
void takeName (Value *V)
 
void replaceAllUsesWith (Value *V)
 
bool use_empty () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
Useruse_back ()
 
const Useruse_back () const
 
bool hasOneUse () const
 
bool hasNUses (unsigned N) const
 
bool hasNUsesOrMore (unsigned N) const
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 
unsigned getNumUses () const
 
void addUse (Use &U)
 
unsigned getValueID () const
 
unsigned getRawSubclassOptionalData () const
 
void clearSubclassOptionalData ()
 
bool hasSameSubclassOptionalData (const Value *V) const
 
void intersectOptionalDataWith (const Value *V)
 
bool hasValueHandle () const
 
ValuestripPointerCasts ()
 Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsOffsets () const
 
bool isDereferenceablePointer () const
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 
- Public Member Functions inherited from llvm::ilist_node< Instruction >
InstructiongetPrevNode ()
 Get the previous node, or 0 for the list head. More...
 
const InstructiongetPrevNode () const
 Get the previous node, or 0 for the list head. More...
 
InstructiongetNextNode ()
 Get the next node, or 0 for the list tail. More...
 
const InstructiongetNextNode () const
 Get the next node, or 0 for the list tail. More...
 

Static Public Member Functions

static BinaryOperatorCreate (BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), Instruction *InsertBefore=0)
 
static BinaryOperatorCreate (BinaryOps Op, Value *S1, Value *S2, const Twine &Name, BasicBlock *InsertAtEnd)
 
static BinaryOperatorCreateNSW (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
 
static BinaryOperatorCreateNSW (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, BasicBlock *BB)
 
static BinaryOperatorCreateNSW (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, Instruction *I)
 
static BinaryOperatorCreateNUW (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
 
static BinaryOperatorCreateNUW (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, BasicBlock *BB)
 
static BinaryOperatorCreateNUW (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, Instruction *I)
 
static BinaryOperatorCreateExact (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
 
static BinaryOperatorCreateExact (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, BasicBlock *BB)
 
static BinaryOperatorCreateExact (BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, Instruction *I)
 
NUW NUW NUW NUW Exact static
Exact BinaryOperator
CreateNeg (Value *Op, const Twine &Name="", Instruction *InsertBefore=0)
 
static BinaryOperatorCreateNeg (Value *Op, const Twine &Name, BasicBlock *InsertAtEnd)
 
static BinaryOperatorCreateNSWNeg (Value *Op, const Twine &Name="", Instruction *InsertBefore=0)
 
static BinaryOperatorCreateNSWNeg (Value *Op, const Twine &Name, BasicBlock *InsertAtEnd)
 
static BinaryOperatorCreateNUWNeg (Value *Op, const Twine &Name="", Instruction *InsertBefore=0)
 
static BinaryOperatorCreateNUWNeg (Value *Op, const Twine &Name, BasicBlock *InsertAtEnd)
 
static BinaryOperatorCreateFNeg (Value *Op, const Twine &Name="", Instruction *InsertBefore=0)
 
static BinaryOperatorCreateFNeg (Value *Op, const Twine &Name, BasicBlock *InsertAtEnd)
 
static BinaryOperatorCreateNot (Value *Op, const Twine &Name="", Instruction *InsertBefore=0)
 
static BinaryOperatorCreateNot (Value *Op, const Twine &Name, BasicBlock *InsertAtEnd)
 
static bool isNeg (const Value *V)
 
static bool isFNeg (const Value *V, bool IgnoreZeroSign=false)
 
static bool isNot (const Value *V)
 
static const ValuegetNegArgument (const Value *BinOp)
 
static ValuegetNegArgument (Value *BinOp)
 
static const ValuegetFNegArgument (const Value *BinOp)
 
static ValuegetFNegArgument (Value *BinOp)
 
static const ValuegetNotArgument (const Value *BinOp)
 
static ValuegetNotArgument (Value *BinOp)
 
static bool classof (const Instruction *I)
 
static bool classof (const Value *V)
 
- Static Public Member Functions inherited from llvm::Instruction
static const char * getOpcodeName (unsigned OpCode)
 
static bool isTerminator (unsigned OpCode)
 
static bool isBinaryOp (unsigned Opcode)
 
static bool isShift (unsigned Opcode)
 Determine if the Opcode is one of the shift instructions. More...
 
static bool isCast (unsigned OpCode)
 Determine if the OpCode is one of the CastInst instructions. More...
 
static bool isAssociative (unsigned op)
 
static bool isCommutative (unsigned op)
 
static bool isIdempotent (unsigned op)
 
static bool isNilpotent (unsigned op)
 
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
- Static Public Member Functions inherited from llvm::User
static bool classof (const Value *V)
 

Protected Member Functions

void init (BinaryOps iType)
 
 BinaryOperator (BinaryOps iType, Value *S1, Value *S2, Type *Ty, const Twine &Name, Instruction *InsertBefore)
 
 BinaryOperator (BinaryOps iType, Value *S1, Value *S2, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
 
virtual BinaryOperatorclone_impl () const LLVM_OVERRIDE
 
- Protected Member Functions inherited from llvm::Instruction
void setInstructionSubclassData (unsigned short D)
 
unsigned getSubclassDataFromInstruction () const
 
 Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=0)
 
 Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
 
- Protected Member Functions inherited from llvm::User
void * operator new (size_t s, unsigned Us)
 
 User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
 
UseallocHungoffUses (unsigned) const
 
void dropHungoffUses ()
 
template<int Idx>
UseOp ()
 
template<int Idx>
const UseOp () const
 
- Protected Member Functions inherited from llvm::Value
virtual void printCustom (raw_ostream &O) const
 
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 
- Protected Member Functions inherited from llvm::ilist_node< Instruction >
 ilist_node ()
 

Additional Inherited Members

- Public Types inherited from llvm::Instruction
enum  OperationEquivalenceFlags { CompareIgnoringAlignment = 1<<0, CompareUsingScalarTypes = 1<<1 }
 
enum  TermOps
 
enum  BinaryOps
 
enum  MemoryOps
 
enum  CastOps
 
enum  OtherOps
 
- Public Types inherited from llvm::User
typedef Useop_iterator
 
typedef const Useconst_op_iterator
 
- Public Types inherited from llvm::Value
enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, BlockAddressVal, ConstantExprVal,
  ConstantAggregateZeroVal, ConstantDataArrayVal, ConstantDataVectorVal, ConstantIntVal,
  ConstantFPVal, ConstantArrayVal, ConstantStructVal, ConstantVectorVal,
  ConstantPointerNullVal, MDNodeVal, MDStringVal, InlineAsmVal,
  PseudoSourceValueVal, FixedStackPseudoSourceValueVal, InstructionVal, ConstantFirstVal = FunctionVal,
  ConstantLastVal = ConstantPointerNullVal
}
 
typedef value_use_iterator< Useruse_iterator
 
typedef value_use_iterator
< const User
const_use_iterator
 
- Static Public Attributes inherited from llvm::Value
static const unsigned MaximumAlignment = 1u << 29
 
- Static Protected Member Functions inherited from llvm::User
template<int Idx, typename U >
static UseOpFrom (const U *that)
 
- Protected Attributes inherited from llvm::User
UseOperandList
 
unsigned NumOperands
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 

Detailed Description

Definition at line 138 of file InstrTypes.h.

Constructor & Destructor Documentation

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

Definition at line 1732 of file Instructions.cpp.

References init(), and llvm::Value::setName().

Referenced by Create(), CreateFNeg(), CreateNeg(), and CreateNot().

BinaryOperator::BinaryOperator ( BinaryOps  iType,
Value S1,
Value S2,
Type Ty,
const Twine Name,
BasicBlock InsertAtEnd 
)
protected

Definition at line 1745 of file Instructions.cpp.

References init(), and llvm::Value::setName().

Member Function Documentation

static bool llvm::BinaryOperator::classof ( const Instruction I)
inlinestatic

Definition at line 362 of file InstrTypes.h.

References llvm::Instruction::isBinaryOp().

static bool llvm::BinaryOperator::classof ( const Value V)
inlinestatic

Definition at line 365 of file InstrTypes.h.

BinaryOperator * BinaryOperator::clone_impl ( ) const
protectedvirtual

Implements llvm::Instruction.

Definition at line 3515 of file Instructions.cpp.

References Create(), and getOpcode().

BinaryOperator * BinaryOperator::Create ( BinaryOps  Op,
Value S1,
Value S2,
const Twine Name = Twine(),
Instruction InsertBefore = 0 
)
static
BinaryOperator * BinaryOperator::Create ( BinaryOps  Op,
Value S1,
Value S2,
const Twine Name,
BasicBlock InsertAtEnd 
)
static

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

Definition at line 1842 of file Instructions.cpp.

References Create(), llvm::BasicBlock::getInstList(), and llvm::iplist< NodeTy, Traits >::push_back().

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

Definition at line 232 of file InstrTypes.h.

References setIsExact().

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

Definition at line 238 of file InstrTypes.h.

References setIsExact().

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

Definition at line 244 of file InstrTypes.h.

References setIsExact().

BinaryOperator * BinaryOperator::CreateFNeg ( Value Op,
const Twine Name = "",
Instruction InsertBefore = 0 
)
static
BinaryOperator * BinaryOperator::CreateFNeg ( Value Op,
const Twine Name,
BasicBlock InsertAtEnd 
)
static
BinaryOperator * BinaryOperator::CreateNeg ( Value Op,
const Twine Name = "",
Instruction InsertBefore = 0 
)
static

Helper functions to construct and inspect unary operations (NEG and NOT) via binary operators SUB and XOR:

CreateNeg, CreateNot - Create the NEG and NOT instructions out of SUB and XOR instructions.

Definition at line 1850 of file Instructions.cpp.

References BinaryOperator(), llvm::Value::getType(), and llvm::ConstantFP::getZeroValueForNegation().

Referenced by llvm::NoFolder::CreateNeg(), llvm::IRBuilder< true, TargetFolder >::CreateNeg(), NegateValue(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitSDiv(), and llvm::InstCombiner::visitSub().

BinaryOperator * BinaryOperator::CreateNeg ( Value Op,
const Twine Name,
BasicBlock InsertAtEnd 
)
static
BinaryOperator * BinaryOperator::CreateNot ( Value Op,
const Twine Name = "",
Instruction InsertBefore = 0 
)
static
BinaryOperator * BinaryOperator::CreateNot ( Value Op,
const Twine Name,
BasicBlock InsertAtEnd 
)
static
static BinaryOperator* llvm::BinaryOperator::CreateNSW ( BinaryOps  Opc,
Value V1,
Value V2,
const Twine Name = "" 
)
inlinestatic

Definition at line 194 of file InstrTypes.h.

References setHasNoSignedWrap().

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

Definition at line 200 of file InstrTypes.h.

References setHasNoSignedWrap().

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

Definition at line 206 of file InstrTypes.h.

References setHasNoSignedWrap().

BinaryOperator * BinaryOperator::CreateNSWNeg ( Value Op,
const Twine Name = "",
Instruction InsertBefore = 0 
)
static
BinaryOperator * BinaryOperator::CreateNSWNeg ( Value Op,
const Twine Name,
BasicBlock InsertAtEnd 
)
static
static BinaryOperator* llvm::BinaryOperator::CreateNUW ( BinaryOps  Opc,
Value V1,
Value V2,
const Twine Name = "" 
)
inlinestatic

Definition at line 213 of file InstrTypes.h.

References setHasNoUnsignedWrap().

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

Definition at line 219 of file InstrTypes.h.

References setHasNoUnsignedWrap().

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

Definition at line 225 of file InstrTypes.h.

References setHasNoUnsignedWrap().

BinaryOperator * BinaryOperator::CreateNUWNeg ( Value Op,
const Twine Name = "",
Instruction InsertBefore = 0 
)
static
BinaryOperator * BinaryOperator::CreateNUWNeg ( Value Op,
const Twine Name,
BasicBlock InsertAtEnd 
)
static
llvm::BinaryOperator::DECLARE_TRANSPARENT_OPERAND_ACCESSORS ( Value  )

Transparently provide more efficient getOperand methods.

llvm::BinaryOperator::DEFINE_HELPERS ( Add  ,
NSW   
)
NUW llvm::BinaryOperator::DEFINE_HELPERS ( Sub  ,
NSW   
)
NUW NUW llvm::BinaryOperator::DEFINE_HELPERS ( Mul  ,
NSW   
)
NUW NUW NUW llvm::BinaryOperator::DEFINE_HELPERS ( Shl  ,
NSW   
)
NUW NUW NUW NUW llvm::BinaryOperator::DEFINE_HELPERS ( SDiv  ,
Exact   
)
NUW NUW NUW NUW Exact llvm::BinaryOperator::DEFINE_HELPERS ( AShr  ,
Exact   
)
const Value * BinaryOperator::getFNegArgument ( const Value BinOp)
static

Definition at line 1965 of file Instructions.cpp.

Value * BinaryOperator::getFNegArgument ( Value BinOp)
static

Definition at line 1961 of file Instructions.cpp.

References llvm::User::getOperand().

const Value * BinaryOperator::getNegArgument ( const Value BinOp)
static

getNegArgument, getNotArgument - Helper functions to extract the unary argument of a NEG, FNEG or NOT operation implemented via Sub, FSub, or Xor.

Definition at line 1957 of file Instructions.cpp.

Value * BinaryOperator::getNegArgument ( Value BinOp)
static

Definition at line 1953 of file Instructions.cpp.

References llvm::User::getOperand().

const Value * BinaryOperator::getNotArgument ( const Value BinOp)
static
Value * BinaryOperator::getNotArgument ( Value BinOp)
static

Definition at line 1969 of file Instructions.cpp.

References llvm::User::getOperand(), isConstantAllOnes(), and isNot().

BinaryOps llvm::BinaryOperator::getOpcode ( ) const
inline
bool BinaryOperator::hasNoSignedWrap ( ) const
bool BinaryOperator::hasNoUnsignedWrap ( ) const
void BinaryOperator::init ( BinaryOps  iType)
protected
bool BinaryOperator::isExact ( ) const
bool BinaryOperator::isFNeg ( const Value V,
bool  IgnoreZeroSign = false 
)
static
bool BinaryOperator::isNeg ( const Value V)
static

isNeg, isFNeg, isNot - Check if the given Value is a NEG, FNeg, or NOT instruction.

Definition at line 1926 of file Instructions.cpp.

Referenced by llvm::getComplexity(), LinearizeExprTree(), NegateValue(), and ShouldBreakUpSubtract().

bool BinaryOperator::isNot ( const Value V)
static
void* llvm::BinaryOperator::operator new ( size_t  s)
inline

Definition at line 149 of file InstrTypes.h.

void BinaryOperator::setHasNoSignedWrap ( bool  b = true)
void BinaryOperator::setHasNoUnsignedWrap ( bool  b = true)
void BinaryOperator::setIsExact ( bool  b = true)

setIsExact - Set or clear the exact flag on this instruction, which must be an operator which supports this flag. See LangRef.html for the meaning of this flag.

Definition at line 2005 of file Instructions.cpp.

Referenced by CreateExact(), llvm::InstCombiner::FoldSelectIntoOp(), llvm::InstCombiner::FoldShiftByConstant(), foldUDivPow2Cst(), foldUDivShl(), llvm::ConstantExpr::getAsInstruction(), GetShiftedValue(), llvm::InstCombiner::visitAShr(), and llvm::InstCombiner::visitLShr().

bool BinaryOperator::swapOperands ( )

swapOperands - 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.

Definition at line 1990 of file Instructions.cpp.

References llvm::Instruction::isCommutative(), and llvm::swap().

Referenced by llvm::InstCombiner::visitXor().


The documentation for this class was generated from the following files: