LLVM 22.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 |
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 | |
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. |
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.
Referenced by Constant().
Do not perform checks in case of copy/move construct/assign, because the checks have been performed when building Other.
References llvm::Other.
|
constexprdefault |
References llvm::Other.
|
inlineexplicit |
Definition at line 68 of file Alignment.h.
References assert(), llvm::isPowerOf2_64(), and llvm::Log2_64().
|
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().
Allow constructions of constexpr Align from types.
Compile time equivalent to Align(alignof(T)).
Definition at line 94 of file Alignment.h.
References Constant().
Referenced by llvm::SpecificBumpPtrAllocator< T >::DestroyAll(), llvm::cas::MappedFileRegionArena::getAlign(), llvm::trailing_objects_internal::TrailingObjectsImpl< Align, BaseTy, TopTrailingObj, PrevTy, NextTy, MoreTys... >::getTrailingObjectsImpl(), llvm::trailing_objects_internal::TrailingObjectsImpl< Align, BaseTy, TopTrailingObj, PrevTy, NextTy, MoreTys... >::getTrailingObjectsImpl(), llvm::FixedStreamArray< CrossModuleExport >::operator[](), and llvm::BinaryStreamReader::readArray().
References llvm::Other.
References llvm::Other.
|
inline |
Definition at line 80 of file Alignment.h.
References assert().
|
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().
|
friend |
Dual operation of the encode function above.
Definition at line 209 of file Alignment.h.
References MaybeAlign.
Referenced by MaybeAlign.
|
friend |
Returns a representation of the alignment that encodes undefined as 0.
Definition at line 206 of file Alignment.h.
References A(), and 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.
Definition at line 251 of file Alignment.h.
Definition at line 260 of file Alignment.h.
Definition at line 254 of file Alignment.h.
Comparisons operators between Align.
Definition at line 248 of file Alignment.h.
Definition at line 263 of file Alignment.h.
Definition at line 257 of file Alignment.h.