LLVM 22.0.0git
llvm::AtomicInfo Class Referenceabstract

#include "llvm/Frontend/Atomic/Atomic.h"

Public Member Functions

 AtomicInfo (IRBuilderBase *Builder, Type *Ty, uint64_t AtomicSizeInBits, uint64_t ValueSizeInBits, Align AtomicAlign, Align ValueAlign, bool UseLibcall, IRBuilderBase::InsertPoint AllocaIP)
virtual ~AtomicInfo ()=default
Align getAtomicAlignment () const
uint64_t getAtomicSizeInBits () const
uint64_t getValueSizeInBits () const
bool shouldUseLibcall () const
TypegetAtomicTy () const
virtual ValuegetAtomicPointer () const =0
virtual void decorateWithTBAA (Instruction *I)=0
virtual AllocaInstCreateAlloca (Type *Ty, const Twine &Name) const =0
bool hasPadding () const
LLVMContextgetLLVMContext () const
LLVM_ABI bool shouldCastToInt (Type *ValTy, bool CmpXchg)
LLVM_ABI ValueEmitAtomicLoadOp (AtomicOrdering AO, bool IsVolatile, bool CmpXchg=false)
LLVM_ABI CallInstEmitAtomicLibcall (StringRef fnName, Type *ResultType, ArrayRef< Value * > Args)
ValuegetAtomicSizeValue () const
LLVM_ABI std::pair< Value *, Value * > EmitAtomicCompareExchangeLibcall (Value *ExpectedVal, Value *DesiredVal, AtomicOrdering Success, AtomicOrdering Failure)
ValuecastToAtomicIntPointer (Value *addr) const
ValuegetAtomicAddressAsAtomicIntPointer () const
LLVM_ABI std::pair< Value *, Value * > EmitAtomicCompareExchangeOp (Value *ExpectedVal, Value *DesiredVal, AtomicOrdering Success, AtomicOrdering Failure, bool IsVolatile=false, bool IsWeak=false)
LLVM_ABI std::pair< Value *, Value * > EmitAtomicCompareExchange (Value *ExpectedVal, Value *DesiredVal, AtomicOrdering Success, AtomicOrdering Failure, bool IsVolatile, bool IsWeak)
LLVM_ABI std::pair< LoadInst *, AllocaInst * > EmitAtomicLoadLibcall (AtomicOrdering AO)
LLVM_ABI void EmitAtomicStoreLibcall (AtomicOrdering AO, Value *Source)

Protected Attributes

IRBuilderBaseBuilder
TypeTy
uint64_t AtomicSizeInBits
uint64_t ValueSizeInBits
Align AtomicAlign
Align ValueAlign
bool UseLibcall
IRBuilderBase::InsertPoint AllocaIP

Detailed Description

Definition at line 17 of file Atomic.h.

Constructor & Destructor Documentation

◆ AtomicInfo()

llvm::AtomicInfo::AtomicInfo ( IRBuilderBase * Builder,
Type * Ty,
uint64_t AtomicSizeInBits,
uint64_t ValueSizeInBits,
Align AtomicAlign,
Align ValueAlign,
bool UseLibcall,
IRBuilderBase::InsertPoint AllocaIP )
inline

Definition at line 29 of file Atomic.h.

References AllocaIP, AtomicAlign, AtomicSizeInBits, Builder, Ty, UseLibcall, ValueAlign, and ValueSizeInBits.

◆ ~AtomicInfo()

virtual llvm::AtomicInfo::~AtomicInfo ( )
virtualdefault

Member Function Documentation

◆ castToAtomicIntPointer()

Value * llvm::AtomicInfo::castToAtomicIntPointer ( Value * addr) const
inline

Definition at line 82 of file Atomic.h.

Referenced by getAtomicAddressAsAtomicIntPointer().

◆ CreateAlloca()

virtual AllocaInst * llvm::AtomicInfo::CreateAlloca ( Type * Ty,
const Twine & Name ) const
pure virtual

References Ty.

Referenced by EmitAtomicLoadLibcall().

◆ decorateWithTBAA()

virtual void llvm::AtomicInfo::decorateWithTBAA ( Instruction * I)
pure virtual

References I.

Referenced by EmitAtomicLoadOp().

◆ EmitAtomicCompareExchange()

std::pair< Value *, Value * > AtomicInfo::EmitAtomicCompareExchange ( Value * ExpectedVal,
Value * DesiredVal,
AtomicOrdering Success,
AtomicOrdering Failure,
bool IsVolatile,
bool IsWeak )

◆ EmitAtomicCompareExchangeLibcall()

std::pair< Value *, Value * > AtomicInfo::EmitAtomicCompareExchangeLibcall ( Value * ExpectedVal,
Value * DesiredVal,
AtomicOrdering Success,
AtomicOrdering Failure )

