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=nullptr)
 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

AtomicRMWInstclone_impl () const override

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


Constructor & Destructor Documentation

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

Definition at line 1300 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 1311 of file Instructions.cpp.


Member Function Documentation

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

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

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

Transparently provide more efficient getOperand methods.

Definition at line 685 of file Instructions.h.

Referenced by clone_impl(), and LowerAtomicRMWInst().

Returns the ordering constraint on this RMW.

Definition at line 728 of file Instructions.h.

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

Returns the address space of the pointer operand.

Definition at line 746 of file Instructions.h.

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

Definition at line 738 of file Instructions.h.

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

Definition at line 739 of file Instructions.h.

Definition at line 740 of file Instructions.h.

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

Definition at line 734 of file Instructions.h.

Referenced by clone_impl().

Definition at line 742 of file Instructions.h.

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

Definition at line 743 of file Instructions.h.

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

Definition at line 697 of file Instructions.h.

Referenced by clone_impl().

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

Reimplemented from llvm::User.

Definition at line 675 of file Instructions.h.

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

Definition at line 689 of file Instructions.h.

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

Set the ordering constraint on this RMW.

Definition at line 712 of file Instructions.h.

References llvm::NotAtomic.

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

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

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

Definition at line 703 of file Instructions.h.

Referenced by clone_impl().


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