class ICmpInst
Declaration
class ICmpInst : public CmpInst { /* full declaration omitted */ };
Description
This instruction compares its operands according to the predicate given to the constructor. It only operates on integers or pointers. The operands must be identical types. Represent an integer comparison operator.
Declared at: llvm/include/llvm/IR/Instructions.h:1186
Inherits from: CmpInst
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()
- public ICmpInst(llvm::Instruction * InsertBefore, llvm::CmpInst::Predicate pred, llvm::Value * LHS, llvm::Value * RHS, const llvm::Twine & NameStr = "")
- public ICmpInst(llvm::BasicBlock & InsertAtEnd, llvm::CmpInst::Predicate pred, llvm::Value * LHS, llvm::Value * RHS, const llvm::Twine & NameStr = "")
- public ICmpInst(llvm::CmpInst::Predicate pred, llvm::Value * LHS, llvm::Value * RHS, const llvm::Twine & NameStr = "")
- public static bool classof(const llvm::Value * V)
- public static bool classof(const llvm::Instruction * I)
- protected llvm::ICmpInst * cloneImpl() const
- public static bool compare(const llvm::APInt & LHS, const llvm::APInt & RHS, ICmpInst::Predicate Pred)
- public static llvm::CmpInst::Predicate getSignedPredicate(llvm::CmpInst::Predicate pred)
- public llvm::CmpInst::Predicate getSignedPredicate() const
- public llvm::CmpInst::Predicate getUnsignedPredicate() const
- public static llvm::CmpInst::Predicate getUnsignedPredicate(llvm::CmpInst::Predicate pred)
- public bool isCommutative() const
- public static bool isEquality(llvm::CmpInst::Predicate P)
- public bool isEquality() const
- public static bool isGE(llvm::CmpInst::Predicate P)
- public static bool isGT(llvm::CmpInst::Predicate P)
- public static bool isLE(llvm::CmpInst::Predicate P)
- public static bool isLT(llvm::CmpInst::Predicate P)
- public bool isRelational() const
- public static bool isRelational(llvm::CmpInst::Predicate P)
- public static iota_range<llvm::CmpInst::Predicate> predicates()
- public void swapOperands()
Inherited from CmpInst:
- public Create
- public Create
- public FCmpPredicates
- public ICmpPredicates
- public classof
- public classof
- public getFlippedSignednessPredicate
- public getFlippedSignednessPredicate
- public getFlippedStrictnessPredicate
- public getFlippedStrictnessPredicate
- public getInversePredicate
- public getInversePredicate
- public getNonStrictPredicate
- public getNonStrictPredicate
- public getOpcode
- public getPredicate
- public getPredicateName
- public getSignedPredicate
- public getSignedPredicate
- public getStrictPredicate
- public getStrictPredicate
- public getSwappedPredicate
- public getSwappedPredicate
- public getUnsignedPredicate
- public getUnsignedPredicate
- public isCommutative
- public isEquality
- public isEquality
- public isFPPredicate
- public isFPPredicate
- public isFalseWhenEqual
- public isFalseWhenEqual
- public isImpliedFalseByMatchingCmp
- public isImpliedTrueByMatchingCmp
- public isIntPredicate
- public isIntPredicate
- public isNonStrictPredicate
- public isNonStrictPredicate
- public isOrdered
- public isRelational
- public isRelational
- public isSigned
- public isSigned
- public isStrictPredicate
- public isStrictPredicate
- public isTrueWhenEqual
- public isTrueWhenEqual
- public isUnordered
- public isUnsigned
- public isUnsigned
- public makeCmpResultType
- public setPredicate
- public swapOperands
Inherited from Instruction:
- public addAnnotationMetadata
- public andIRFlags
- public applyMergedLocation
- public classof
- public clone
- public comesBefore
- public copyFastMathFlags
- public copyFastMathFlags
- public copyIRFlags
- public copyMetadata
- public dropLocation
- public dropPoisonGeneratingFlags
- public dropUndefImplyingAttrsAndUnknownMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public eraseFromParent
- public extractProfMetadata
- public extractProfTotalWeight
- public getAAMetadata
- public getAllMetadata
- public getAllMetadataOtherThanDebugLoc
- public getDebugLoc
- public getFastMathFlags
- public getFunction
- public getFunction
- public getMetadata
- public getMetadata
- public getModule
- public getModule
- public getNextNonDebugInstruction
- public getNextNonDebugInstruction
- public getNumSuccessors
- public getOpcode
- public getOpcodeName
- public getOpcodeName
- public getParent
- public getParent
- public getPrevNonDebugInstruction
- public getPrevNonDebugInstruction
- protected getSubclassData
- public getSuccessor
- public hasAllowContract
- public hasAllowReassoc
- public hasAllowReciprocal
- public hasApproxFunc
- public hasAtomicLoad
- public hasAtomicStore
- public hasMetadata
- public hasMetadata
- public hasMetadata
- public hasMetadataOtherThanDebugLoc
- public hasNoInfs
- public hasNoNaNs
- public hasNoSignedWrap
- public hasNoSignedZeros
- public hasNoUnsignedWrap
- public hasPoisonGeneratingFlags
- public insertAfter
- public insertBefore
- public isArithmeticShift
- public isAssociative
- public isAssociative
- public isAtomic
- public isBinaryOp
- public isBinaryOp
- public isBitwiseLogicOp
- public isBitwiseLogicOp
- public isCast
- public isCast
- public isCommutative
- public isCommutative
- public isDebugOrPseudoInst
- public isEHPad
- public isExact
- public isExceptionalTerminator
- public isExceptionalTerminator
- public isFast
- public isFenceLike
- public isFuncletPad
- public isFuncletPad
- public isIdempotent
- public isIdempotent
- public isIdenticalTo
- public isIdenticalToWhenDefined
- public isIntDivRem
- public isIntDivRem
- public isLaunderOrStripInvariantGroup
- public isLifetimeStartOrEnd
- public isLogicalShift
- public isNilpotent
- public isNilpotent
- public isOnlyUserOfAnyOperand
- public isSafeToRemove
- public isSameOperationAs
- public isShift
- public isShift
- public isTerminator
- public isTerminator
- public isUnaryOp
- public isUnaryOp
- public isUsedOutsideOfBlock
- public isVolatile
- public mayHaveSideEffects
- public mayReadFromMemory
- public mayReadOrWriteMemory
- public mayThrow
- public mayWriteToMemory
- public moveAfter
- public moveBefore
- public moveBefore
- public removeFromParent
- public replaceSuccessorWith
- public setAAMetadata
- public setDebugLoc
- public setFast
- public setFastMathFlags
- public setHasAllowContract
- public setHasAllowReassoc
- public setHasAllowReciprocal
- public setHasApproxFunc
- public setHasNoInfs
- public setHasNoNaNs
- public setHasNoSignedWrap
- public setHasNoSignedZeros
- public setHasNoUnsignedWrap
- public setIsExact
- public setMetadata
- public setMetadata
- protected setSubclassData
- public setSuccessor
- public swapProfMetadata
- public updateLocationAfterHoist
- public user_back
- public user_back
- public willReturn
Inherited from User:
- protected Op
- protected Op
- protected OpFrom
- protected allocHungoffUses
- public classof
- public dropAllReferences
- public getDescriptor
- public getDescriptor
- public getNumOperands
- public getOperand
- public getOperandList
- public getOperandList
- public getOperandUse
- public getOperandUse
- protected growHungoffUses
- public isDroppable
- public op_begin
- public op_begin
- public op_end
- public op_end
- public operand_values
- public operand_values
- public operands
- public operands
- public replaceUsesOfWith
- public setGlobalVariableNumOperands
- public setNumHungOffUseOperands
- public setOperand
- public value_op_begin
- public value_op_begin
- public value_op_end
- public value_op_end
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- protected addMetadata
- protected addMetadata
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public canBeFreed
- protected clearMetadata
- public clearSubclassOptionalData
- public deleteValue
- public dropDroppableUse
- public dropDroppableUses
- public dropDroppableUsesIn
- public dump
- protected eraseMetadata
- protected getAllMetadata
- public getContext
- protected getMetadata
- protected getMetadata
- protected getMetadata
- protected getMetadata
- public getName
- public getNameOrAsOperand
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- public getSingleUndroppableUse
- public getSingleUndroppableUse
- protected getSubclassDataFromValue
- public getType
- public getUniqueUndroppableUser
- public getUniqueUndroppableUser
- public getValueID
- public getValueName
- protected hasMetadata
- protected hasMetadata
- protected hasMetadata
- public hasNUndroppableUses
- public hasNUndroppableUsesOrMore
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasOneUser
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isTransitiveUsedByMetadataOnly
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- protected setMetadata
- protected setMetadata
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsForAliasAnalysis
- public stripPointerCastsForAliasAnalysis
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶void AssertOK()
void AssertOK()
Declared at: llvm/include/llvm/IR/Instructions.h:1187
¶ICmpInst(llvm::Instruction* InsertBefore,
llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& NameStr = "")
ICmpInst(llvm::Instruction* InsertBefore,
llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& NameStr = "")
Description
Constructor with insert-before-instruction semantics.
Declared at: llvm/include/llvm/IR/Instructions.h:1207
Parameters
- llvm::Instruction* InsertBefore
- llvm::CmpInst::Predicate pred
- llvm::Value* LHS
- llvm::Value* RHS
- const llvm::Twine& NameStr = ""
¶ICmpInst(llvm::BasicBlock& InsertAtEnd,
llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& NameStr = "")
ICmpInst(llvm::BasicBlock& InsertAtEnd,
llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& NameStr = "")
Description
Constructor with insert-at-end semantics.
Declared at: llvm/include/llvm/IR/Instructions.h:1222
Parameters
- llvm::BasicBlock& InsertAtEnd
- llvm::CmpInst::Predicate pred
- llvm::Value* LHS
- llvm::Value* RHS
- const llvm::Twine& NameStr = ""
¶ICmpInst(llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& NameStr = "")
ICmpInst(llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& NameStr = "")
Description
Constructor with no-insertion semantics
Declared at: llvm/include/llvm/IR/Instructions.h:1237
Parameters
- llvm::CmpInst::Predicate pred
- llvm::Value* LHS
- llvm::Value* RHS
- const llvm::Twine& NameStr = ""
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Declared at: llvm/include/llvm/IR/Instructions.h:1347
Parameters
- const llvm::Value* V
¶static bool classof(const llvm::Instruction* I)
static bool classof(const llvm::Instruction* I)
Declared at: llvm/include/llvm/IR/Instructions.h:1344
Parameters
- const llvm::Instruction* I
¶llvm::ICmpInst* cloneImpl() const
llvm::ICmpInst* cloneImpl() const
Description
Clone an identical ICmpInst
Declared at: llvm/include/llvm/IR/Instructions.h:1203
¶static bool compare(const llvm::APInt& LHS,
const llvm::APInt& RHS,
ICmpInst::Predicate Pred)
static bool compare(const llvm::APInt& LHS,
const llvm::APInt& RHS,
ICmpInst::Predicate Pred)
Description
Return result of `LHS Pred RHS` comparison.
Declared at: llvm/include/llvm/IR/Instructions.h:1340
Parameters
- const llvm::APInt& LHS
- const llvm::APInt& RHS
- ICmpInst::Predicate Pred
¶static llvm::CmpInst::Predicate
getSignedPredicate(llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getSignedPredicate(llvm::CmpInst::Predicate pred)
Description
This is a static version that you can use without an instruction. Return the signed version of the predicate.
Declared at: llvm/include/llvm/IR/Instructions.h:1259
Parameters
- llvm::CmpInst::Predicate pred
¶llvm::CmpInst::Predicate getSignedPredicate()
const
llvm::CmpInst::Predicate getSignedPredicate()
const
Description
For example, EQ->EQ, SLE->SLE, UGT->SGT, etc.
Declared at: llvm/include/llvm/IR/Instructions.h:1253
Returns
the predicate that would be the result if the operand were regarded as signed. Return the signed version of the predicate
¶llvm::CmpInst::Predicate getUnsignedPredicate()
const
llvm::CmpInst::Predicate getUnsignedPredicate()
const
Description
For example, EQ->EQ, SLE->ULE, UGT->UGT, etc.
Declared at: llvm/include/llvm/IR/Instructions.h:1265
Returns
the predicate that would be the result if the operand were regarded as unsigned. Return the unsigned version of the predicate
¶static llvm::CmpInst::Predicate
getUnsignedPredicate(
llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getUnsignedPredicate(
llvm::CmpInst::Predicate pred)
Description
This is a static version that you can use without an instruction. Return the unsigned version of the predicate.
Declared at: llvm/include/llvm/IR/Instructions.h:1271
Parameters
- llvm::CmpInst::Predicate pred
¶bool isCommutative() const
bool isCommutative() const
Declared at: llvm/include/llvm/IR/Instructions.h:1287
Returns
true if the predicate of this ICmpInst is commutative Determine if this relation is commutative.
¶static bool isEquality(llvm::CmpInst::Predicate P)
static bool isEquality(llvm::CmpInst::Predicate P)
Description
Return true if this predicate is either EQ or NE. This also tests for commutativity.
Declared at: llvm/include/llvm/IR/Instructions.h:1275
Parameters
- llvm::CmpInst::Predicate P
¶bool isEquality() const
bool isEquality() const
Description
Return true if this predicate is either EQ or NE. This also tests for commutativity.
Declared at: llvm/include/llvm/IR/Instructions.h:1281
¶static bool isGE(llvm::CmpInst::Predicate P)
static bool isGE(llvm::CmpInst::Predicate P)
Description
Return true if the predicate is SGE or UGE.
Declared at: llvm/include/llvm/IR/Instructions.h:1315
Parameters
- llvm::CmpInst::Predicate P
¶static bool isGT(llvm::CmpInst::Predicate P)
static bool isGT(llvm::CmpInst::Predicate P)
Description
Return true if the predicate is SGT or UGT.
Declared at: llvm/include/llvm/IR/Instructions.h:1303
Parameters
- llvm::CmpInst::Predicate P
¶static bool isLE(llvm::CmpInst::Predicate P)
static bool isLE(llvm::CmpInst::Predicate P)
Description
Return true if the predicate is SLE or ULE.
Declared at: llvm/include/llvm/IR/Instructions.h:1321
Parameters
- llvm::CmpInst::Predicate P
¶static bool isLT(llvm::CmpInst::Predicate P)
static bool isLT(llvm::CmpInst::Predicate P)
Description
Return true if the predicate is SLT or ULT.
Declared at: llvm/include/llvm/IR/Instructions.h:1309
Parameters
- llvm::CmpInst::Predicate P
¶bool isRelational() const
bool isRelational() const
Description
Return true if the predicate is relational (not EQ or NE).
Declared at: llvm/include/llvm/IR/Instructions.h:1291
¶static bool isRelational(
llvm::CmpInst::Predicate P)
static bool isRelational(
llvm::CmpInst::Predicate P)
Description
Return true if the predicate is relational (not EQ or NE).
Declared at: llvm/include/llvm/IR/Instructions.h:1297
Parameters
- llvm::CmpInst::Predicate P
¶static iota_range<llvm::CmpInst::Predicate>
predicates()
static iota_range<llvm::CmpInst::Predicate>
predicates()
Description
Returns the sequence of all ICmp predicates.
Declared at: llvm/include/llvm/IR/Instructions.h:1327
¶void swapOperands()
void swapOperands()
Description
Exchange the two operands to this instruction in such a way that it does not modify the semantics of the instruction. The predicate value may be changed to retain the same result if the predicate is order dependent (e.g. ult). Swap operands and adjust predicate.
Declared at: llvm/include/llvm/IR/Instructions.h:1334