|
LLVM
3.7.0
|
This class is the base class for the comparison instructions. More...
#include <InstrTypes.h>
Public Types | |
| enum | Predicate { FCMP_FALSE = 0, FCMP_OEQ = 1, FCMP_OGT = 2, FCMP_OGE = 3, FCMP_OLT = 4, FCMP_OLE = 5, FCMP_ONE = 6, FCMP_ORD = 7, FCMP_UNO = 8, FCMP_UEQ = 9, FCMP_UGT = 10, FCMP_UGE = 11, FCMP_ULT = 12, FCMP_ULE = 13, FCMP_UNE = 14, FCMP_TRUE = 15, FIRST_FCMP_PREDICATE = FCMP_FALSE, LAST_FCMP_PREDICATE = FCMP_TRUE, BAD_FCMP_PREDICATE = FCMP_TRUE + 1, ICMP_EQ = 32, ICMP_NE = 33, ICMP_UGT = 34, ICMP_UGE = 35, ICMP_ULT = 36, ICMP_ULE = 37, ICMP_SGT = 38, ICMP_SGE = 39, ICMP_SLT = 40, ICMP_SLE = 41, FIRST_ICMP_PREDICATE = ICMP_EQ, LAST_ICMP_PREDICATE = ICMP_SLE, BAD_ICMP_PREDICATE = ICMP_SLE + 1 } |
| This enumeration lists the possible predicates for CmpInst subclasses. More... | |
Public Types inherited from llvm::Instruction | |
| enum | OperationEquivalenceFlags { CompareIgnoringAlignment = 1<<0, CompareUsingScalarTypes = 1<<1 } |
| When checking for operation equivalence (using isSameOperationAs) it is sometimes useful to ignore certain attributes. More... | |
| enum | TermOps |
| enum | BinaryOps |
| enum | MemoryOps |
| enum | CastOps |
| enum | OtherOps |
Public Types inherited from llvm::User | |
| typedef Use * | op_iterator |
| typedef const Use * | const_op_iterator |
| typedef iterator_range < op_iterator > | op_range |
| typedef iterator_range < const_op_iterator > | const_op_range |
Public Types inherited from llvm::Value | |
| enum | ValueTy |
| Concrete subclass of this. More... | |
| typedef use_iterator_impl< Use > | use_iterator |
| typedef use_iterator_impl < const Use > | const_use_iterator |
| typedef user_iterator_impl< User > | user_iterator |
| typedef user_iterator_impl < const User > | const_user_iterator |
Public Member Functions | |
| void * | operator new (size_t s) |
| OtherOps | getOpcode () const |
| Get the opcode casted to the right type. More... | |
| Predicate | getPredicate () const |
| Return the predicate for this instruction. More... | |
| void | setPredicate (Predicate P) |
| Set the predicate for this instruction to the specified value. More... | |
| bool | isFPPredicate () const |
| bool | isIntPredicate () const |
| Predicate | getInversePredicate () const |
| For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc. More... | |
| Predicate | getSwappedPredicate () const |
| For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc. More... | |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
| Provide more efficient getOperand methods. More... | |
| void | swapOperands () |
| This is just a convenience that dispatches to the subclasses. More... | |
| bool | isCommutative () const |
| This is just a convenience that dispatches to the subclasses. More... | |
| bool | isEquality () const |
| This is just a convenience that dispatches to the subclasses. More... | |
| bool | isSigned () const |
| Determine if this instruction is using a signed comparison. More... | |
| bool | isUnsigned () const |
| Determine if this instruction is using an unsigned comparison. More... | |
| bool | isTrueWhenEqual () const |
| This is just a convenience. More... | |
| bool | isFalseWhenEqual () const |
| This is just a convenience. More... | |
Public Member Functions inherited from llvm::Instruction | |
| ~Instruction () override | |
| Instruction * | user_back () |
| user_back - Specialize the methods defined in Value, as we know that an instruction can only be used by other instructions. More... | |
| const Instruction * | user_back () const |
| const BasicBlock * | getParent () const |
| BasicBlock * | getParent () |
| const Module * | getModule () const |
| Return the module owning the function this instruction belongs to or nullptr it the function does not have a module. More... | |
| Module * | getModule () |
| void | removeFromParent () |
| removeFromParent - This method unlinks 'this' from the containing basic block, but does not delete it. More... | |
| iplist< Instruction >::iterator | eraseFromParent () |
| eraseFromParent - This method unlinks 'this' from the containing basic block and deletes it. More... | |
| void | insertBefore (Instruction *InsertPos) |
| Insert an unlinked instruction into a basic block immediately before the specified instruction. More... | |
| void | insertAfter (Instruction *InsertPos) |
| Insert an unlinked instruction into a basic block immediately after the specified instruction. More... | |
| void | moveBefore (Instruction *MovePos) |
| moveBefore - Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos. More... | |
| 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 |
| isLogicalShift - Return true if this is a logical shift left or a logical shift right. More... | |
| bool | isArithmeticShift () const |
| isArithmeticShift - Return true if this is an arithmetic shift right. More... | |
| bool | hasMetadata () const |
| hasMetadata() - Return true if this instruction has any metadata attached to it. More... | |
| bool | hasMetadataOtherThanDebugLoc () const |
| hasMetadataOtherThanDebugLoc - Return true if this instruction has metadata attached to it other than a debug location. More... | |
| MDNode * | getMetadata (unsigned KindID) const |
| getMetadata - Get the metadata of given kind attached to this Instruction. More... | |
| MDNode * | getMetadata (StringRef Kind) const |
| getMetadata - Get the metadata of given kind attached to this Instruction. More... | |
| void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| getAllMetadata - Get all metadata attached to this Instruction. More... | |
| void | getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| getAllMetadataOtherThanDebugLoc - This does the same thing as getAllMetadata, except that it filters out the debug location. More... | |
| void | getAAMetadata (AAMDNodes &N, bool Merge=false) const |
| getAAMetadata - Fills the AAMDNodes structure with AA metadata from this instruction. More... | |
| void | setMetadata (unsigned KindID, MDNode *Node) |
| setMetadata - Set the metadata of the specified kind to the specified node. More... | |
| void | setMetadata (StringRef Kind, MDNode *Node) |
| void | dropUnknownMetadata (ArrayRef< unsigned > KnownIDs) |
| Drop unknown metadata. More... | |
| void | dropUnknownMetadata () |
| void | dropUnknownMetadata (unsigned ID1) |
| void | dropUnknownMetadata (unsigned ID1, unsigned ID2) |
| void | setAAMetadata (const AAMDNodes &N) |
| setAAMetadata - Sets the metadata on this instruction from the AAMDNodes structure. More... | |
| void | setDebugLoc (DebugLoc Loc) |
| setDebugLoc - Set the debug location information for this instruction. More... | |
| const DebugLoc & | getDebugLoc () const |
| getDebugLoc - Return the debug location for this node as a DebugLoc. More... | |
| void | setHasUnsafeAlgebra (bool B) |
| Set or clear the unsafe-algebra flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoNaNs (bool B) |
| Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoInfs (bool B) |
| Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoSignedZeros (bool B) |
| Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasAllowReciprocal (bool B) |
| Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setFastMathFlags (FastMathFlags FMF) |
| Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags. More... | |
| void | copyFastMathFlags (FastMathFlags FMF) |
| Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags. More... | |
| 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 |
| Convenience function for getting all the fast-math flags, which must be an operator which supports these flags. More... | |
| void | copyFastMathFlags (const Instruction *I) |
| Copy I's fast-math flags. More... | |
| bool | isAssociative () const |
| isAssociative - Return true if the instruction is associative: More... | |
| bool | isCommutative () const |
| isCommutative - Return true if the instruction is commutative: More... | |
| bool | isIdempotent () const |
| isIdempotent - Return true if the instruction is idempotent: More... | |
| bool | isNilpotent () const |
| isNilpotent - Return true if the instruction is nilpotent: More... | |
| bool | mayWriteToMemory () const |
| mayWriteToMemory - Return true if this instruction may modify memory. More... | |
| bool | mayReadFromMemory () const |
| mayReadFromMemory - Return true if this instruction may read memory. More... | |
| bool | mayReadOrWriteMemory () const |
| mayReadOrWriteMemory - Return true if this instruction may read or write memory. More... | |
| bool | isAtomic () const |
| isAtomic - Return true if this instruction has an AtomicOrdering of unordered or higher. More... | |
| bool | mayThrow () const |
| mayThrow - Return true if this instruction may throw an exception. More... | |
| bool | mayReturn () const |
| mayReturn - Return true if this is a function that may return. More... | |
| bool | mayHaveSideEffects () const |
| mayHaveSideEffects - Return true if the instruction may have side effects. More... | |
| Instruction * | clone () const |
| clone() - Create a copy of 'this' instruction that is identical in all ways except the following: More... | |
| bool | isIdenticalTo (const Instruction *I) const |
| isIdenticalTo - Return true if the specified instruction is exactly identical to the current one. More... | |
| bool | isIdenticalToWhenDefined (const Instruction *I) const |
| isIdenticalToWhenDefined - This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which specify conditions under which the instruction's result is undefined. More... | |
| bool | isSameOperationAs (const Instruction *I, unsigned flags=0) const |
| This function determines if the specified instruction executes the same operation as the current one. More... | |
| bool | isUsedOutsideOfBlock (const BasicBlock *BB) const |
| isUsedOutsideOfBlock - Return true if there are any uses of this instruction in blocks other than the specified block. More... | |
Public Member Functions inherited from llvm::User | |
| ~User () override | |
| void | operator delete (void *Usr) |
| 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... | |
| Use * | getOperandList () |
| const Use * | getOperandList () const |
| Value * | getOperand (unsigned i) const |
| void | setOperand (unsigned i, Value *Val) |
| const Use & | getOperandUse (unsigned i) const |
| Use & | getOperandUse (unsigned i) |
| unsigned | getNumOperands () const |
| void | setGlobalVariableNumOperands (unsigned NumOps) |
| Set the number of operands on a GlobalVariable. More... | |
| void | setFunctionNumOperands (unsigned NumOps) |
| Set the number of operands on a Function. More... | |
| void | setNumHungOffUseOperands (unsigned NumOps) |
| Subclasses with hung off uses need to manage the operand count themselves. More... | |
| op_iterator | op_begin () |
| const_op_iterator | op_begin () const |
| op_iterator | op_end () |
| const_op_iterator | op_end () const |
| op_range | operands () |
| const_op_range | operands () const |
| value_op_iterator | value_op_begin () |
| value_op_iterator | value_op_end () |
| iterator_range< value_op_iterator > | operand_values () |
| void | dropAllReferences () |
| Drop all references to operands. More... | |
| void | replaceUsesOfWith (Value *From, Value *To) |
| Replace uses of one Value with another. More... | |
Public Member Functions inherited from llvm::Value | |
| virtual | ~Value () |
| void | dump () const |
| Support for debugging, callable in GDB: V->dump() More... | |
| Type * | getType () const |
| All values are typed, get the type of this value. More... | |
| LLVMContext & | getContext () const |
| All values hold a context through their type. More... | |
| bool | hasName () const |
| ValueName * | getValueName () const |
| void | setValueName (ValueName *VN) |
| StringRef | getName () const |
| Return a constant reference to the value's name. More... | |
| void | setName (const Twine &Name) |
| Change the name of the value. More... | |
| void | takeName (Value *V) |
| Transfer the name from V to this value. More... | |
| void | replaceAllUsesWith (Value *V) |
| Change all uses of this to point to a new Value. More... | |
| void | replaceUsesOutsideBlock (Value *V, BasicBlock *BB) |
| replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block. More... | |
| bool | use_empty () const |
| use_iterator | use_begin () |
| const_use_iterator | use_begin () const |
| use_iterator | use_end () |
| const_use_iterator | use_end () const |
| iterator_range< use_iterator > | uses () |
| iterator_range < const_use_iterator > | uses () const |
| bool | user_empty () const |
| user_iterator | user_begin () |
| const_user_iterator | user_begin () const |
| user_iterator | user_end () |
| const_user_iterator | user_end () const |
| User * | user_back () |
| const User * | user_back () const |
| iterator_range< user_iterator > | users () |
| iterator_range < const_user_iterator > | users () const |
| bool | hasOneUse () const |
| Return true if there is exactly one user of this value. More... | |
| bool | hasNUses (unsigned N) const |
| Return true if this Value has exactly N users. More... | |
| bool | hasNUsesOrMore (unsigned N) const |
| Return true if this value has N users or more. More... | |
| bool | isUsedInBasicBlock (const BasicBlock *BB) const |
| Check if this value is used in the specified basic block. More... | |
| unsigned | getNumUses () const |
| This method computes the number of uses of this Value. More... | |
| void | addUse (Use &U) |
| This method should only be used by the Use class. More... | |
| unsigned | getValueID () const |
| Return an ID for the concrete type of this object. More... | |
| unsigned | getRawSubclassOptionalData () const |
| Return the raw optional flags value contained in this value. More... | |
| void | clearSubclassOptionalData () |
| Clear the optional flags contained in this value. More... | |
| bool | hasSameSubclassOptionalData (const Value *V) const |
| Check the optional flags for equality. More... | |
| void | intersectOptionalDataWith (const Value *V) |
| Clear any optional flags not set in the given Value. More... | |
| bool | hasValueHandle () const |
| Return true if there is a value handle associated with this value. More... | |
| bool | isUsedByMetadata () const |
| Return true if there is metadata referencing this value. More... | |
| Value * | stripPointerCasts () |
| Strip off pointer casts, all-zero GEPs, and aliases. More... | |
| const Value * | stripPointerCasts () const |
| Value * | stripPointerCastsNoFollowAliases () |
| Strip off pointer casts and all-zero GEPs. More... | |
| const Value * | stripPointerCastsNoFollowAliases () const |
| Value * | stripInBoundsConstantOffsets () |
| Strip off pointer casts and all-constant inbounds GEPs. More... | |
| const Value * | stripInBoundsConstantOffsets () const |
| Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
| Accumulate offsets from stripInBoundsConstantOffsets(). More... | |
| const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
| Value * | stripInBoundsOffsets () |
| Strip off pointer casts and inbounds GEPs. More... | |
| const Value * | stripInBoundsOffsets () const |
| Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
| Translate PHI node to its predecessor from the given basic block. More... | |
| const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
| void | mutateType (Type *Ty) |
| Mutate the type of this Value to be of the specified type. More... | |
| template<class Compare > | |
| void | sortUseList (Compare Cmp) |
| Sort the use-list. More... | |
| void | reverseUseList () |
| Reverse the use-list. More... | |
| void | print (raw_ostream &O) const |
| Implement operator<< on Value. More... | |
| void | print (raw_ostream &O, ModuleSlotTracker &MST) const |
| void | printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const |
| Print the name of this Value out to the specified raw_ostream. More... | |
| void | printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const |
Public Member Functions inherited from llvm::ilist_node< Instruction > | |
| Instruction * | getPrevNode () |
| Get the previous node, or 0 for the list head. More... | |
| const Instruction * | getPrevNode () const |
| Get the previous node, or 0 for the list head. More... | |
| Instruction * | getNextNode () |
| Get the next node, or 0 for the list tail. More... | |
| const Instruction * | getNextNode () const |
| Get the next node, or 0 for the list tail. More... | |
Static Public Member Functions | |
| static CmpInst * | Create (OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const Twine &Name="", Instruction *InsertBefore=nullptr) |
| Construct a compare instruction, given the opcode, the predicate and the two operands. More... | |
| static CmpInst * | Create (OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const Twine &Name, BasicBlock *InsertAtEnd) |
| Construct a compare instruction, given the opcode, the predicate and the two operands. More... | |
| static bool | isFPPredicate (Predicate P) |
| static bool | isIntPredicate (Predicate P) |
| static Predicate | getInversePredicate (Predicate pred) |
| For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc. More... | |
| static Predicate | getSwappedPredicate (Predicate pred) |
| This is a static version that you can use without an instruction available. More... | |
| static bool | isUnsigned (unsigned short predicate) |
| Determine if the predicate is an unsigned operation. More... | |
| static bool | isSigned (unsigned short predicate) |
| Determine if the predicate is an signed operation. More... | |
| static bool | isOrdered (unsigned short predicate) |
| Determine if the predicate is an ordered operation. More... | |
| static bool | isUnordered (unsigned short predicate) |
| Determine if the predicate is an unordered operation. More... | |
| static bool | isTrueWhenEqual (unsigned short predicate) |
| Determine if the predicate is true when comparing a value with itself. More... | |
| static bool | isFalseWhenEqual (unsigned short predicate) |
| Determine if the predicate is false when comparing a value with itself. More... | |
| static bool | classof (const Instruction *I) |
| Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
| static bool | classof (const Value *V) |
| static Type * | makeCmpResultType (Type *opnd_type) |
| Create a result type for fcmp/icmp. More... | |
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) |
| isAssociative - Return true if the instruction is associative: More... | |
| static bool | isCommutative (unsigned op) |
| isCommutative - Return true if the instruction is commutative: More... | |
| static bool | isIdempotent (unsigned op) |
| isIdempotent - Return true if the instruction is idempotent: More... | |
| static bool | isNilpotent (unsigned op) |
| isNilpotent - Return true if the instruction is nilpotent: More... | |
| 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 | |
| CmpInst (Type *ty, Instruction::OtherOps op, unsigned short pred, Value *LHS, Value *RHS, const Twine &Name="", Instruction *InsertBefore=nullptr) | |
| CmpInst (Type *ty, Instruction::OtherOps op, unsigned short pred, Value *LHS, Value *RHS, const Twine &Name, BasicBlock *InsertAtEnd) | |
| void | anchor () 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=nullptr) | |
| Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd) | |
Protected Member Functions inherited from llvm::User | |
| void * | operator new (size_t Size) |
| Allocate a User with an operand pointer co-allocated. More... | |
| void * | operator new (size_t Size, unsigned Us) |
| Allocate a User with the operands co-allocated. More... | |
| User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps) | |
| void | allocHungoffUses (unsigned N, bool IsPhi=false) |
| Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User. More... | |
| void | growHungoffUses (unsigned N, bool IsPhi=false) |
| Grow the number of hung off uses. More... | |
| template<int Idx> | |
| Use & | Op () |
| template<int Idx> | |
| const Use & | Op () const |
Protected Member Functions inherited from llvm::Value | |
| 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 | |
Static Public Attributes inherited from llvm::Value | |
| static const unsigned | MaxAlignmentExponent = 29 |
| The maximum alignment for instructions. More... | |
| static const unsigned | MaximumAlignment = 1u << MaxAlignmentExponent |
Protected Types inherited from llvm::Value | |
| enum | : unsigned { NumUserOperandsBits = 29 } |
| The number of operands in the subclass. More... | |
Static Protected Member Functions inherited from llvm::User | |
| template<int Idx, typename U > | |
| static Use & | OpFrom (const U *that) |
Protected Attributes inherited from llvm::Value | |
| unsigned char | SubclassOptionalData: 7 |
| Hold subclass data that can be dropped. More... | |
| unsigned | NumUserOperands: NumUserOperandsBits |
| bool | IsUsedByMD: 1 |
| bool | HasName: 1 |
| bool | HasHungOffUses: 1 |
This class is the base class for the comparison instructions.
Abstract base class of comparison instructions.
Definition at line 679 of file InstrTypes.h.
This enumeration lists the possible predicates for CmpInst subclasses.
Values in the range 0-31 are reserved for FCmpInst, while values in the range 32-64 are reserved for ICmpInst. This is necessary to ensure the predicate values are not overlapping between the classes.
Definition at line 697 of file InstrTypes.h.
|
protected |
Definition at line 2969 of file Instructions.cpp.
References llvm::Value::setName(), and setPredicate().
|
protected |
Definition at line 2982 of file Instructions.cpp.
References llvm::Value::setName(), and setPredicate().
|
overrideprotectedvirtual |
Reimplemented from llvm::User.
Definition at line 2967 of file Instructions.cpp.
|
inlinestatic |
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 869 of file InstrTypes.h.
References llvm::Instruction::getOpcode().
Referenced by classof().
Definition at line 873 of file InstrTypes.h.
References classof().
|
static |
Construct a compare instruction, given the opcode, the predicate 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. Create a CmpInst
Definition at line 2996 of file Instructions.cpp.
Referenced by llvm::ConstantExpr::getAsInstruction(), SinkCmpExpression(), llvm::InstCombiner::visitICmpInst(), and llvm::InstCombiner::visitXor().
|
static |
Construct a compare instruction, given the opcode, the predicate and the two operands.
Also automatically insert this instruction to the end of the BasicBlock specified. Create a CmpInst
Definition at line 3017 of file Instructions.cpp.
| llvm::CmpInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
Provide more efficient getOperand methods.
|
inline |
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
Definition at line 783 of file InstrTypes.h.
References getPredicate().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::FoldBranchToCommonDest(), llvm::InstCombiner::FoldICmpCstShlCst(), llvm::InstCombiner::FoldICmpCstShrCst(), llvm::getICmpCode(), llvm::ConstantRange::makeSatisfyingICmpRegion(), SimplifyICmpInst(), llvm::InstCombiner::simplifyRangeCheck(), llvm::InstCombiner::visitBranchInst(), and llvm::InstCombiner::visitICmpInst().
|
static |
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
pred. Return the inverse of a given predicate Definition at line 3047 of file Instructions.cpp.
References FCMP_FALSE, FCMP_OEQ, FCMP_OGE, FCMP_OGT, FCMP_OLE, FCMP_OLT, FCMP_ONE, FCMP_ORD, FCMP_TRUE, FCMP_UEQ, FCMP_UGE, FCMP_UGT, FCMP_ULE, FCMP_ULT, FCMP_UNE, FCMP_UNO, ICMP_EQ, ICMP_NE, ICMP_SGE, ICMP_SGT, ICMP_SLE, ICMP_SLT, ICMP_UGE, ICMP_UGT, ICMP_ULE, ICMP_ULT, and llvm_unreachable.
|
inline |
Get the opcode casted to the right type.
Definition at line 755 of file InstrTypes.h.
References llvm::Instruction::getOpcode().
Referenced by SinkCmpExpression(), and llvm::InstCombiner::visitXor().
|
inline |
Return the predicate for this instruction.
Definition at line 760 of file InstrTypes.h.
References llvm::Instruction::getSubclassDataFromInstruction().
Referenced by llvm::ICmpInst::cloneImpl(), llvm::FCmpInst::cloneImpl(), computeKnownBitsFromTrueCondition(), decomposeBitTestICmp(), DemandedBitsLHSMask(), ExtractEquivalentCondition(), llvm::InstCombiner::FoldAndOfFCmps(), llvm::InstCombiner::FoldAndOfICmps(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), llvm::InstCombiner::FoldFCmp_IntToFP_Cst(), llvm::InstCombiner::FoldICmpCstShlCst(), llvm::InstCombiner::FoldICmpCstShrCst(), llvm::InstCombiner::FoldICmpDivCst(), llvm::InstCombiner::FoldICmpShrCst(), foldLogOpOfMaskedICmps(), llvm::InstCombiner::FoldOrOfFCmps(), llvm::InstCombiner::FoldOrOfICmps(), foldSelectICmpAndOr(), llvm::getICmpCode(), getInversePredicate(), getSwappedPredicate(), getValueFromFromCondition(), handleBranchExpect(), llvm::FCmpInst::isCommutative(), llvm::FCmpInst::isEquality(), isFalseWhenEqual(), isFPPredicate(), isIntPredicate(), isSameCompare(), isSigned(), isTrueWhenEqual(), isUnsigned(), llvm::matchSelectPattern(), needsLFTR(), llvm::FastISel::optimizeCmpPredicate(), OptimizeGlobalAddressOfMalloc(), ProcessUMulZExtIdiom(), llvm::InstCombiner::replacedSelectWithOperand(), reuseTableCompare(), llvm::InstCombiner::simplifyRangeCheck(), SinkCmpExpression(), TryToSimplifyUncondBranchWithICmpInIt(), llvm::Interpreter::visitFCmpInst(), llvm::InstCombiner::visitFCmpInst(), llvm::Interpreter::visitICmpInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithCastAndCast(), and llvm::InstCombiner::visitICmpInstWithInstAndIntCst().
|
inline |
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
Definition at line 799 of file InstrTypes.h.
References getPredicate().
Referenced by llvm::ConstantFoldCompareInstruction(), evaluateFCmpRelation(), evaluateICmpRelation(), ExtractEquivalentCondition(), llvm::InstCombiner::FoldAndOfFCmps(), llvm::InstCombiner::FoldGEPICmp(), llvm::InstCombiner::FoldICmpDivCst(), llvm::InstCombiner::FoldOrOfFCmps(), isSameCompare(), SimplifyFCmpInst(), SimplifyICmpInst(), llvm::ScalarEvolution::SimplifyICmpOperands(), llvm::InstCombiner::simplifyRangeCheck(), simplifyUnsignedRangeCheck(), llvm::FCmpInst::swapOperands(), ThreadCmpOverPHI(), ThreadCmpOverSelect(), llvm::InstCombiner::visitFCmpInst(), llvm::InstCombiner::visitICmpInst(), and llvm::InstCombiner::visitICmpInstWithInstAndIntCst().
|
static |
This is a static version that you can use without an instruction available.
Return the predicate as if the operands were swapped.
Definition at line 3169 of file Instructions.cpp.
References FCMP_FALSE, FCMP_OEQ, FCMP_OGE, FCMP_OGT, FCMP_OLE, FCMP_OLT, FCMP_ONE, FCMP_ORD, FCMP_TRUE, FCMP_UEQ, FCMP_UGE, FCMP_UGT, FCMP_ULE, FCMP_ULT, FCMP_UNE, FCMP_UNO, ICMP_EQ, ICMP_NE, ICMP_SGE, ICMP_SGT, ICMP_SLE, ICMP_SLT, ICMP_UGE, ICMP_UGT, ICMP_ULE, ICMP_ULT, llvm_unreachable, and pred.
| bool CmpInst::isCommutative | ( | ) | const |
This is just a convenience that dispatches to the subclasses.
Determine if this CmpInst is commutative.
Definition at line 3034 of file Instructions.cpp.
| bool CmpInst::isEquality | ( | ) | const |
This is just a convenience that dispatches to the subclasses.
Determine if this is an equals/not equals predicate.
Definition at line 3040 of file Instructions.cpp.
|
inline |
This is just a convenience.
Determine if this is false when both operands are the same.
Definition at line 844 of file InstrTypes.h.
References getPredicate().
Referenced by SimplifyFCmpInst(), and llvm::ScalarEvolution::SimplifyICmpOperands().
Definition at line 767 of file InstrTypes.h.
References FIRST_FCMP_PREDICATE, and LAST_FCMP_PREDICATE.
|
inline |
Definition at line 775 of file InstrTypes.h.
References getPredicate(), and isFPPredicate().
Referenced by isFPPredicate(), and SimplifyFCmpInst().
Definition at line 771 of file InstrTypes.h.
References FIRST_ICMP_PREDICATE, and LAST_ICMP_PREDICATE.
|
inline |
Definition at line 776 of file InstrTypes.h.
References getPredicate(), and isIntPredicate().
Referenced by llvm::ConstantFoldCompareInstruction(), isIntPredicate(), SimplifyCmpInst(), and SimplifyICmpInst().
Determine if the predicate is an ordered operation.
Definition at line 3215 of file Instructions.cpp.
References FCMP_OEQ, FCMP_OGE, FCMP_OGT, FCMP_OLE, FCMP_OLT, FCMP_ONE, and FCMP_ORD.
Referenced by SimplifyFCmpInst().
|
inline |
Determine if this instruction is using a signed comparison.
Definition at line 826 of file InstrTypes.h.
References getPredicate().
Referenced by llvm::ConstantFoldCompareInstruction(), llvm::InstCombiner::FoldAndOfICmps(), llvm::InstCombiner::FoldGEPICmp(), llvm::InstCombiner::FoldICmpDivCst(), llvm::InstCombiner::FoldICmpShrCst(), llvm::InstCombiner::FoldOrOfICmps(), isSignTest(), lookThroughCast(), llvm::PredicatesFoldable(), SimplifyICmpInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithCastAndCast(), and llvm::InstCombiner::visitICmpInstWithInstAndIntCst().
|
inline |
This is just a convenience.
Determine if this is true when both operands are the same.
Definition at line 838 of file InstrTypes.h.
References getPredicate().
Referenced by computePointerICmp(), llvm::ConstantFoldCompareInstruction(), llvm::InstCombiner::FoldGEPICmp(), SimplifyFCmpInst(), SimplifyICmpInst(), and llvm::ScalarEvolution::SimplifyICmpOperands().
Determine if the predicate is an unordered operation.
Definition at line 3224 of file Instructions.cpp.
References FCMP_UEQ, FCMP_UGE, FCMP_UGT, FCMP_ULE, FCMP_ULT, FCMP_UNE, and FCMP_UNO.
Referenced by llvm::ConstantFoldCompareInstruction(), and SimplifyFCmpInst().
|
inline |
Determine if this instruction is using an unsigned comparison.
Definition at line 832 of file InstrTypes.h.
References getPredicate().
Referenced by lookThroughCast(), SimplifyICmpInst(), simplifyUnsignedRangeCheck(), llvm::InstCombiner::visitICmpInst(), and llvm::InstCombiner::visitICmpInstWithInstAndIntCst().
Create a result type for fcmp/icmp.
Definition at line 878 of file InstrTypes.h.
References llvm::VectorType::get(), llvm::Type::getContext(), and llvm::Type::getInt1Ty().
Referenced by llvm::InstCombiner::FoldAndOfFCmps(), llvm::InstCombiner::FoldAndOfICmps(), llvm::InstCombiner::FoldOrOfFCmps(), GetCompareTy(), getFCmpValue(), and llvm::getICmpValue().
|
inline |
Definition at line 734 of file InstrTypes.h.
|
inline |
Set the predicate for this instruction to the specified value.
Definition at line 765 of file InstrTypes.h.
References llvm::Instruction::setInstructionSubclassData().
Referenced by CmpInst(), llvm::FoldBranchToCommonDest(), llvm::FCmpInst::swapOperands(), llvm::InstCombiner::visitBranchInst(), and llvm::InstCombiner::visitFCmpInst().
| void CmpInst::swapOperands | ( | ) |
This is just a convenience that dispatches to the subclasses.
Swap the operands and adjust predicate accordingly to retain the same comparison.
Definition at line 3027 of file Instructions.cpp.
1.8.6