LLVM 24.0.0git
llvm::Align Struct Reference

This struct is a compact representation of a valid (non-zero power of two) alignment. More...

#include "llvm/Support/Alignment.h"

Public Member Functions

constexpr Align ()=default
 Default is byte-aligned.
constexpr Align (const Align &Other)=default
 Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other.
constexpr Align (Align &&Other)=default
constexpr Align & operator= (const Align &Other)=default
constexpr Align & operator= (Align &&Other)=default
 Align (uint64_t Value)
constexpr uint64_t value () const
 This is a hole in the type system and should not be abused.
Align previous () const

Static Public Member Functions

static constexpr Align fromLog2 (unsigned Log2Value)
 Returns an alignment of 1 << Log2Value bytes.
template<size_t kValue>
static constexpr Align Constant ()
 Allow constructions of constexpr Align.
template<typename T>
static constexpr Align Of ()
 Allow constructions of constexpr Align from types.

Friends

struct MaybeAlign
 The log2 of the required alignment.
unsigned Log2 (Align A)
 Returns the log2 of the alignment.
bool operator== (Align Lhs, Align Rhs)
 Comparisons operators between Align.
bool operator!= (Align Lhs, Align Rhs)
bool operator<= (Align Lhs, Align Rhs)
bool operator>= (Align Lhs, Align Rhs)
bool operator< (Align Lhs, Align Rhs)
bool operator> (Align Lhs, Align Rhs)
unsigned encode (struct MaybeAlign A)
 Returns a representation of the alignment that encodes undefined as 0.
struct MaybeAlign decodeMaybeAlign (unsigned Value)
 Dual operation of the encode function above.

Detailed Description

This struct is a compact representation of a valid (non-zero power of two) alignment.

It is suitable for use as static global constants.

Definition at line 39 of file Alignment.h.

Constructor & Destructor Documentation

◆ Align() [1/4]

llvm::Align::Align ( )
constexprdefault

◆ Align() [2/4]

llvm::Align::Align ( const Align & Other)
constexprdefault

Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other.

References Align(), and llvm::Other.

◆ Align() [3/4]

llvm::Align::Align ( Align && Other)
constexprdefault

References Align(), and llvm::Other.

◆ Align() [4/4]

llvm::Align::Align ( uint64_t Value)
inlineexplicit

Definition at line 65 of file Alignment.h.

References assert(), llvm::isPowerOf2_64(), llvm::Log2_64(), and uint64_t.

Member Function Documentation

◆ Constant()

template<size_t kValue>
constexpr Align llvm::Align::Constant ( )
inlinestaticconstexpr

Allow constructions of constexpr Align.

Definition at line 93 of file Alignment.h.

References Align(), llvm::ConstantLog2(), and fromLog2().

Referenced by llvm::DataLayout::DataLayout(), llvm::X86TargetLowering::getByValTypeAlignment(), and Of().

◆ fromLog2()

◆ Of()

◆ operator=() [1/2]

Align & llvm::Align::operator= ( Align && Other)
constexprdefault

References Align(), and llvm::Other.

◆ operator=() [2/2]

Align & llvm::Align::operator= ( const Align & Other)
constexprdefault

References Align(), and llvm::Other.

◆ previous()

Align llvm::Align::previous ( ) const
inline

Definition at line 85 of file Alignment.h.

References Align(), and assert().

◆ value()

uint64_t llvm::Align::value ( ) const
inlineconstexpr

This is a hole in the type system and should not be abused.

Needed to interact with C for instance.

Definition at line 82 of file Alignment.h.

References uint64_t.

