LLVM 20.0.0git
|
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 |
Align & | operator= (const Align &Other)=default |
Align & | operator= (Align &&Other)=default |
Align (uint64_t Value) | |
uint64_t | value () const |
This is a hole in the type system and should not be abused. | |
Align | previous () const |
constexpr | Align (LogValue CA) |
Constexpr constructor from LogValue type. | |
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) |
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. | |
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.
|
constexprdefault |
Default is byte-aligned.
Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other
.
|
constexprdefault |
|
inlineexplicit |
Definition at line 76 of file Alignment.h.
References assert(), llvm::isPowerOf2_64(), and llvm::Log2_64().
|
inlineconstexpr |
Constexpr constructor from LogValue type.
Definition at line 107 of file Alignment.h.
|
inlinestaticconstexpr |
Allow constructions of constexpr Align.
Definition at line 96 of file Alignment.h.
Allow constructions of constexpr Align from types.
Compile time equivalent to Align(alignof(T)).
Definition at line 102 of file Alignment.h.
|
inline |
Definition at line 88 of file Alignment.h.
References assert().
Referenced by getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), and getMemsetStores().
|
inline |
This is a hole in the type system and should not be abused.
Needed to interact with C for instance.
Definition at line 85 of file Alignment.h.
Referenced by llvm::AArch64FunctionInfo::AArch64FunctionInfo(), llvm::AttrBuilder::addAlignmentAttr(), addEmuTlsVar(), llvm::AttrBuilder::addStackAlignmentAttr(), adjustByValArgAlignment(), llvm::RISCVRegisterInfo::adjustReg(), llvm::alignAddr(), llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay >::AllocateSlow(), llvm::HexagonFrameLowering::assignCalleeSavedSpillSlots(), llvm::MachineIRBuilder::buildAssertAlign(), llvm::MachineIRBuilder::buildDynStackAlloc(), buildFrameDebugInfo(), llvm::SPIRVGlobalRegistry::buildGlobalVariable(), CC_ARM_AAPCS_Custom_Aggregate(), combineStore(), llvm::MCAssembler::computeFragmentSize(), llvm::RuntimeDyldImpl::computeSectionStubBufSize(), llvm::MIRPrinter::convert(), llvm::IRBuilderBase::CreateMaskedGather(), llvm::IRBuilderBase::CreateMaskedLoad(), llvm::IRBuilderBase::CreateMaskedScatter(), llvm::IRBuilderBase::CreateMaskedStore(), llvm::ARMFrameLowering::determineCalleeSaves(), emitAligningInstructions(), llvm::AMDGPUTargetAsmStreamer::emitAMDGPULDS(), llvm::MCELFStreamer::emitBundleAlignMode(), emitConstantSizeRepmov(), llvm::SIFrameLowering::emitEpilogue(), llvm::HexagonDAGToDAGISel::emitFunctionEntryCode(), llvm::AArch64FrameLowering::emitPrologue(), llvm::SIFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::CSKYFrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::SparcFrameLowering::emitPrologue(), llvm::WebAssemblyFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::RuntimeDyldImpl::emitSection(), llvm::ARMSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::BPFSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::ARMSelectionDAGInfo::EmitTargetCodeForMemmove(), llvm::ARMSelectionDAGInfo::EmitTargetCodeForMemset(), llvm::MCObjectStreamer::emitValueToAlignment(), llvm::HexagonEvaluator::evaluate(), llvm::MipsTargetELFStreamer::finish(), llvm::GlobalObject::getAlignment(), getAlignment(), llvm::PPCTargetLowering::getByValTypeAlignment(), llvm::X86TargetLowering::getByValTypeAlignment(), 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::WritableMemoryBuffer::getNewUninitMemBuffer(), llvm::RISCVTargetLowering::getOptimalMemOpType(), getOptimalRepmovsType(), llvm::ARMBaseInstrInfo::getOutliningTypeImpl(), llvm::SITargetLowering::getPrefLoopAlignment(), llvm::NVPTXTargetLowering::getPrototype(), llvm::TargetFrameLowering::getStackAlignment(), llvm::PPCTTIImpl::getVPMemoryOpCost(), insertSpills(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::AMDGPU::instrumentAddress(), llvm::AMDGPU::instrumentAddressImpl(), isAgainstBoundary(), llvm::isAligned(), isBitAligned(), llvm::isDereferenceableAndAlignedInLoop(), isDereferenceableAndAlignedPointer(), llvm::MemOp::isDstAligned(), isGPRShadowAligned(), llvm::MemOp::isSrcAligned(), llvm::AMDGPULegalizerInfo::legalizeLoad(), LowerAsSplatVectorLoad(), llvm::NVPTXTargetLowering::LowerCall(), llvm::ARMTargetLowering::lowerInterleavedLoad(), 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::MachineMemOperand::print(), llvm::MachineBasicBlock::printName(), replaceFrameSizeAndAlignment(), setAlignFlagsForFI(), llvm::LoongArchAsmBackend::shouldInsertExtraNopBytesForCodeAlign(), llvm::RISCVAsmBackend::shouldInsertExtraNopBytesForCodeAlign(), solveDIType(), llvm::SIInstrInfo::splitMUBUFOffset(), tocDataChecks(), TryCombineBaseUpdate(), tryToShorten(), and llvm::UnknownPadding().
|
friend |
Dual operation of the encode function above.
Definition at line 220 of file Alignment.h.
|
friend |
Returns a representation of the alignment that encodes undefined as 0.
Definition at line 217 of file Alignment.h.
Returns the log2 of the alignment.
Definition at line 208 of file Alignment.h.
|
friend |
The log2 of the required alignment.
ShiftValue is less than 64 by construction.
Definition at line 44 of file Alignment.h.
Definition at line 262 of file Alignment.h.
Definition at line 271 of file Alignment.h.
Definition at line 265 of file Alignment.h.
Comparisons operators between Align.
Definition at line 259 of file Alignment.h.
Definition at line 274 of file Alignment.h.
Definition at line 268 of file Alignment.h.