LLVM 22.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 Alignoperator= (const Align &Other)=default
constexpr Alignoperator= (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

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

Default is byte-aligned.

Referenced by Constant().

◆ 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 llvm::Other.

◆ Align() [3/4]

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

References llvm::Other.

◆ Align() [4/4]

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

Definition at line 68 of file Alignment.h.

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

Member Function Documentation

◆ Constant()

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

Allow constructions of constexpr Align.

Definition at line 88 of file Alignment.h.

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

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

◆ Of()

◆ operator=() [1/2]

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

References llvm::Other.

◆ operator=() [2/2]

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

References llvm::Other.

◆ previous()

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

Definition at line 80 of file Alignment.h.

References 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 77 of file Alignment.h.

Referenced by llvm::AArch64FunctionInfo::AArch64FunctionInfo(), addEmuTlsVar(), adjustByValArgAlignment(), llvm::RISCVRegisterInfo::adjustReg(), llvm::alignAddr(), llvm::BumpPtrAllocatorImpl< MallocAllocator, 65536 >::AllocateSlow(), llvm::AMDGPURegisterBankInfo::applyMappingDynStackAlloc(), llvm::HexagonFrameLowering::assignCalleeSavedSpillSlots(), llvm::MachineIRBuilder::buildAssertAlign(), llvm::MachineIRBuilder::buildDynStackAlloc(), buildFrameDebugInfo(), llvm::SPIRVGlobalRegistry::buildGlobalVariable(), CC_ARM_AAPCS_Custom_Aggregate(), combineStore(), llvm::RuntimeDyldImpl::computeSectionStubBufSize(), llvm::RuntimeDyldImpl::computeTotalAllocSize(), convertMFI(), llvm::IRBuilderBase::CreateMaskedGather(), llvm::IRBuilderBase::CreateMaskedLoad(), llvm::IRBuilderBase::CreateMaskedScatter(), llvm::IRBuilderBase::CreateMaskedStore(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::MCFragment::dump(), emitAligningInstructions(), llvm::AMDGPUTargetAsmStreamer::emitAMDGPULDS(), llvm::SystemZHLASMAsmStreamer::emitCodeAlignment(), llvm::SIFrameLowering::emitEpilogue(), llvm::HexagonDAGToDAGISel::emitFunctionEntryCode(), llvm::ARMFrameLowering::emitPrologue(), llvm::CSKYFrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::SIFrameLowering::emitPrologue(), llvm::WebAssemblyFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::XtensaFrameLowering::emitPrologue(), llvm::RuntimeDyldImpl::emitSection(), llvm::ARMSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::BPFSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::ARMSelectionDAGInfo::EmitTargetCodeForMemmove(), llvm::ARMSelectionDAGInfo::EmitTargetCodeForMemset(), llvm::MCObjectStreamer::emitValueToAlignment(), llvm::SystemZHLASMAsmStreamer::emitValueToAlignment(), llvm::MachineFunction::estimateFunctionSizeInBytes(), llvm::MipsTargetELFStreamer::finish(), getAlignment(), llvm::GlobalVariable::getAlignment(), llvm::LegalizerHelper::getDynStackAllocTargetPtr(), getELFSectionNameForGlobal(), llvm::MCSymbolMachO::getEncodedFlags(), llvm::MachineJumpTableInfo::getEntryAlignment(), llvm::LoongArchFrameLowering::getFirstSPAdjustAmount(), llvm::RISCVFrameLowering::getFirstSPAdjustAmount(), llvm::M68kFrameLowering::getFrameIndexReference(), llvm::AMDGPU::getInterestingMemoryOperands(), llvm::HexagonTTIImpl::getMemoryOpCost(), llvm::PPCTTIImpl::getMemoryOpCost(), llvm::WritableMemoryBuffer::getNewUninitMemBuffer(), llvm::RISCVTargetLowering::getOptimalMemOpType(), getOptimalRepType(), llvm::NVPTXTargetLowering::getPrototype(), llvm::RISCVTargetLowering::getStackProbeSize(), llvm::RISCVTTIImpl::getTgtMemIntrinsic(), insertSpills(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::AMDGPU::instrumentAddress(), llvm::AMDGPU::instrumentAddressImpl(), isAgainstBoundary(), llvm::isAligned(), isBitAligned(), llvm::isDereferenceableAndAlignedInLoop(), isDereferenceableAndAlignedPointer(), isDereferenceableAndAlignedPointerViaAssumption(), llvm::MemOp::isDstAligned(), isGPRShadowAligned(), llvm::MemOp::isSrcAligned(), llvm::AMDGPULegalizerInfo::legalizeLoad(), LowerAsSplatVectorLoad(), llvm::NVPTXTargetLowering::LowerCall(), llvm::NVPTXTargetLowering::LowerDYNAMIC_STACKALLOC(), llvm::SITargetLowering::LowerDYNAMIC_STACKALLOC(), llvm::LegalizerHelper::lowerLoad(), llvm::MipsTargetLowering::lowerSTORE(), llvm::HexagonTargetLowering::LowerUnalignedLoad(), llvm::operator!=(), llvm::operator<(), llvm::operator<=(), llvm::operator==(), llvm::operator>(), llvm::operator>=(), llvm::yaml::ScalarTraits< Align >::output(), llvm::PPCRegisterInfo::prepareDynamicAlloca(), llvm::MachineFrameInfo::print(), llvm::MachineMemOperand::print(), llvm::MachineBasicBlock::printName(), llvm::AArch64FrameLowering::processFunctionBeforeFrameFinalized(), replaceFrameSizeAndAlignment(), llvm::RISCVMachineFunctionInfo::RISCVMachineFunctionInfo(), llvm::CoroSplitPass::run(), setAlignFlagsForFI(), solveDIType(), llvm::SIInstrInfo::splitMUBUFOffset(), tocDataChecks(), TryCombineBaseUpdate(), tryToImproveAlign(), tryToShorten(), and llvm::UnknownPadding().

◆ decodeMaybeAlign

struct MaybeAlign decodeMaybeAlign ( unsigned Value)
friend

Dual operation of the encode function above.

Definition at line 209 of file Alignment.h.

References 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 206 of file Alignment.h.

References A(), and MaybeAlign.

◆ Log2

unsigned Log2 ( Align A)
friend

Returns the log2 of the alignment.

Definition at line 197 of file Alignment.h.

References A().

◆ 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(), decodeMaybeAlign, and MaybeAlign.

Referenced by decodeMaybeAlign, encode, and MaybeAlign.

◆ operator!=

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

Definition at line 251 of file Alignment.h.

◆ operator<

bool operator< ( Align Lhs,
Align Rhs )
friend

Definition at line 260 of file Alignment.h.

◆ operator<=

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

Definition at line 254 of file Alignment.h.

◆ operator==

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

Comparisons operators between Align.

Definition at line 248 of file Alignment.h.

◆ operator>

bool operator> ( Align Lhs,
Align Rhs )
friend

Definition at line 263 of file Alignment.h.

◆ operator>=

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

Definition at line 257 of file Alignment.h.


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