LLVM API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
llvm::AtomicRMWInst Class Reference

#include <Instructions.h>

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

List of all members.

Public Types

enum  BinOp {
  Xchg, Add, Sub, And,
  Nand, Or, Xor, Max,
  Min, UMax, UMin, FIRST_BINOP = Xchg,
  LAST_BINOP = UMin, BAD_BINOP
}

Public Member Functions

void * operator new (size_t s)
 AtomicRMWInst (BinOp Operation, Value *Ptr, Value *Val, AtomicOrdering Ordering, SynchronizationScope SynchScope, Instruction *InsertBefore=0)
 AtomicRMWInst (BinOp Operation, Value *Ptr, Value *Val, AtomicOrdering Ordering, SynchronizationScope SynchScope, BasicBlock *InsertAtEnd)
BinOp getOperation () const
void setOperation (BinOp Operation)
bool isVolatile () const
void setVolatile (bool V)
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Transparently provide more efficient getOperand methods.
void setOrdering (AtomicOrdering Ordering)
 Set the ordering constraint on this RMW.
void setSynchScope (SynchronizationScope SynchScope)
AtomicOrdering getOrdering () const
 Returns the ordering constraint on this RMW.
SynchronizationScope getSynchScope () const
ValuegetPointerOperand ()
const ValuegetPointerOperand () const
ValuegetValOperand ()
const ValuegetValOperand () const
unsigned getPointerAddressSpace () const
 Returns the address space of the pointer operand.

Static Public Member Functions

static unsigned getPointerOperandIndex ()
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

virtual AtomicRMWInstclone_impl () const

Detailed Description

AtomicRMWInst - an instruction that atomically reads a memory location, combines it with another value, and then stores the result back. Returns the old value.

Definition at line 558 of file Instructions.h.


Member Enumeration Documentation

This enumeration lists the possible modifications atomicrmw can make. In the descriptions, 'p' is the pointer to the instruction's memory location, 'old' is the initial value of *p, and 'v' is the other value passed to the instruction. These instructions always return 'old'.

Enumerator:
Xchg 

*p = v

Add 

*p = old + v

Sub 

*p = old - v

And 

*p = old & v

Nand 

*p = ~old & v

Or 

*p = old | v

Xor 

*p = old ^ v

Max 

*p = old >signed v ? old : v

Min 

*p = old <signed v ? old : v

UMax 

*p = old >unsigned v ? old : v

UMin 

*p = old <unsigned v ? old : v

FIRST_BINOP 
LAST_BINOP 
BAD_BINOP 

Definition at line 567 of file Instructions.h.


Constructor & Destructor Documentation

AtomicRMWInst::AtomicRMWInst ( BinOp  Operation,
Value Ptr,
Value Val,
AtomicOrdering  Ordering,
SynchronizationScope  SynchScope,
Instruction InsertBefore = 0 
)

Definition at line 1286 of file Instructions.cpp.

Referenced by clone_impl().

AtomicRMWInst::AtomicRMWInst ( BinOp  Operation,
Value Ptr,
Value Val,
AtomicOrdering  Ordering,
SynchronizationScope  SynchScope,
BasicBlock InsertAtEnd 
)

Definition at line 1297 of file Instructions.cpp.


Member Function Documentation

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

Definition at line 673 of file Instructions.h.

References llvm::Instruction::getOpcode().

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

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

Reimplemented from llvm::Instruction.

Definition at line 676 of file Instructions.h.

AtomicRMWInst * AtomicRMWInst::clone_impl ( ) const [protected, virtual]
llvm::AtomicRMWInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS ( Value  )

Transparently provide more efficient getOperand methods.

BinOp llvm::AtomicRMWInst::getOperation ( ) const [inline]

Definition at line 607 of file Instructions.h.

Referenced by clone_impl(), and LowerAtomicRMWInst().

AtomicOrdering llvm::AtomicRMWInst::getOrdering ( ) const [inline]

Returns the ordering constraint on this RMW.

Definition at line 650 of file Instructions.h.

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

unsigned llvm::AtomicRMWInst::getPointerAddressSpace ( ) const [inline]

Returns the address space of the pointer operand.

Definition at line 668 of file Instructions.h.

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

Value* llvm::AtomicRMWInst::getPointerOperand ( ) [inline]

Definition at line 660 of file Instructions.h.

Referenced by llvm::AliasAnalysis::getLocation(), and LowerAtomicRMWInst().

const Value* llvm::AtomicRMWInst::getPointerOperand ( ) const [inline]

Definition at line 661 of file Instructions.h.

static unsigned llvm::AtomicRMWInst::getPointerOperandIndex ( ) [inline, static]

Definition at line 662 of file Instructions.h.

SynchronizationScope llvm::AtomicRMWInst::getSynchScope ( ) const [inline]

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

Definition at line 656 of file Instructions.h.

Referenced by clone_impl().

Value* llvm::AtomicRMWInst::getValOperand ( ) [inline]

Definition at line 664 of file Instructions.h.

Referenced by llvm::AliasAnalysis::getLocation(), and LowerAtomicRMWInst().

const Value* llvm::AtomicRMWInst::getValOperand ( ) const [inline]

Definition at line 665 of file Instructions.h.

bool llvm::AtomicRMWInst::isVolatile ( ) const [inline]

isVolatile - Return true if this is a RMW on a volatile memory location.

Definition at line 619 of file Instructions.h.

Referenced by clone_impl().

void* llvm::AtomicRMWInst::operator new ( size_t  s) [inline]

Reimplemented from llvm::User.

Definition at line 597 of file Instructions.h.

void llvm::AtomicRMWInst::setOperation ( BinOp  Operation) [inline]

Definition at line 611 of file Instructions.h.

void llvm::AtomicRMWInst::setOrdering ( AtomicOrdering  Ordering) [inline]

Set the ordering constraint on this RMW.

Definition at line 634 of file Instructions.h.

References llvm::NotAtomic.

void llvm::AtomicRMWInst::setSynchScope ( SynchronizationScope  SynchScope) [inline]

Specify whether this RMW 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 644 of file Instructions.h.

void llvm::AtomicRMWInst::setVolatile ( bool  V) [inline]

setVolatile - Specify whether this is a volatile RMW or not.

Definition at line 625 of file Instructions.h.

Referenced by clone_impl().


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