class AtomicCmpXchgInst
Declaration
class AtomicCmpXchgInst : public Instruction { /* full declaration omitted */ };
Description
An instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there. The value returned by this instruction is a pair containing the original value as first element, and an i1 indicating success (true) or failure (false) as second element.
Declared at: llvm/include/llvm/IR/Instructions.h:510
Inherits from: Instruction
Member Variables
- private SyncScope::ID SSID
- The synchronization scope ID of this cmpxchg instruction. Not quite enough room in SubClassData for everything, so synchronization scope ID gets its own field.
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
- public AtomicCmpXchgInst(llvm::Value * Ptr, llvm::Value * Cmp, llvm::Value * NewVal, llvm::Align Alignment, llvm::AtomicOrdering SuccessOrdering, llvm::AtomicOrdering FailureOrdering, SyncScope::ID SSID, llvm::Instruction * InsertBefore = nullptr)
- public AtomicCmpXchgInst(llvm::Value * Ptr, llvm::Value * Cmp, llvm::Value * NewVal, llvm::Align Alignment, llvm::AtomicOrdering SuccessOrdering, llvm::AtomicOrdering FailureOrdering, SyncScope::ID SSID, llvm::BasicBlock * InsertAtEnd)
- private void Init(llvm::Value * Ptr, llvm::Value * Cmp, llvm::Value * NewVal, llvm::Align Align, llvm::AtomicOrdering SuccessOrdering, llvm::AtomicOrdering FailureOrdering, SyncScope::ID SSID)
- public static bool classof(const llvm::Value * V)
- public static bool classof(const llvm::Instruction * I)
- protected llvm::AtomicCmpXchgInst * cloneImpl() const
- public llvm::Align getAlign() const
- public const llvm::Value * getCompareOperand() const
- public llvm::Value * getCompareOperand()
- public llvm::AtomicOrdering getFailureOrdering() const
- public llvm::AtomicOrdering getMergedOrdering() const
- public const llvm::Value * getNewValOperand() const
- public llvm::Value * getNewValOperand()
- public unsigned int getPointerAddressSpace() const
- public llvm::Value * getPointerOperand()
- public const llvm::Value * getPointerOperand() const
- public static unsigned int getPointerOperandIndex()
- public static llvm::AtomicOrdering getStrongestFailureOrdering(llvm::AtomicOrdering SuccessOrdering)
- public llvm::AtomicOrdering getSuccessOrdering() const
- public SyncScope::ID getSyncScopeID() const
- public static bool isValidFailureOrdering(llvm::AtomicOrdering Ordering)
- public static bool isValidSuccessOrdering(llvm::AtomicOrdering Ordering)
- public bool isVolatile() const
- public bool isWeak() const
- public void setAlignment(llvm::Align Align)
- public void setFailureOrdering(llvm::AtomicOrdering Ordering)
- private template <typename Bitfield>void setSubclassData(typename Bitfield::Type Value)
- public void setSuccessOrdering(llvm::AtomicOrdering Ordering)
- public void setSyncScopeID(SyncScope::ID SSID)
- public void setVolatile(bool V)
- public void setWeak(bool IsWeak)
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
¶AtomicCmpXchgInst(
llvm::Value* Ptr,
llvm::Value* Cmp,
llvm::Value* NewVal,
llvm::Align Alignment,
llvm::AtomicOrdering SuccessOrdering,
llvm::AtomicOrdering FailureOrdering,
SyncScope::ID SSID,
llvm::Instruction* InsertBefore = nullptr)
AtomicCmpXchgInst(
llvm::Value* Ptr,
llvm::Value* Cmp,
llvm::Value* NewVal,
llvm::Align Alignment,
llvm::AtomicOrdering SuccessOrdering,
llvm::AtomicOrdering FailureOrdering,
SyncScope::ID SSID,
llvm::Instruction* InsertBefore = nullptr)
Declared at: llvm/include/llvm/IR/Instructions.h:527
Parameters
- llvm::Value* Ptr
- llvm::Value* Cmp
- llvm::Value* NewVal
- llvm::Align Alignment
- llvm::AtomicOrdering SuccessOrdering
- llvm::AtomicOrdering FailureOrdering
- SyncScope::ID SSID
- llvm::Instruction* InsertBefore = nullptr
¶AtomicCmpXchgInst(
llvm::Value* Ptr,
llvm::Value* Cmp,
llvm::Value* NewVal,
llvm::Align Alignment,
llvm::AtomicOrdering SuccessOrdering,
llvm::AtomicOrdering FailureOrdering,
SyncScope::ID SSID,
llvm::BasicBlock* InsertAtEnd)
AtomicCmpXchgInst(
llvm::Value* Ptr,
llvm::Value* Cmp,
llvm::Value* NewVal,
llvm::Align Alignment,
llvm::AtomicOrdering SuccessOrdering,
llvm::AtomicOrdering FailureOrdering,
SyncScope::ID SSID,
llvm::BasicBlock* InsertAtEnd)
Declared at: llvm/include/llvm/IR/Instructions.h:531
Parameters
- llvm::Value* Ptr
- llvm::Value* Cmp
- llvm::Value* NewVal
- llvm::Align Alignment
- llvm::AtomicOrdering SuccessOrdering
- llvm::AtomicOrdering FailureOrdering
- SyncScope::ID SSID
- llvm::BasicBlock* InsertAtEnd
¶void Init(llvm::Value* Ptr,
llvm::Value* Cmp,
llvm::Value* NewVal,
llvm::Align Align,
llvm::AtomicOrdering SuccessOrdering,
llvm::AtomicOrdering FailureOrdering,
SyncScope::ID SSID)
void Init(llvm::Value* Ptr,
llvm::Value* Cmp,
llvm::Value* NewVal,
llvm::Align Align,
llvm::AtomicOrdering SuccessOrdering,
llvm::AtomicOrdering FailureOrdering,
SyncScope::ID SSID)
Declared at: llvm/include/llvm/IR/Instructions.h:511
Parameters
- llvm::Value* Ptr
- llvm::Value* Cmp
- llvm::Value* NewVal
- llvm::Align Align
- llvm::AtomicOrdering SuccessOrdering
- llvm::AtomicOrdering FailureOrdering
- SyncScope::ID SSID
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Declared at: llvm/include/llvm/IR/Instructions.h:682
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:679
Parameters
- const llvm::Instruction* I
¶llvm::AtomicCmpXchgInst* cloneImpl() const
llvm::AtomicCmpXchgInst* cloneImpl() const
Declared at: llvm/include/llvm/IR/Instructions.h:524
¶llvm::Align getAlign() const
llvm::Align getAlign() const
Description
Return the alignment of the memory that is being allocated by the instruction.
Declared at: llvm/include/llvm/IR/Instructions.h:555
¶const llvm::Value* getCompareOperand() const
const llvm::Value* getCompareOperand() const
Declared at: llvm/include/llvm/IR/Instructions.h:645
¶llvm::Value* getCompareOperand()
llvm::Value* getCompareOperand()
Declared at: llvm/include/llvm/IR/Instructions.h:644
¶llvm::AtomicOrdering getFailureOrdering() const
llvm::AtomicOrdering getFailureOrdering() const
Description
Returns the failure ordering constraint of this cmpxchg instruction.
Declared at: llvm/include/llvm/IR/Instructions.h:605
¶llvm::AtomicOrdering getMergedOrdering() const
llvm::AtomicOrdering getMergedOrdering() const
Description
Returns a single ordering which is at least as strong as both the success and failure orderings for this cmpxchg.
Declared at: llvm/include/llvm/IR/Instructions.h:618
¶const llvm::Value* getNewValOperand() const
const llvm::Value* getNewValOperand() const
Declared at: llvm/include/llvm/IR/Instructions.h:648
¶llvm::Value* getNewValOperand()
llvm::Value* getNewValOperand()
Declared at: llvm/include/llvm/IR/Instructions.h:647
¶unsigned int getPointerAddressSpace() const
unsigned int getPointerAddressSpace() const
Description
Returns the address space of the pointer operand.
Declared at: llvm/include/llvm/IR/Instructions.h:651
¶llvm::Value* getPointerOperand()
llvm::Value* getPointerOperand()
Declared at: llvm/include/llvm/IR/Instructions.h:640
¶const llvm::Value* getPointerOperand() const
const llvm::Value* getPointerOperand() const
Declared at: llvm/include/llvm/IR/Instructions.h:641
¶static unsigned int getPointerOperandIndex()
static unsigned int getPointerOperandIndex()
Declared at: llvm/include/llvm/IR/Instructions.h:642
¶static llvm::AtomicOrdering
getStrongestFailureOrdering(
llvm::AtomicOrdering SuccessOrdering)
static llvm::AtomicOrdering
getStrongestFailureOrdering(
llvm::AtomicOrdering SuccessOrdering)
Description
Returns the strongest permitted ordering on failure, given the desired ordering on success. If the comparison in a cmpxchg operation fails, there is no atomic store so release semantics cannot be provided. So this function drops explicit Release requests from the AtomicOrdering. A SequentiallyConsistent operation would remain SequentiallyConsistent.
Declared at: llvm/include/llvm/IR/Instructions.h:663
Parameters
- llvm::AtomicOrdering SuccessOrdering
¶llvm::AtomicOrdering getSuccessOrdering() const
llvm::AtomicOrdering getSuccessOrdering() const
Description
Returns the success ordering constraint of this cmpxchg instruction.
Declared at: llvm/include/llvm/IR/Instructions.h:593
¶SyncScope::ID getSyncScopeID() const
SyncScope::ID getSyncScopeID() const
Description
Returns the synchronization scope ID of this cmpxchg instruction.
Declared at: llvm/include/llvm/IR/Instructions.h:631
¶static bool isValidFailureOrdering(
llvm::AtomicOrdering Ordering)
static bool isValidFailureOrdering(
llvm::AtomicOrdering Ordering)
Declared at: llvm/include/llvm/IR/Instructions.h:585
Parameters
- llvm::AtomicOrdering Ordering
¶static bool isValidSuccessOrdering(
llvm::AtomicOrdering Ordering)
static bool isValidSuccessOrdering(
llvm::AtomicOrdering Ordering)
Declared at: llvm/include/llvm/IR/Instructions.h:580
Parameters
- llvm::AtomicOrdering Ordering
¶bool isVolatile() const
bool isVolatile() const
Description
Return true if this is a cmpxchg from a volatile memory location.
Declared at: llvm/include/llvm/IR/Instructions.h:566
¶bool isWeak() const
bool isWeak() const
Description
Return true if this cmpxchg may spuriously fail.
Declared at: llvm/include/llvm/IR/Instructions.h:573
¶void setAlignment(llvm::Align Align)
void setAlignment(llvm::Align Align)
Declared at: llvm/include/llvm/IR/Instructions.h:559
Parameters
- llvm::Align Align
¶void setFailureOrdering(
llvm::AtomicOrdering Ordering)
void setFailureOrdering(
llvm::AtomicOrdering Ordering)
Description
Sets the failure ordering constraint of this cmpxchg instruction.
Declared at: llvm/include/llvm/IR/Instructions.h:610
Parameters
- llvm::AtomicOrdering Ordering
¶template <typename Bitfield>
void setSubclassData(
typename Bitfield::Type Value)
template <typename Bitfield>
void setSubclassData(
typename Bitfield::Type Value)
Declared at: llvm/include/llvm/IR/Instructions.h:690
Templates
- Bitfield
Parameters
- typename Bitfield::Type Value
¶void setSuccessOrdering(
llvm::AtomicOrdering Ordering)
void setSuccessOrdering(
llvm::AtomicOrdering Ordering)
Description
Sets the success ordering constraint of this cmpxchg instruction.
Declared at: llvm/include/llvm/IR/Instructions.h:598
Parameters
- llvm::AtomicOrdering Ordering
¶void setSyncScopeID(SyncScope::ID SSID)
void setSyncScopeID(SyncScope::ID SSID)
Description
Sets the synchronization scope ID of this cmpxchg instruction.
Declared at: llvm/include/llvm/IR/Instructions.h:636
Parameters
- SyncScope::ID SSID
¶void setVolatile(bool V)
void setVolatile(bool V)
Description
Specify whether this is a volatile cmpxchg.
Declared at: llvm/include/llvm/IR/Instructions.h:570
Parameters
- bool V
¶void setWeak(bool IsWeak)
void setWeak(bool IsWeak)
Declared at: llvm/include/llvm/IR/Instructions.h:575
Parameters
- bool IsWeak