LLVM  mainline
Public Member Functions | Static Public Member Functions | Protected Member Functions
llvm::AtomicCmpXchgInst Class Reference

AtomicCmpXchgInst - an instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there. More...

#include <Instructions.h>

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

List of all members.

Public Member Functions

void * operator new (size_t s)
 Allocate a User with an operand pointer co-allocated.
 AtomicCmpXchgInst (Value *Ptr, Value *Cmp, Value *NewVal, AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering, SynchronizationScope SynchScope, Instruction *InsertBefore=nullptr)
 AtomicCmpXchgInst (Value *Ptr, Value *Cmp, Value *NewVal, AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering, SynchronizationScope SynchScope, BasicBlock *InsertAtEnd)
bool isVolatile () const
 isVolatile - Return true if this is a cmpxchg from a volatile memory location.
void setVolatile (bool V)
 setVolatile - Specify whether this is a volatile cmpxchg.
bool isWeak () const
 Return true if this cmpxchg may spuriously fail.
void setWeak (bool IsWeak)
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Transparently provide more efficient getOperand methods.
void setSuccessOrdering (AtomicOrdering Ordering)
 Set the ordering constraint on this cmpxchg.
void setFailureOrdering (AtomicOrdering Ordering)
void setSynchScope (SynchronizationScope SynchScope)
 Specify whether this cmpxchg is atomic and orders other operations with respect to all concurrently executing threads, or only with respect to signal handlers executing in the same thread.
AtomicOrdering getSuccessOrdering () const
 Returns the ordering constraint on this cmpxchg.
AtomicOrdering getFailureOrdering () const
 Returns the ordering constraint on this cmpxchg.
SynchronizationScope getSynchScope () const
 Returns whether this cmpxchg is atomic between threads or only within a single thread.
ValuegetPointerOperand ()
const ValuegetPointerOperand () const
ValuegetCompareOperand ()
const ValuegetCompareOperand () const
ValuegetNewValOperand ()
const ValuegetNewValOperand () const
unsigned getPointerAddressSpace () const
 Returns the address space of the pointer operand.

Static Public Member Functions

static unsigned getPointerOperandIndex ()
static AtomicOrdering getStrongestFailureOrdering (AtomicOrdering SuccessOrdering)
 Returns the strongest permitted ordering on failure, given the desired ordering on success.
static bool classof (const Instruction *I)
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast:

Protected Member Functions

AtomicCmpXchgInstclone_impl () const override

Detailed Description

AtomicCmpXchgInst - an instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.

Returns the value that was loaded.

Definition at line 502 of file Instructions.h.


Constructor & Destructor Documentation

AtomicCmpXchgInst::AtomicCmpXchgInst ( Value Ptr,
Value Cmp,
Value NewVal,
AtomicOrdering  SuccessOrdering,
AtomicOrdering  FailureOrdering,
SynchronizationScope  SynchScope,
Instruction InsertBefore = nullptr 
)

Definition at line 1102 of file Instructions.cpp.

Referenced by clone_impl().

AtomicCmpXchgInst::AtomicCmpXchgInst ( Value Ptr,
Value Cmp,
Value NewVal,
AtomicOrdering  SuccessOrdering,
AtomicOrdering  FailureOrdering,
SynchronizationScope  SynchScope,
BasicBlock InsertAtEnd 
)

Definition at line 1115 of file Instructions.cpp.


Member Function Documentation

static bool llvm::AtomicCmpXchgInst::classof ( const Instruction I) [inline, static]

Definition at line 629 of file Instructions.h.

References llvm::Instruction::getOpcode().

Referenced by classof().

static bool llvm::AtomicCmpXchgInst::classof ( const Value V) [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:

Reimplemented from llvm::Instruction.

Definition at line 632 of file Instructions.h.

References classof().

AtomicCmpXchgInst * AtomicCmpXchgInst::clone_impl ( ) const [override, protected, virtual]

Transparently provide more efficient getOperand methods.

Definition at line 595 of file Instructions.h.

References llvm::User::getOperand().

Referenced by llvm::MemoryLocation::get(), and LowerAtomicCmpXchgInst().

Definition at line 596 of file Instructions.h.

References llvm::User::getOperand().

Returns the ordering constraint on this cmpxchg.

Definition at line 581 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl().

Definition at line 598 of file Instructions.h.

References llvm::User::getOperand().

Referenced by LowerAtomicCmpXchgInst().

Definition at line 599 of file Instructions.h.

References llvm::User::getOperand().

Returns the address space of the pointer operand.

Definition at line 602 of file Instructions.h.

References llvm::Type::getPointerAddressSpace(), getPointerOperand(), and llvm::Value::getType().

Definition at line 592 of file Instructions.h.

References llvm::User::getOperand().

Definition at line 593 of file Instructions.h.

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.

Definition at line 614 of file Instructions.h.

References llvm::Acquire, llvm::AcquireRelease, llvm_unreachable, llvm::Monotonic, llvm::Release, and llvm::SequentiallyConsistent.

Returns the ordering constraint on this cmpxchg.

Definition at line 576 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl(), and llvm::AliasAnalysis::getModRefInfo().

Returns whether this cmpxchg is atomic between threads or only within a single thread.

Definition at line 587 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl().

isVolatile - Return true if this is a cmpxchg from a volatile memory location.

Definition at line 528 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl().

Return true if this cmpxchg may spuriously fail.

Definition at line 540 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl().

void* llvm::AtomicCmpXchgInst::operator new ( size_t  Size) [inline]

Allocate a User with an operand pointer co-allocated.

This is used for subclasses which need to allocate a variable number of operands, ie, 'hung off uses'.

Reimplemented from llvm::User.

Definition at line 511 of file Instructions.h.

References llvm::User::operator new().

Set the ordering constraint on this cmpxchg.

Definition at line 553 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction(), and llvm::NotAtomic.

Specify whether this cmpxchg is atomic and orders other operations with respect to all concurrently executing threads, or only with respect to signal handlers executing in the same thread.

Definition at line 570 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

setVolatile - Specify whether this is a volatile cmpxchg.

Definition at line 534 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl().

void llvm::AtomicCmpXchgInst::setWeak ( bool  IsWeak) [inline]

Definition at line 544 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl().


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