◆ EmitAtomicCompareExchangeOp()

std::pair< Value *, Value * > AtomicInfo::EmitAtomicCompareExchangeOp ( Value * ExpectedVal,
Value * DesiredVal,
AtomicOrdering Success,
AtomicOrdering Failure,
bool IsVolatile = false,
bool IsWeak = false )

◆ EmitAtomicLibcall()

CallInst * AtomicInfo::EmitAtomicLibcall ( StringRef fnName,
Type * ResultType,
ArrayRef< Value * > Args )

◆ EmitAtomicLoadLibcall()

◆ EmitAtomicLoadOp()

Value * AtomicInfo::EmitAtomicLoadOp ( AtomicOrdering AO,
bool IsVolatile,
bool CmpXchg = false )

◆ EmitAtomicStoreLibcall()

◆ getAtomicAddressAsAtomicIntPointer()

Value * llvm::AtomicInfo::getAtomicAddressAsAtomicIntPointer ( ) const
inline

Definition at line 86 of file Atomic.h.

References castToAtomicIntPointer(), and getAtomicPointer().

Referenced by EmitAtomicCompareExchangeOp().

◆ getAtomicAlignment()

Align llvm::AtomicInfo::getAtomicAlignment ( ) const
inline

Definition at line 38 of file Atomic.h.

References AtomicAlign.

Referenced by EmitAtomicCompareExchangeOp().

◆ getAtomicPointer()

virtual Value * llvm::AtomicInfo::getAtomicPointer ( ) const
pure virtual

◆ getAtomicSizeInBits()

uint64_t llvm::AtomicInfo::getAtomicSizeInBits ( ) const
inline

Definition at line 39 of file Atomic.h.

References AtomicSizeInBits.

Referenced by EmitAtomicLoadLibcall().

◆ getAtomicSizeValue()

Value * llvm::AtomicInfo::getAtomicSizeValue ( ) const
inline

Definition at line 67 of file Atomic.h.

References AtomicSizeInBits, llvm::IntegerType::get(), and getLLVMContext().

Referenced by EmitAtomicCompareExchangeLibcall().

◆ getAtomicTy()

Type * llvm::AtomicInfo::getAtomicTy ( ) const
inline

Definition at line 42 of file Atomic.h.

References Ty.

◆ getLLVMContext()

LLVMContext & llvm::AtomicInfo::getLLVMContext ( ) const
inline

◆ getValueSizeInBits()

uint64_t llvm::AtomicInfo::getValueSizeInBits ( ) const
inline

Definition at line 40 of file Atomic.h.

References ValueSizeInBits.

◆ hasPadding()

bool llvm::AtomicInfo::hasPadding ( ) const
inline

Definition at line 55 of file Atomic.h.

References AtomicSizeInBits, and ValueSizeInBits.

◆ shouldCastToInt()

bool AtomicInfo::shouldCastToInt ( Type * ValTy,
bool CmpXchg )

Definition at line 16 of file Atomic.cpp.

Referenced by EmitAtomicLoadOp().

◆ shouldUseLibcall()

bool llvm::AtomicInfo::shouldUseLibcall ( ) const
inline

Definition at line 41 of file Atomic.h.

References UseLibcall.

Referenced by EmitAtomicCompareExchange().

Member Data Documentation

◆ AllocaIP

IRBuilderBase::InsertPoint llvm::AtomicInfo::AllocaIP
protected

Definition at line 26 of file Atomic.h.

Referenced by AtomicInfo(), EmitAtomicLoadLibcall(), and EmitAtomicStoreLibcall().

◆ AtomicAlign

Align llvm::AtomicInfo::AtomicAlign
protected

Definition at line 23 of file Atomic.h.

Referenced by AtomicInfo(), EmitAtomicLoadOp(), and getAtomicAlignment().

◆ AtomicSizeInBits

uint64_t llvm::AtomicInfo::AtomicSizeInBits
protected

◆ Builder

◆ Ty

Type* llvm::AtomicInfo::Ty
protected

◆ UseLibcall

bool llvm::AtomicInfo::UseLibcall
protected

Definition at line 25 of file Atomic.h.

Referenced by AtomicInfo(), and shouldUseLibcall().

◆ ValueAlign

Align llvm::AtomicInfo::ValueAlign
protected

Definition at line 24 of file Atomic.h.

Referenced by AtomicInfo().

◆ ValueSizeInBits

uint64_t llvm::AtomicInfo::ValueSizeInBits
protected

Definition at line 22 of file Atomic.h.

Referenced by AtomicInfo(), getValueSizeInBits(), and hasPadding().


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