LLVM  mainline
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
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

AtomicCmpXchgInstcloneImpl () const
 Create a copy of this instruction.

Friends

class Instruction

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 519 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 1411 of file Instructions.cpp.

Referenced by cloneImpl().

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

Definition at line 1424 of file Instructions.cpp.


Member Function Documentation

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

Definition at line 650 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 653 of file Instructions.h.

References classof().

Create a copy of this instruction.

Reimplemented from llvm::Instruction.

Definition at line 3828 of file Instructions.cpp.

References AtomicCmpXchgInst(), getFailureOrdering(), llvm::User::getOperand(), getSuccessOrdering(), getSynchScope(), isVolatile(), isWeak(), setVolatile(), and setWeak().

Transparently provide more efficient getOperand methods.

Definition at line 616 of file Instructions.h.

References llvm::User::getOperand().

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

Definition at line 617 of file Instructions.h.

References llvm::User::getOperand().

Returns the ordering constraint on this cmpxchg.

Definition at line 602 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by cloneImpl().

Definition at line 619 of file Instructions.h.

References llvm::User::getOperand().

Referenced by LowerAtomicCmpXchgInst().

Definition at line 620 of file Instructions.h.

References llvm::User::getOperand().

Returns the address space of the pointer operand.

Definition at line 623 of file Instructions.h.

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

Definition at line 613 of file Instructions.h.

References llvm::User::getOperand().

Definition at line 614 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 635 of file Instructions.h.

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

Referenced by createCmpXchgInstFun().

Returns the ordering constraint on this cmpxchg.

Definition at line 597 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by cloneImpl(), and llvm::AAResults::getModRefInfo().

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

Definition at line 608 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by cloneImpl().

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

Definition at line 549 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by cloneImpl().

Return true if this cmpxchg may spuriously fail.

Definition at line 561 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by cloneImpl().

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 532 of file Instructions.h.

References operator new().

Set the ordering constraint on this cmpxchg.

Definition at line 574 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 591 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

setVolatile - Specify whether this is a volatile cmpxchg.

Definition at line 555 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by cloneImpl().

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

Definition at line 565 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by cloneImpl().


Friends And Related Function Documentation

friend class Instruction [friend]

Definition at line 527 of file Instructions.h.


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