Referenced by llvm::AArch64FunctionInfo::AArch64FunctionInfo(), addEmuTlsVar(), AddNodeIDCustom(), llvm::RISCVRegisterInfo::adjustReg(), llvm::MachineIRBuilder::buildAssertAlign(), buildFrameDebugInfo(), llvm::SPIRVGlobalRegistry::buildGlobalVariable(), CC_ARM_AAPCS_Custom_Aggregate(), llvm::RuntimeDyldImpl::computeSectionStubBufSize(), llvm::RuntimeDyldImpl::computeTotalAllocSize(), convertMFI(), llvm::abi::TargetInfo::convertTypeForMem(), createGEPToFramePointer(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::MCFragment::dump(), llvm::SIFrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::SIFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::XtensaFrameLowering::emitPrologue(), llvm::RuntimeDyldImpl::emitSection(), llvm::MachineFunction::estimateFunctionSizeInBytes(), getAlignment(), llvm::MachineJumpTableInfo::getEntryAlignment(), llvm::LoongArchFrameLowering::getFirstSPAdjustAmount(), llvm::RISCVFrameLowering::getFirstSPAdjustAmount(), llvm::M68kFrameLowering::getFrameIndexReference(), llvm::HexagonTTIImpl::getMemoryOpCost(), llvm::WritableMemoryBuffer::getNewUninitMemBuffer(), llvm::RISCVTargetLowering::getOptimalMemOpType(), llvm::getPTXParamAlign(), llvm::getPTXParamAlign(), llvm::HexagonTargetLowering::getStackProbeSize(), llvm::LoongArchTargetLowering::getStackProbeSize(), llvm::RISCVTargetLowering::getStackProbeSize(), llvm::ARMTTIImpl::instCombineIntrinsic(), isAgainstBoundary(), llvm::isAligned(), llvm::MemOp::isDstAligned(), isGPRShadowAligned(), llvm::MemOp::isSrcAligned(), llvm::AMDGPULegalizerInfo::legalizeLoad(), LowerAsSplatVectorLoad(), llvm::NVPTXTargetLowering::LowerCall(), llvm::NVPTXTargetLowering::LowerDYNAMIC_STACKALLOC(), llvm::MipsTargetLowering::lowerSTORE(), llvm::HexagonTargetLowering::LowerUnalignedLoad(), llvm::operator!=(), llvm::operator<(), llvm::operator<=(), llvm::operator==(), llvm::operator>(), llvm::operator>=(), llvm::PPCRegisterInfo::prepareDynamicAlloca(), llvm::MachineFrameInfo::print(), llvm::MachineMemOperand::print(), llvm::MachineBasicBlock::printName(), printParam(), llvm::AArch64FrameLowering::processFunctionBeforeFrameFinalized(), replaceFrameSizeAndAlignment(), llvm::SectionMemoryManager::reserveAllocationSpace(), llvm::RISCVMachineFunctionInfo::RISCVMachineFunctionInfo(), llvm::CoroSplitPass::run(), setAlignFlagsForFI(), solveDIType(), tocDataChecks(), tryToImproveAlign(), and tryToShorten().

◆ decodeMaybeAlign

struct MaybeAlign decodeMaybeAlign ( unsigned Value)
friend

Dual operation of the encode function above.

Definition at line 214 of file Alignment.h.

References Align(), and MaybeAlign.

Referenced by MaybeAlign.

◆ encode

unsigned encode ( struct MaybeAlign A)
friend

Returns a representation of the alignment that encodes undefined as 0.

Definition at line 211 of file Alignment.h.

References A(), and MaybeAlign.

◆ Log2

unsigned Log2 ( Align A)
friend

Returns the log2 of the alignment.

Definition at line 202 of file Alignment.h.

References A(), and Align().

◆ MaybeAlign

friend struct MaybeAlign
friend

The log2 of the required alignment.

ShiftValue is less than 64 by construction.

Definition at line 44 of file Alignment.h.

References A(), Align(), decodeMaybeAlign, and MaybeAlign.

Referenced by decodeMaybeAlign, encode, and MaybeAlign.

◆ operator!=

bool operator!= ( Align Lhs,
Align Rhs )
friend

Definition at line 256 of file Alignment.h.

References Align().

◆ operator<

bool operator< ( Align Lhs,
Align Rhs )
friend

Definition at line 265 of file Alignment.h.

References Align().

◆ operator<=

bool operator<= ( Align Lhs,
Align Rhs )
friend

Definition at line 259 of file Alignment.h.

References Align().

◆ operator==

bool operator== ( Align Lhs,
Align Rhs )
friend

Comparisons operators between Align.

Definition at line 253 of file Alignment.h.

References Align().

◆ operator>

bool operator> ( Align Lhs,
Align Rhs )
friend

Definition at line 268 of file Alignment.h.

References Align().

◆ operator>=

bool operator>= ( Align Lhs,
Align Rhs )
friend

Definition at line 262 of file Alignment.h.

References Align().


The documentation for this struct was generated from the following file: