class CmpInst
Declaration
class CmpInst : public Instruction { /* full declaration omitted */ };
Description
This class is the base class for the comparison instructions. Abstract base class of comparison instructions.
Declared at: llvm/include/llvm/IR/InstrTypes.h:709
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
- protected CmpInst(llvm::Type * ty, Instruction::OtherOps op, llvm::CmpInst::Predicate pred, llvm::Value * LHS, llvm::Value * RHS, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr, llvm::Instruction * FlagsSource = nullptr)
- protected CmpInst(llvm::Type * ty, Instruction::OtherOps op, llvm::CmpInst::Predicate pred, llvm::Value * LHS, llvm::Value * RHS, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static llvm::CmpInst * Create(llvm::Instruction::OtherOps Op, llvm::CmpInst::Predicate predicate, llvm::Value * S1, llvm::Value * S2, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CmpInst * Create(llvm::Instruction::OtherOps Op, llvm::CmpInst::Predicate predicate, llvm::Value * S1, llvm::Value * S2, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static iota_range<llvm::CmpInst::Predicate> FCmpPredicates()
- public static iota_range<llvm::CmpInst::Predicate> ICmpPredicates()
- public static bool classof(const llvm::Value * V)
- public static bool classof(const llvm::Instruction * I)
- public llvm::CmpInst::Predicate getFlippedSignednessPredicate()
- public static llvm::CmpInst::Predicate getFlippedSignednessPredicate(llvm::CmpInst::Predicate pred)
- public llvm::CmpInst::Predicate getFlippedStrictnessPredicate() const
- public static llvm::CmpInst::Predicate getFlippedStrictnessPredicate(llvm::CmpInst::Predicate pred)
- public llvm::CmpInst::Predicate getInversePredicate() const
- public static llvm::CmpInst::Predicate getInversePredicate(llvm::CmpInst::Predicate pred)
- public static llvm::CmpInst::Predicate getNonStrictPredicate(llvm::CmpInst::Predicate pred)
- public llvm::CmpInst::Predicate getNonStrictPredicate() const
- public llvm::Instruction::OtherOps getOpcode() const
- public llvm::CmpInst::Predicate getPredicate() const
- public static llvm::StringRef getPredicateName(llvm::CmpInst::Predicate P)
- public static llvm::CmpInst::Predicate getSignedPredicate(llvm::CmpInst::Predicate pred)
- public llvm::CmpInst::Predicate getSignedPredicate()
- public llvm::CmpInst::Predicate getStrictPredicate() const
- public static llvm::CmpInst::Predicate getStrictPredicate(llvm::CmpInst::Predicate pred)
- public static llvm::CmpInst::Predicate getSwappedPredicate(llvm::CmpInst::Predicate pred)
- public llvm::CmpInst::Predicate getSwappedPredicate() const
- public llvm::CmpInst::Predicate getUnsignedPredicate()
- public static llvm::CmpInst::Predicate getUnsignedPredicate(llvm::CmpInst::Predicate pred)
- public bool isCommutative() const
- public static bool isEquality(llvm::CmpInst::Predicate pred)
- public bool isEquality() const
- public static bool isFPPredicate(llvm::CmpInst::Predicate P)
- public bool isFPPredicate() const
- public static bool isFalseWhenEqual(llvm::CmpInst::Predicate predicate)
- public bool isFalseWhenEqual() const
- public static bool isImpliedFalseByMatchingCmp(llvm::CmpInst::Predicate Pred1, llvm::CmpInst::Predicate Pred2)
- public static bool isImpliedTrueByMatchingCmp(llvm::CmpInst::Predicate Pred1, llvm::CmpInst::Predicate Pred2)
- public static bool isIntPredicate(llvm::CmpInst::Predicate P)
- public bool isIntPredicate() const
- public bool isNonStrictPredicate() const
- public static bool isNonStrictPredicate(llvm::CmpInst::Predicate predicate)
- public static bool isOrdered(llvm::CmpInst::Predicate predicate)
- public bool isRelational() const
- public static bool isRelational(llvm::CmpInst::Predicate P)
- public static bool isSigned(llvm::CmpInst::Predicate predicate)
- public bool isSigned() const
- public bool isStrictPredicate() const
- public static bool isStrictPredicate(llvm::CmpInst::Predicate predicate)
- public bool isTrueWhenEqual() const
- public static bool isTrueWhenEqual(llvm::CmpInst::Predicate predicate)
- public static bool isUnordered(llvm::CmpInst::Predicate predicate)
- public static bool isUnsigned(llvm::CmpInst::Predicate predicate)
- public bool isUnsigned() const
- public static llvm::Type * makeCmpResultType(llvm::Type * opnd_type)
- public void setPredicate(llvm::CmpInst::Predicate P)
- private void setValueSubclassData(unsigned short D)
- public void 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
¶CmpInst(llvm::Type* ty,
Instruction::OtherOps op,
llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr,
llvm::Instruction* FlagsSource = nullptr)
CmpInst(llvm::Type* ty,
Instruction::OtherOps op,
llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr,
llvm::Instruction* FlagsSource = nullptr)
Declared at: llvm/include/llvm/IR/InstrTypes.h:772
Parameters
- llvm::Type* ty
- Instruction::OtherOps op
- llvm::CmpInst::Predicate pred
- llvm::Value* LHS
- llvm::Value* RHS
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
- llvm::Instruction* FlagsSource = nullptr
¶CmpInst(llvm::Type* ty,
Instruction::OtherOps op,
llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
CmpInst(llvm::Type* ty,
Instruction::OtherOps op,
llvm::CmpInst::Predicate pred,
llvm::Value* LHS,
llvm::Value* RHS,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Declared at: llvm/include/llvm/IR/InstrTypes.h:777
Parameters
- llvm::Type* ty
- Instruction::OtherOps op
- llvm::CmpInst::Predicate pred
- llvm::Value* LHS
- llvm::Value* RHS
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static llvm::CmpInst* Create(
llvm::Instruction::OtherOps Op,
llvm::CmpInst::Predicate predicate,
llvm::Value* S1,
llvm::Value* S2,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CmpInst* Create(
llvm::Instruction::OtherOps Op,
llvm::CmpInst::Predicate predicate,
llvm::Value* S1,
llvm::Value* S2,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
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
Declared at: llvm/include/llvm/IR/InstrTypes.h:791
Parameters
- llvm::Instruction::OtherOps Op
- llvm::CmpInst::Predicate predicate
- llvm::Value* S1
- llvm::Value* S2
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CmpInst* Create(
llvm::Instruction::OtherOps Op,
llvm::CmpInst::Predicate predicate,
llvm::Value* S1,
llvm::Value* S2,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CmpInst* Create(
llvm::Instruction::OtherOps Op,
llvm::CmpInst::Predicate predicate,
llvm::Value* S1,
llvm::Value* S2,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
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
Declared at: llvm/include/llvm/IR/InstrTypes.h:800
Parameters
- llvm::Instruction::OtherOps Op
- llvm::CmpInst::Predicate predicate
- llvm::Value* S1
- llvm::Value* S2
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static iota_range<llvm::CmpInst::Predicate>
FCmpPredicates()
static iota_range<llvm::CmpInst::Predicate>
FCmpPredicates()
Description
Returns the sequence of all FCmp predicates.
Declared at: llvm/include/llvm/IR/InstrTypes.h:758
¶static iota_range<llvm::CmpInst::Predicate>
ICmpPredicates()
static iota_range<llvm::CmpInst::Predicate>
ICmpPredicates()
Description
Returns the sequence of all ICmp predicates.
Declared at: llvm/include/llvm/IR/InstrTypes.h:765
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Declared at: llvm/include/llvm/IR/InstrTypes.h:1039
Parameters
- const llvm::Value* V
¶static bool classof(const llvm::Instruction* I)
static bool classof(const llvm::Instruction* I)
Description
Methods for support type inquiry through isa, cast, and dyn_cast:
Declared at: llvm/include/llvm/IR/InstrTypes.h:1035
Parameters
- const llvm::Instruction* I
¶llvm::CmpInst::Predicate
getFlippedSignednessPredicate()
llvm::CmpInst::Predicate
getFlippedSignednessPredicate()
Description
For example, SLT->ULT, ULT->SLT, SLE->ULE, ULE->SLE, EQ->Failed assert
Declared at: llvm/include/llvm/IR/InstrTypes.h:990
Returns
the unsigned version of the signed predicate pred or the signed version of the signed predicate pred.
¶static llvm::CmpInst::Predicate
getFlippedSignednessPredicate(
llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getFlippedSignednessPredicate(
llvm::CmpInst::Predicate pred)
Description
For example, SLT->ULT, ULT->SLT, SLE->ULE, ULE->SLE, EQ->Failed assert
Declared at: llvm/include/llvm/IR/InstrTypes.h:985
Parameters
- llvm::CmpInst::Predicate pred
Returns
the unsigned version of the signed predicate pred or the signed version of the signed predicate pred.
¶llvm::CmpInst::Predicate
getFlippedStrictnessPredicate() const
llvm::CmpInst::Predicate
getFlippedStrictnessPredicate() const
Description
For predicate of kind "is X or equal to 0" returns the predicate "is X". For predicate of kind "is X" returns the predicate "is X or equal to 0". does not support other kind of predicates.
Declared at: llvm/include/llvm/IR/InstrTypes.h:915
Returns
the predicate that does not contains is equal to zero if it had and vice versa. Return the flipped strictness of predicate
¶static llvm::CmpInst::Predicate
getFlippedStrictnessPredicate(
llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getFlippedStrictnessPredicate(
llvm::CmpInst::Predicate pred)
Description
This is a static version that you can use without an instruction available. Return the flipped strictness of predicate
Declared at: llvm/include/llvm/IR/InstrTypes.h:907
Parameters
- llvm::CmpInst::Predicate pred
¶llvm::CmpInst::Predicate getInversePredicate()
const
llvm::CmpInst::Predicate getInversePredicate()
const
Description
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
Declared at: llvm/include/llvm/IR/InstrTypes.h:833
Returns
the inverse predicate for the instruction's current predicate. Return the inverse of the instruction's predicate.
¶static llvm::CmpInst::Predicate
getInversePredicate(llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getInversePredicate(llvm::CmpInst::Predicate pred)
Description
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
Declared at: llvm/include/llvm/IR/InstrTypes.h:841
Parameters
- llvm::CmpInst::Predicate pred
Returns
the inverse predicate for predicate provided in \p pred. Return the inverse of a given predicate
¶static llvm::CmpInst::Predicate
getNonStrictPredicate(
llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getNonStrictPredicate(
llvm::CmpInst::Predicate pred)
Description
This is a static version that you can use without an instruction available.
Declared at: llvm/include/llvm/IR/InstrTypes.h:902
Parameters
- llvm::CmpInst::Predicate pred
Returns
the non-strict version of comparison provided in \p pred. If \p pred is not a strict comparison predicate, returns \p pred. Returns the non-strict version of strict comparisons.
¶llvm::CmpInst::Predicate getNonStrictPredicate()
const
llvm::CmpInst::Predicate getNonStrictPredicate()
const
Description
For example, SGT -> SGE, SLT -> SLE, ULT -> ULE, UGT -> UGE. Returns the non-strict version of strict comparisons.
Declared at: llvm/include/llvm/IR/InstrTypes.h:893
¶llvm::Instruction::OtherOps getOpcode() const
llvm::Instruction::OtherOps getOpcode() const
Description
Get the opcode casted to the right type
Declared at: llvm/include/llvm/IR/InstrTypes.h:804
¶llvm::CmpInst::Predicate getPredicate() const
llvm::CmpInst::Predicate getPredicate() const
Description
Return the predicate for this instruction.
Declared at: llvm/include/llvm/IR/InstrTypes.h:809
¶static llvm::StringRef getPredicateName(
llvm::CmpInst::Predicate P)
static llvm::StringRef getPredicateName(
llvm::CmpInst::Predicate P)
Declared at: llvm/include/llvm/IR/InstrTypes.h:824
Parameters
- llvm::CmpInst::Predicate P
¶static llvm::CmpInst::Predicate
getSignedPredicate(llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getSignedPredicate(llvm::CmpInst::Predicate pred)
Description
For example, ULT->SLT, ULE->SLE, UGT->SGT, UGE->SGE, SLT->Failed assert
Declared at: llvm/include/llvm/IR/InstrTypes.h:960
Parameters
- llvm::CmpInst::Predicate pred
Returns
the signed version of the unsigned predicate pred. return the signed version of a predicate
¶llvm::CmpInst::Predicate getSignedPredicate()
llvm::CmpInst::Predicate getSignedPredicate()
Description
For example, ULT->SLT, ULE->SLE, UGT->SGT, UGE->SGE, SLT->Failed assert
Declared at: llvm/include/llvm/IR/InstrTypes.h:966
Returns
the signed version of the predicate for this instruction (which has to be an unsigned predicate). return the signed version of a predicate
¶llvm::CmpInst::Predicate getStrictPredicate()
const
llvm::CmpInst::Predicate getStrictPredicate()
const
Description
For example, SGE -> SGT, SLE -> SLT, ULE -> ULT, UGE -> UGT. Returns the strict version of non-strict comparisons.
Declared at: llvm/include/llvm/IR/InstrTypes.h:880
¶static llvm::CmpInst::Predicate
getStrictPredicate(llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getStrictPredicate(llvm::CmpInst::Predicate pred)
Description
This is a static version that you can use without an instruction available.
Declared at: llvm/include/llvm/IR/InstrTypes.h:889
Parameters
- llvm::CmpInst::Predicate pred
Returns
the strict version of comparison provided in \p pred. If \p pred is not a strict comparison predicate, returns \p pred. Returns the strict version of non-strict comparisons.
¶static llvm::CmpInst::Predicate
getSwappedPredicate(llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getSwappedPredicate(llvm::CmpInst::Predicate pred)
Description
This is a static version that you can use without an instruction available. Return the predicate as if the operands were swapped.
Declared at: llvm/include/llvm/IR/InstrTypes.h:856
Parameters
- llvm::CmpInst::Predicate pred
¶llvm::CmpInst::Predicate getSwappedPredicate()
const
llvm::CmpInst::Predicate getSwappedPredicate()
const
Description
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
Declared at: llvm/include/llvm/IR/InstrTypes.h:849
Returns
the predicate that would be the result of exchanging the two operands of the CmpInst instruction without changing the result produced. Return the predicate as if the operands were swapped
¶llvm::CmpInst::Predicate getUnsignedPredicate()
llvm::CmpInst::Predicate getUnsignedPredicate()
Description
For example, SLT->ULT, SLE->ULE, SGT->UGT, SGE->UGE, ULT->Failed assert
Declared at: llvm/include/llvm/IR/InstrTypes.h:978
Returns
the unsigned version of the predicate for this instruction (which has to be an signed predicate). return the unsigned version of a predicate
¶static llvm::CmpInst::Predicate
getUnsignedPredicate(
llvm::CmpInst::Predicate pred)
static llvm::CmpInst::Predicate
getUnsignedPredicate(
llvm::CmpInst::Predicate pred)
Description
For example, SLT->ULT, SLE->ULE, SGT->UGT, SGE->UGE, ULT->Failed assert
Declared at: llvm/include/llvm/IR/InstrTypes.h:972
Parameters
- llvm::CmpInst::Predicate pred
Returns
the unsigned version of the signed predicate pred.
¶bool isCommutative() const
bool isCommutative() const
Description
This is just a convenience that dispatches to the subclasses. Determine if this CmpInst is commutative.
Declared at: llvm/include/llvm/IR/InstrTypes.h:929
¶static bool isEquality(
llvm::CmpInst::Predicate pred)
static bool isEquality(
llvm::CmpInst::Predicate pred)
Description
Determine if this is an equals/not equals predicate. This is a static version that you can use without an instruction available.
Declared at: llvm/include/llvm/IR/InstrTypes.h:934
Parameters
- llvm::CmpInst::Predicate pred
¶bool isEquality() const
bool isEquality() const
Description
Determine if this is an equals/not equals predicate.
Declared at: llvm/include/llvm/IR/InstrTypes.h:937
¶static bool isFPPredicate(
llvm::CmpInst::Predicate P)
static bool isFPPredicate(
llvm::CmpInst::Predicate P)
Declared at: llvm/include/llvm/IR/InstrTypes.h:814
Parameters
- llvm::CmpInst::Predicate P
¶bool isFPPredicate() const
bool isFPPredicate() const
Declared at: llvm/include/llvm/IR/InstrTypes.h:826
¶static bool isFalseWhenEqual(
llvm::CmpInst::Predicate predicate)
static bool isFalseWhenEqual(
llvm::CmpInst::Predicate predicate)
Description
Determine if the predicate is false when comparing a value with itself.
Declared at: llvm/include/llvm/IR/InstrTypes.h:1024
Parameters
- llvm::CmpInst::Predicate predicate
¶bool isFalseWhenEqual() const
bool isFalseWhenEqual() const
Description
This is just a convenience. Determine if this is false when both operands are the same.
Declared at: llvm/include/llvm/IR/InstrTypes.h:1002
¶static bool isImpliedFalseByMatchingCmp(
llvm::CmpInst::Predicate Pred1,
llvm::CmpInst::Predicate Pred2)
static bool isImpliedFalseByMatchingCmp(
llvm::CmpInst::Predicate Pred1,
llvm::CmpInst::Predicate Pred2)
Description
Determine if Pred1 implies Pred2 is false when two compares have matching operands.
Declared at: llvm/include/llvm/IR/InstrTypes.h:1032
Parameters
- llvm::CmpInst::Predicate Pred1
- llvm::CmpInst::Predicate Pred2
¶static bool isImpliedTrueByMatchingCmp(
llvm::CmpInst::Predicate Pred1,
llvm::CmpInst::Predicate Pred2)
static bool isImpliedTrueByMatchingCmp(
llvm::CmpInst::Predicate Pred1,
llvm::CmpInst::Predicate Pred2)
Description
Determine if Pred1 implies Pred2 is true when two compares have matching operands.
Declared at: llvm/include/llvm/IR/InstrTypes.h:1028
Parameters
- llvm::CmpInst::Predicate Pred1
- llvm::CmpInst::Predicate Pred2
¶static bool isIntPredicate(
llvm::CmpInst::Predicate P)
static bool isIntPredicate(
llvm::CmpInst::Predicate P)
Declared at: llvm/include/llvm/IR/InstrTypes.h:820
Parameters
- llvm::CmpInst::Predicate P
¶bool isIntPredicate() const
bool isIntPredicate() const
Declared at: llvm/include/llvm/IR/InstrTypes.h:827
¶bool isNonStrictPredicate() const
bool isNonStrictPredicate() const
Declared at: llvm/include/llvm/IR/InstrTypes.h:874
Returns
true if the comparison predicate is non-strict, false otherwise. Determine if this instruction is using an non-strict comparison predicate.
¶static bool isNonStrictPredicate(
llvm::CmpInst::Predicate predicate)
static bool isNonStrictPredicate(
llvm::CmpInst::Predicate predicate)
Description
This is a static version that you can use without an instruction available.
Declared at: llvm/include/llvm/IR/InstrTypes.h:870
Parameters
- llvm::CmpInst::Predicate predicate
Returns
true if the comparison predicate is non-strict, false otherwise.
¶static bool isOrdered(
llvm::CmpInst::Predicate predicate)
static bool isOrdered(
llvm::CmpInst::Predicate predicate)
Description
Determine if the predicate is an ordered operation.
Declared at: llvm/include/llvm/IR/InstrTypes.h:1015
Parameters
- llvm::CmpInst::Predicate predicate
¶bool isRelational() const
bool isRelational() const
Description
Return true if the predicate is relational (not EQ or NE).
Declared at: llvm/include/llvm/IR/InstrTypes.h:943
¶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/InstrTypes.h:940
Parameters
- llvm::CmpInst::Predicate P
¶static bool isSigned(
llvm::CmpInst::Predicate predicate)
static bool isSigned(
llvm::CmpInst::Predicate predicate)
Declared at: llvm/include/llvm/IR/InstrTypes.h:1012
Parameters
- llvm::CmpInst::Predicate predicate
Returns
true if the predicate is signed, false otherwise. Determine if the predicate is an signed operation.
¶bool isSigned() const
bool isSigned() const
Declared at: llvm/include/llvm/IR/InstrTypes.h:947
Returns
true if the comparison is signed, false otherwise. Determine if this instruction is using a signed comparison.
¶bool isStrictPredicate() const
bool isStrictPredicate() const
Declared at: llvm/include/llvm/IR/InstrTypes.h:865
Returns
true if the comparison predicate is strict, false otherwise. Determine if this instruction is using an strict comparison predicate.
¶static bool isStrictPredicate(
llvm::CmpInst::Predicate predicate)
static bool isStrictPredicate(
llvm::CmpInst::Predicate predicate)
Description
This is a static version that you can use without an instruction available.
Declared at: llvm/include/llvm/IR/InstrTypes.h:861
Parameters
- llvm::CmpInst::Predicate predicate
Returns
true if the comparison predicate is strict, false otherwise.
¶bool isTrueWhenEqual() const
bool isTrueWhenEqual() const
Description
This is just a convenience. Determine if this is true when both operands are the same.
Declared at: llvm/include/llvm/IR/InstrTypes.h:996
¶static bool isTrueWhenEqual(
llvm::CmpInst::Predicate predicate)
static bool isTrueWhenEqual(
llvm::CmpInst::Predicate predicate)
Description
Determine if the predicate is true when comparing a value with itself.
Declared at: llvm/include/llvm/IR/InstrTypes.h:1021
Parameters
- llvm::CmpInst::Predicate predicate
¶static bool isUnordered(
llvm::CmpInst::Predicate predicate)
static bool isUnordered(
llvm::CmpInst::Predicate predicate)
Description
Determine if the predicate is an unordered operation.
Declared at: llvm/include/llvm/IR/InstrTypes.h:1018
Parameters
- llvm::CmpInst::Predicate predicate
¶static bool isUnsigned(
llvm::CmpInst::Predicate predicate)
static bool isUnsigned(
llvm::CmpInst::Predicate predicate)
Declared at: llvm/include/llvm/IR/InstrTypes.h:1008
Parameters
- llvm::CmpInst::Predicate predicate
Returns
true if the predicate is unsigned, false otherwise. Determine if the predicate is an unsigned operation.
¶bool isUnsigned() const
bool isUnsigned() const
Declared at: llvm/include/llvm/IR/InstrTypes.h:953
Returns
true if the comparison is unsigned, false otherwise. Determine if this instruction is using an unsigned comparison.
¶static llvm::Type* makeCmpResultType(
llvm::Type* opnd_type)
static llvm::Type* makeCmpResultType(
llvm::Type* opnd_type)
Description
Create a result type for fcmp/icmp
Declared at: llvm/include/llvm/IR/InstrTypes.h:1044
Parameters
- llvm::Type* opnd_type
¶void setPredicate(llvm::CmpInst::Predicate P)
void setPredicate(llvm::CmpInst::Predicate P)
Description
Set the predicate for this instruction to the specified value.
Declared at: llvm/include/llvm/IR/InstrTypes.h:812
Parameters
- llvm::CmpInst::Predicate P
¶void setValueSubclassData(unsigned short D)
void setValueSubclassData(unsigned short D)
Declared at: llvm/include/llvm/IR/InstrTypes.h:1055
Parameters
- unsigned short D
¶void swapOperands()
void swapOperands()
Description
This is just a convenience that dispatches to the subclasses. Swap the operands and adjust predicate accordingly to retain the same comparison.
Declared at: llvm/include/llvm/IR/InstrTypes.h:925