|
LLVM
4.0.0
|
A parsed version of the target data layout string in and methods for querying it. More...
#include <DataLayout.h>
Public Member Functions | |
| DataLayout (StringRef LayoutDescription) | |
| Constructs a DataLayout from a specification string. See reset(). More... | |
| DataLayout (const Module *M) | |
| Initialize target data from properties stored in the module. More... | |
| void | init (const Module *M) |
| DataLayout (const DataLayout &DL) | |
| DataLayout & | operator= (const DataLayout &DL) |
| bool | operator== (const DataLayout &Other) const |
| bool | operator!= (const DataLayout &Other) const |
| ~DataLayout () | |
| void | reset (StringRef LayoutDescription) |
| Parse a data layout string (with fallback to default values). More... | |
| bool | isLittleEndian () const |
| Layout endianness... More... | |
| bool | isBigEndian () const |
| const std::string & | getStringRepresentation () const |
| Returns the string representation of the DataLayout. More... | |
| bool | isDefault () const |
| Test if the DataLayout was constructed from an empty string. More... | |
| bool | isLegalInteger (uint64_t Width) const |
| Returns true if the specified type is known to be a native integer type supported by the CPU. More... | |
| bool | isIllegalInteger (uint64_t Width) const |
| bool | exceedsNaturalStackAlignment (unsigned Align) const |
| Returns true if the given alignment exceeds the natural stack alignment. More... | |
| unsigned | getStackAlignment () const |
| bool | hasMicrosoftFastStdCallMangling () const |
| bool | hasLinkerPrivateGlobalPrefix () const |
| StringRef | getLinkerPrivateGlobalPrefix () const |
| char | getGlobalPrefix () const |
| StringRef | getPrivateGlobalPrefix () const |
| bool | fitsInLegalInteger (unsigned Width) const |
| Returns true if the specified type fits in a native integer type supported by the CPU. More... | |
| unsigned | getPointerABIAlignment (unsigned AS=0) const |
| Layout pointer alignment FIXME: The defaults need to be removed once all of the backends/clients are updated. More... | |
| unsigned | getPointerPrefAlignment (unsigned AS=0) const |
| Return target's alignment for stack-based pointers FIXME: The defaults need to be removed once all of the backends/clients are updated. More... | |
| unsigned | getPointerSize (unsigned AS=0) const |
| Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updated. More... | |
| ArrayRef< unsigned > | getNonIntegralAddressSpaces () const |
| Return the address spaces containing non-integral pointers. More... | |
| bool | isNonIntegralPointerType (PointerType *PT) const |
| bool | isNonIntegralPointerType (Type *Ty) const |
| unsigned | getPointerSizeInBits (unsigned AS=0) const |
| Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients are updated. More... | |
| unsigned | getPointerTypeSizeInBits (Type *) const |
| Layout pointer size, in bits, based on the type. More... | |
| unsigned | getPointerTypeSize (Type *Ty) const |
| uint64_t | getTypeSizeInBits (Type *Ty) const |
| Size examples: More... | |
| uint64_t | getTypeStoreSize (Type *Ty) const |
| Returns the maximum number of bytes that may be overwritten by storing the specified type. More... | |
| uint64_t | getTypeStoreSizeInBits (Type *Ty) const |
| Returns the maximum number of bits that may be overwritten by storing the specified type; always a multiple of 8. More... | |
| uint64_t | getTypeAllocSize (Type *Ty) const |
| Returns the offset in bytes between successive objects of the specified type, including alignment padding. More... | |
| uint64_t | getTypeAllocSizeInBits (Type *Ty) const |
| Returns the offset in bits between successive objects of the specified type, including alignment padding; always a multiple of 8. More... | |
| unsigned | getABITypeAlignment (Type *Ty) const |
| Returns the minimum ABI-required alignment for the specified type. More... | |
| unsigned | getABIIntegerTypeAlignment (unsigned BitWidth) const |
| Returns the minimum ABI-required alignment for an integer type of the specified bitwidth. More... | |
| unsigned | getPrefTypeAlignment (Type *Ty) const |
| Returns the preferred stack/global alignment for the specified type. More... | |
| unsigned | getPreferredTypeAlignmentShift (Type *Ty) const |
| Returns the preferred alignment for the specified type, returned as log2 of the value (a shift amount). More... | |
| IntegerType * | getIntPtrType (LLVMContext &C, unsigned AddressSpace=0) const |
| Returns an integer type with size at least as big as that of a pointer in the given address space. More... | |
| Type * | getIntPtrType (Type *) const |
| Returns an integer (vector of integer) type with size at least as big as that of a pointer of the given pointer (vector of pointer) type. More... | |
| Type * | getSmallestLegalIntType (LLVMContext &C, unsigned Width=0) const |
| Returns the smallest integer type with size at least as big as Width bits. More... | |
| Type * | getLargestLegalIntType (LLVMContext &C) const |
| Returns the largest legal integer type, or null if none are set. More... | |
| unsigned | getLargestLegalIntTypeSizeInBits () const |
| Returns the size of largest legal integer type size, or 0 if none are set. More... | |
| int64_t | getIndexedOffsetInType (Type *ElemTy, ArrayRef< Value * > Indices) const |
| Returns the offset from the beginning of the type for the specified indices. More... | |
| const StructLayout * | getStructLayout (StructType *Ty) const |
| Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of its fields. More... | |
| unsigned | getPreferredAlignment (const GlobalVariable *GV) const |
| Returns the preferred alignment of the specified global. More... | |
| unsigned | getPreferredAlignmentLog (const GlobalVariable *GV) const |
| Returns the preferred alignment of the specified global, returned in log form. More... | |
Static Public Member Functions | |
| static const char * | getManglingComponent (const Triple &T) |
A parsed version of the target data layout string in and methods for querying it.
The target data layout string is specified by the target - a frontend generating LLVM IR is required to generate the right target data for the target being codegen'd to.
Definition at line 102 of file DataLayout.h.
|
inlineexplicit |
Constructs a DataLayout from a specification string. See reset().
Definition at line 187 of file DataLayout.h.
References reset().
Initialize target data from properties stored in the module.
Definition at line 395 of file DataLayout.cpp.
References init().
|
inline |
Definition at line 196 of file DataLayout.h.
| DataLayout::~DataLayout | ( | ) |
Definition at line 562 of file DataLayout.cpp.
Returns true if the given alignment exceeds the natural stack alignment.
Definition at line 252 of file DataLayout.h.
Referenced by enforceKnownAlignment(), and getMemcpyLoadsAndStores().
Returns true if the specified type fits in a native integer type supported by the CPU.
For example, if the CPU only supports i32 as a native integer type, then i27 fits in a legal integer type but i45 does not.
Definition at line 307 of file DataLayout.h.
Referenced by llvm::MemoryDependenceResults::getLoadLoadClobberFullWidthSize(), and ReduceSwitchRange().
Returns the minimum ABI-required alignment for an integer type of the specified bitwidth.
getABIIntegerTypeAlignment - Return the minimum ABI-required alignment for an integer type of the specified bitwidth.
Definition at line 695 of file DataLayout.cpp.
References llvm::INTEGER_ALIGN.
Referenced by llvm::MachineJumpTableInfo::getEntryAlignment().
Returns the minimum ABI-required alignment for the specified type.
Definition at line 689 of file DataLayout.cpp.
Referenced by llvm::AMDGPUMachineFunction::allocateLDSGlobal(), llvm::TargetLoweringBase::allowsMemoryAccess(), llvm::analyzeStandardArguments(), llvm::FastISel::createMachineMemOperandFor(), findCommonAlignment(), getAdjustedAlignment(), llvm::X86TargetLowering::getByValTypeAlignment(), llvm::TargetLoweringBase::getByValTypeAlignment(), llvm::SelectionDAG::getConstantPool(), llvm::SelectionDAG::getEVTAlignment(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), llvm::Value::getPointerAlignment(), getPreferredAlignment(), llvm::NVPTXTargetLowering::getPrototype(), getRuntimeMDForKernelArg(), getTypeAllocSize(), isAligned(), llvm::isDereferenceableAndAlignedPointer(), llvm::HexagonTargetLowering::isLegalAddressingMode(), llvm::isSafeToLoadUnconditionally(), llvm::FastISel::lowerCallTo(), llvm::NVPTXTargetLowering::LowerFormalArguments(), mergeInlinedArrayAllocas(), llvm::PPCTargetLowering::PerformDAGCombine(), llvm::promoteLoopAccessesToScalars(), llvm::CallLowering::setArgFlags(), SRAGlobal(), unpackLoadToAggregate(), unpackStoreToAggregate(), llvm::InstCombiner::visitLoadInst(), llvm::InstCombiner::visitStoreInst(), and XFormVExtractWithShuffleIntoLoad().
|
inline |
Definition at line 270 of file DataLayout.h.
References llvm_unreachable.
Referenced by llvm::TargetLoweringObjectFileCOFF::emitLinkerFlagsForGlobal(), llvm::Mangler::getNameWithPrefix(), and getNameWithPrefixImpl().
Returns the offset from the beginning of the type for the specified indices.
Note that this takes the element type, not the pointer type. This is used to implement getelementptr.
Definition at line 736 of file DataLayout.cpp.
References assert(), llvm::gep_type_begin(), llvm::gep_type_end(), llvm::StructLayout::getElementOffset(), llvm::generic_gep_type_iterator< ItTy >::getIndexedType(), llvm::generic_gep_type_iterator< ItTy >::getOperand(), getStructLayout(), llvm::generic_gep_type_iterator< ItTy >::getStructTypeOrNull(), llvm::Value::getType(), getTypeAllocSize(), and llvm::Type::isIntegerTy().
Referenced by findLoadCallsAtConstantOffset().
| IntegerType * DataLayout::getIntPtrType | ( | LLVMContext & | C, |
| unsigned | AddressSpace = 0 |
||
| ) | const |
Returns an integer type with size at least as big as that of a pointer in the given address space.
Definition at line 709 of file DataLayout.cpp.
References llvm::IntegerType::get(), and getPointerSizeInBits().
Referenced by llvm::IntrinsicLowering::AddPrototypes(), CoerceAvailableValueToLoadType(), llvm::ObjectSizeOffsetEvaluator::compute(), llvm::ConstantFoldCompareInstOperands(), convertPointerToIntegerType(), convertValue(), createMaskInstrs(), emitCalloc(), llvm::emitFWrite(), llvm::EmitGEPOffset(), llvm::emitMemChr(), llvm::emitMemCmp(), llvm::emitMemCpyChk(), llvm::ARMSelectionDAGInfo::EmitSpecializedLibcall(), llvm::emitStrLen(), llvm::emitStrNCmp(), llvm::HexagonSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::XCoreSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::AArch64SelectionDAGInfo::EmitTargetCodeForMemset(), llvm::X86SelectionDAGInfo::EmitTargetCodeForMemset(), evaluateGEPOffsetExpression(), foldMallocMemset(), GetConstantInt(), llvm::ScalarEvolution::getEffectiveSCEVType(), llvm::IRBuilderBase::getIntPtrTy(), llvm::SelectionDAG::getMemcpy(), llvm::SelectionDAG::getMemmove(), llvm::SelectionDAG::getMemset(), GetStoreValueForLoad(), llvm::FastISel::hasTrivialKill(), llvm::CastInst::isNoopCast(), llvm::AsmPrinter::lowerConstant(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::IntrinsicLowering::LowerIntrinsicCall(), PerformHeapAllocSRoA(), simplifyAllocaArraySize(), SimplifyBranchOnICmpChain(), stripAndComputeConstantOffsets(), tryToOptimizeStoreOfMallocToGlobal(), and llvm::PtrUseVisitor< SliceBuilder >::visitPtr().
Returns an integer (vector of integer) type with size at least as big as that of a pointer of the given pointer (vector of pointer) type.
Definition at line 714 of file DataLayout.cpp.
References assert(), llvm::IntegerType::get(), llvm::VectorType::get(), llvm::Type::getContext(), getPointerTypeSizeInBits(), and llvm::Type::isPtrOrPtrVectorTy().
|
inline |
Returns the largest legal integer type, or null if none are set.
Definition at line 452 of file DataLayout.h.
References llvm::Type::getIntNTy(), and getLargestLegalIntTypeSizeInBits().
| unsigned DataLayout::getLargestLegalIntTypeSizeInBits | ( | ) | const |
Returns the size of largest legal integer type size, or 0 if none are set.
Definition at line 731 of file DataLayout.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), and llvm::Max.
Referenced by canUseSizedAtomicCall(), despeculateCountZeros(), and getLargestLegalIntType().
|
inline |
Definition at line 264 of file DataLayout.h.
Referenced by llvm::MachineFunction::getJTISymbol(), and getNameWithPrefixImpl().
Definition at line 155 of file DataLayout.cpp.
References llvm::Triple::getArch(), llvm::Triple::isOSBinFormatCOFF(), llvm::Triple::isOSBinFormatMachO(), llvm::Triple::isOSWindows(), and llvm::Triple::x86.
Referenced by computeDataLayout(), and getDataLayoutString().
Return the address spaces containing non-integral pointers.
Pointers in this address space don't have a well-defined bitwise representation.
Definition at line 331 of file DataLayout.h.
Referenced by isNonIntegralPointerType().
Layout pointer alignment FIXME: The defaults need to be removed once all of the backends/clients are updated.
Definition at line 590 of file DataLayout.cpp.
References assert(), and llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), and llvm::MachineJumpTableInfo::getEntryAlignment().
Return target's alignment for stack-based pointers FIXME: The defaults need to be removed once all of the backends/clients are updated.
Definition at line 599 of file DataLayout.cpp.
References assert(), and llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by FindOptimalMemOpLowering(), and getOpenCLAlignment().
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updated.
Definition at line 608 of file DataLayout.cpp.
References assert(), and llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by addByteCountSuffix(), llvm::AsmPrinter::doFinalization(), llvm::AddressPool::emit(), llvm::EHStreamer::emitExceptionTable(), llvm::DwarfUnit::emitHeader(), llvm::TargetLoweringBase::emitPatchPoint(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::MachineJumpTableInfo::getEntrySize(), llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(), llvm::TargetMachine::getPointerSize(), getPointerSizeInBits(), llvm::MSP430TargetLowering::getReturnAddressFrameIndex(), llvm::TargetLoweringBase::getScalarShiftAmountTy(), llvm::AsmPrinter::GetSizeOfEncodedValue(), llvm::CallLowering::handleAssignments(), isTargetNullPtr(), and llvm::MSP430TargetLowering::LowerRETURNADDR().
Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients are updated.
Definition at line 349 of file DataLayout.h.
References getPointerSize().
Referenced by llvm::GEPOperator::accumulateConstantOffset(), llvm::ComputeSignatureVTs(), llvm::ExecutionEngine::getConstantValue(), getIntPtrType(), getNoopInput(), llvm::TargetLoweringBase::getPointerTy(), getTypeSizeInBits(), llvm::isConsecutiveAccess(), isKnownTypeIdMember(), llvm::X86TTIImpl::isLegalMaskedGather(), llvm::X86TTIImpl::isLegalMaskedLoad(), lle_X_sprintf(), llvm::TargetLowering::ParseConstraints(), llvm::Value::stripAndAccumulateInBoundsConstantOffsets(), and llvm::WinException::WinException().
Definition at line 360 of file DataLayout.h.
References getPointerTypeSizeInBits().
Referenced by llvm::AsmPrinter::EmitGlobalVariable().
Layout pointer size, in bits, based on the type.
If this function is called with a pointer type, then the type size of the pointer is returned. If this function is called with a vector of pointers, then the type size of the pointer is returned. This should only be called with a pointer or vector of pointers.
Definition at line 617 of file DataLayout.cpp.
References assert(), llvm::Type::getScalarType(), getTypeSizeInBits(), llvm::Type::isPointerTy(), and llvm::Type::isPtrOrPtrVectorTy().
Referenced by llvm::ObjectSizeOffsetVisitor::compute(), llvm::ConstantFoldCastOperand(), getAsConstantIndexedAddress(), getBitWidth(), llvm::SelectionDAG::getGlobalAddress(), getIntPtrType(), getNaturalGEPWithType(), llvm::TargetTransformInfoImplBase::getOperationCost(), llvm::getOrEnforceKnownAlignment(), llvm::GetPointerBaseWithConstantOffset(), getPointerTypeSize(), llvm::SelectionDAG::InferPtrAlignment(), llvm::CastInst::isBitOrNoopPointerCastable(), llvm::IsConstantOffsetFromGlobal(), and rewriteGEPAsOffset().
| unsigned DataLayout::getPreferredAlignment | ( | const GlobalVariable * | GV | ) | const |
Returns the preferred alignment of the specified global.
getPreferredAlignment - Return the preferred alignment of the specified global.
This includes an explicitly requested alignment (if the global has one).
Definition at line 767 of file DataLayout.cpp.
References getABITypeAlignment(), llvm::GlobalObject::getAlignment(), getPrefTypeAlignment(), getTypeSizeInBits(), llvm::GlobalValue::getValueType(), and llvm::GlobalVariable::hasInitializer().
Referenced by getAlignment(), llvm::Value::getPointerAlignment(), getPreferredAlignmentLog(), selectELFSectionForGlobal(), and llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal().
| unsigned DataLayout::getPreferredAlignmentLog | ( | const GlobalVariable * | GV | ) | const |
Returns the preferred alignment of the specified global, returned in log form.
getPreferredAlignmentLog - Return the preferred alignment of the specified global, returned in log form.
This includes an explicitly requested alignment (if the global has one).
Definition at line 791 of file DataLayout.cpp.
References getPreferredAlignment(), and llvm::Log2_32().
Referenced by getGVAlignmentLog2().
Returns the preferred alignment for the specified type, returned as log2 of the value (a shift amount).
Definition at line 703 of file DataLayout.cpp.
References assert(), getPrefTypeAlignment(), and llvm::Log2_32().
Returns the preferred stack/global alignment for the specified type.
This is always at least as good as the ABI alignment.
Definition at line 699 of file DataLayout.cpp.
Referenced by llvm::SelectionDAG::CreateStackTemporary(), getAddressForMemoryInput(), llvm::SelectionDAG::getConstantPool(), getOpenCLAlignment(), llvm::Value::getPointerAlignment(), getPreferredAlignment(), getPreferredTypeAlignmentShift(), HandleByValArgument(), llvm::MIRParserImpl::initializeConstantPool(), llvm::isSafeToLoadUnconditionally(), llvm::FunctionLoweringInfo::set(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitLoadInst(), llvm::SelectionDAGBuilder::visitSPDescriptorParent(), and llvm::InstCombiner::visitStoreInst().
|
inline |
Definition at line 284 of file DataLayout.h.
References llvm_unreachable.
Referenced by llvm::ARMAsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::MSP430MCInstLower::GetConstantPoolIndexSymbol(), llvm::AsmPrinter::GetCPISymbol(), llvm::PPCFunctionInfo::getGlobalEPSymbol(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::MachineFunction::getJTISymbol(), llvm::AsmPrinter::GetJTSetSymbol(), llvm::MSP430MCInstLower::GetJumpTableSymbol(), llvm::PPCFunctionInfo::getLocalEPSymbol(), getNameWithPrefixImpl(), llvm::MachineFunction::getPICBaseSymbol(), llvm::PPCFunctionInfo::getPICOffsetSymbol(), GetSymbolFromOperand(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::PPCFunctionInfo::getTOCOffsetSymbol(), llvm::MipsAsmPrinter::printOperand(), and llvm::AsmPrinter::PrintSpecial().
| Type * DataLayout::getSmallestLegalIntType | ( | LLVMContext & | C, |
| unsigned | Width = 0 |
||
| ) | const |
Returns the smallest integer type with size at least as big as Width bits.
Definition at line 724 of file DataLayout.cpp.
References llvm::Type::getIntNTy().
|
inline |
Definition at line 256 of file DataLayout.h.
|
inline |
Returns the string representation of the DataLayout.
This representation is in the same format accepted by the string constructor above. This should not be used to compare two DataLayout as different string can represent the same layout.
Definition at line 228 of file DataLayout.h.
Referenced by llvm::Module::getDataLayoutStr().
| const StructLayout * DataLayout::getStructLayout | ( | StructType * | Ty | ) | const |
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of its fields.
Note that this information is lazily cached.
Definition at line 566 of file DataLayout.cpp.
References llvm::StructType::getNumElements(), and L.
Referenced by llvm::GEPOperator::accumulateConstantOffset(), aliasSameBasePointerGEPs(), computeArraySize(), llvm::ComputeValueVTs(), llvm::EmitGEPOffset(), emitGlobalConstantStruct(), evaluateGEPOffsetExpression(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getGEPCost(), getIndexedOffsetInType(), getNaturalGEPRecursively(), GetOffsetFromIndex(), getTypePartition(), getTypeSizeInBits(), llvm::ExecutionEngine::InitializeMemory(), isDenselyPacked(), PerformHeapAllocSRoA(), llvm::FastISel::selectGetElementPtr(), SRAGlobal(), stripAggregateTypeWrapping(), tryToOptimizeStoreOfMallocToGlobal(), unpackLoadToAggregate(), and unpackStoreToAggregate().
|
inline |
Returns the offset in bytes between successive objects of the specified type, including alignment padding.
This is the amount that alloca reserves for this type. For example, returns 12 or 16 for x86_fp80, depending on alignment.
Definition at line 408 of file DataLayout.h.
References llvm::alignTo(), getABITypeAlignment(), and getTypeStoreSize().
Referenced by llvm::GEPOperator::accumulateConstantOffset(), addByteCountSuffix(), llvm::AMDGPUMachineFunction::allocateLDSGlobal(), llvm::analyzeStandardArguments(), canReplaceGEPIdxWithZero(), computeArraySize(), llvm::ComputeValueVTs(), llvm::AsmPrinter::EmitConstantPool(), llvm::EmitGEPOffset(), llvm::AsmPrinter::EmitGlobalConstant(), emitGlobalConstantArray(), emitGlobalConstantDataSequential(), emitGlobalConstantFP(), emitGlobalConstantImpl(), emitGlobalConstantLargeInt(), emitGlobalConstantStruct(), emitGlobalConstantVector(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::ExecutionEngine::EmitGlobalVariable(), llvm::SystemZAsmPrinter::EmitMachineConstantPoolValue(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::ARMAsmPrinter::EmitXXStructor(), evaluateGEPOffsetExpression(), getAddressForMemoryInput(), llvm::lto::InputFile::Symbol::getCommonSize(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getGEPCost(), llvm::getGEPInductionOperand(), getIndexedOffsetInType(), getNaturalGEPRecursively(), getNaturalGEPWithOffset(), GetOffsetFromIndex(), llvm::NVPTXTargetLowering::getPrototype(), getRuntimeMDForKernelArg(), llvm::MachineConstantPoolEntry::getSectionKind(), llvm::SparcTargetLowering::getSRetArgSize(), getTypeAllocSizeInBits(), getTypePartition(), llvm::ExecutionEngine::InitializeMemory(), llvm::LanaiTargetObjectFile::isConstantInSmallSection(), llvm::MipsTargetObjectFile::IsConstantInSmallSection(), llvm::InductionDescriptor::isInductionPHI(), llvm::XCoreTargetLowering::isLegalAddressingMode(), isObjectSizeLessThanOrEq(), isSafeToEliminateVarargsCast(), llvm::isSafeToLoadUnconditionally(), llvm::NVPTXTargetLowering::LowerCall(), llvm::FastISel::lowerCallTo(), llvm::AsmPrinter::lowerConstant(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::NVPTXTargetLowering::LowerReturn(), PerformHeapAllocSRoA(), promoteToConstantPool(), replaceFrameSize(), llvm::FastISel::selectGetElementPtr(), llvm::FunctionLoweringInfo::set(), llvm::CallLowering::setArgFlags(), SRAGlobal(), stripAggregateTypeWrapping(), tryToOptimizeStoreOfMallocToGlobal(), unpackLoadToAggregate(), unpackStoreToAggregate(), llvm::Interpreter::visitAllocaInst(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), llvm::ObjectSizeOffsetEvaluator::visitAllocaInst(), llvm::InstCombiner::visitAllocaInst(), llvm::ObjectSizeOffsetVisitor::visitArgument(), and llvm::ObjectSizeOffsetVisitor::visitGlobalVariable().
|
inline |
Returns the offset in bits between successive objects of the specified type, including alignment padding; always a multiple of 8.
This is the amount that alloca reserves for this type. For example, returns 96 or 128 for x86_fp80, depending on alignment.
Definition at line 418 of file DataLayout.h.
References getTypeAllocSize().
Referenced by getTypeSizeInBits(), isDenselyPacked(), isRepeatedByteSequence(), llvm::NVPTXTargetLowering::LowerCall(), llvm::AsmPrinter::lowerConstant(), and llvm::NVPTXTargetLowering::LowerReturn().
|
inline |
Size examples:
Type SizeInBits StoreSizeInBits AllocSizeInBits[*]
i1 1 8 8 i8 8 8 8 i19 19 24 32 i32 32 32 32 i100 100 104 128 i128 128 128 128 Float 32 32 32 Double 64 64 64 X86_FP80 80 80 96
[*] The alloc size depends on the alignment, and thus on the target. These values are for x86-32 linux. Returns the number of bits necessary to hold the specified type.
For example, returns 36 for i36 and 80 for x86_fp80. The type passed must have a size (Type::isSized() must return true).
Definition at line 533 of file DataLayout.h.
References llvm::Type::ArrayTyID, assert(), llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::SequentialType::getElementType(), llvm::Type::getIntegerBitWidth(), llvm::SequentialType::getNumElements(), llvm::Type::getPointerAddressSpace(), getPointerSizeInBits(), llvm::StructLayout::getSizeInBits(), getStructLayout(), getTypeAllocSizeInBits(), llvm::Type::getTypeID(), llvm::Type::HalfTyID, llvm::Type::IntegerTyID, llvm::Type::isSized(), llvm::Type::LabelTyID, llvm_unreachable, llvm::Type::PointerTyID, llvm::Type::PPC_FP128TyID, llvm::Type::StructTyID, llvm::Type::VectorTyID, llvm::Type::X86_FP80TyID, and llvm::Type::X86_MMXTyID.
Referenced by llvm::sroa::AllocaSliceRewriter::AllocaSliceRewriter(), AnalyzeLoadFromClobberingLoad(), AnalyzeLoadFromClobberingStore(), AnalyzeLoadFromClobberingWrite(), CanCoerceMustAliasedValueToLoad(), canConvertValue(), llvm::FastISel::canFoldAddIntoGEP(), CoerceAvailableValueToLoadType(), combineLoadToNewType(), combineLoadToOperationType(), llvm::slpvectorizer::BoUpSLP::computeMinimumValueSizes(), llvm::ConvertDebugDeclareToDebugValue(), llvm::ExecutionEngine::getConstantValue(), llvm::DemandedBits::getDemandedBits(), llvm::ARMTTIImpl::getInterleavedMemoryOpCost(), llvm::AArch64TTIImpl::getInterleavedMemoryOpCost(), GetMemInstValueForLoad(), getMemSetPatternValue(), getNaturalGEPRecursively(), llvm::TargetTransformInfoImplBase::getOperationCost(), getPointerTypeSizeInBits(), getPreferredAlignment(), getStoreSizeInBytes(), GetStoreValueForLoad(), llvm::ScalarEvolution::getTypeSizeInBits(), getTypeStoreSize(), llvm::SystemZTTIImpl::getUnrollingPreferences(), llvm::slpvectorizer::BoUpSLP::getVectorElementSize(), isDenselyPacked(), llvm::isDereferenceableAndAlignedPointer(), isIntegerWideningViable(), llvm::AArch64TargetLowering::isLegalAddressingMode(), isSimpleEnoughValueToCommitHelper(), isVectorPromotionViable(), llvm::LLT::LLT(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::TargetLowering::ParseConstraints(), llvm::parseFunctionArgs(), and stripAggregateTypeWrapping().
|
inline |
Returns the maximum number of bytes that may be overwritten by storing the specified type.
For example, returns 5 for i36 and 10 for x86_fp80.
Definition at line 391 of file DataLayout.h.
References getTypeSizeInBits().
Referenced by llvm::AliasSetTracker::add(), aliasSameBasePointerGEPs(), AnalyzeLoadFromClobberingLoad(), CanShareConstantPoolEntry(), llvm::canSinkOrHoistInst(), llvm::IRBuilder< TargetFolder >::CreateExtractInteger(), llvm::FastISel::createMachineMemOperandFor(), createMaskInstrs(), emitGlobalConstantFP(), llvm::Evaluator::EvaluateBlock(), extractInteger(), llvm::FindAvailableLoadedValue(), llvm::MemoryLocation::getForArgument(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getInterleavedMemoryOpCost(), llvm::X86TTIImpl::getInterleavedMemoryOpCostAVX512(), GetLoadValueForLoad(), llvm::Value::getPointerDereferenceableBytes(), llvm::X86TTIImpl::getShuffleCost(), getTypeAllocSize(), getTypeStoreSizeInBits(), HandleByValArgumentInit(), insertInteger(), llvm::isConsecutiveAccess(), llvm::isDereferenceableAndAlignedPointer(), isIntegerWideningViableForSlice(), llvm::SITargetLowering::isLegalAddressingMode(), isPointerValueDeadOnEntryToFunction(), llvm::isSafeToLoadUnconditionally(), llvm::ExecutionEngine::LoadValueFromMemory(), llvm::HexagonTargetLowering::shouldExpandAtomicCmpXchgInIR(), llvm::ExecutionEngine::StoreValueToMemory(), and underlyingObjectsAlias().
|
inline |
Returns the maximum number of bits that may be overwritten by storing the specified type; always a multiple of 8.
For example, returns 40 for i36 and 80 for x86_fp80.
Definition at line 399 of file DataLayout.h.
References getTypeStoreSize().
Referenced by llvm::slpvectorizer::BoUpSLP::canMapToVector(), CoerceAvailableValueToLoadType(), combineLoadToOperationType(), instrumentMaskedLoadOrStore(), isAligned(), isIntegerWideningViable(), and isIntegerWideningViableForSlice().
|
inline |
Definition at line 262 of file DataLayout.h.
Referenced by llvm::AsmPrinter::EmitJumpTableInfo().
|
inline |
Definition at line 258 of file DataLayout.h.
Referenced by llvm::Mangler::getNameWithPrefix().
Definition at line 399 of file DataLayout.cpp.
References llvm::Module::getDataLayout().
Referenced by DataLayout().
|
inline |
Definition at line 221 of file DataLayout.h.
Referenced by CoerceAvailableValueToLoadType(), llvm::IRBuilder< TargetFolder >::CreateExtractInteger(), emitGlobalConstantFP(), emitGlobalConstantLargeInt(), ExpandBITCAST(), extractInteger(), foldVecTruncToExtElt(), llvm::SelectionDAG::getConstant(), getCopyFromParts(), getCopyToParts(), GetLoadValueForLoad(), getMemSetPatternValue(), getPPCf128HiElementSelector(), llvm::TargetLoweringBase::hasBigEndianPartOrdering(), insertInteger(), isExtendedBUILD_VECTOR(), isNEONModifiedImm(), operator=(), optimizeIntegerToVectorInsertions(), PerformSTORECombine(), PerformVMOVRRDCombine(), and SkipExtensionForVMULL().
|
inline |
Test if the DataLayout was constructed from an empty string.
Definition at line 233 of file DataLayout.h.
Referenced by llvm::OrcCBindingsStack::addIRModule(), and llvm::ExecutionEngine::getMangledName().
|
inline |
Definition at line 249 of file DataLayout.h.
References isLegalInteger().
|
inline |
Returns true if the specified type is known to be a native integer type supported by the CPU.
For example, i64 is not native on most 32-bit CPUs and i37 is not native on any known one. This returns false if the integer width is not legal.
The width is specified in bits.
Definition at line 242 of file DataLayout.h.
Referenced by llvm::IVUsers::AddUsersImpl(), combineLoadToOperationType(), FindLoopCounter(), llvm::TargetTransformInfoImplBase::getOperationCost(), isIllegalInteger(), isIntegerWideningViable(), and visitIVCast().
|
inline |
Layout endianness...
Definition at line 220 of file DataLayout.h.
Referenced by llvm::DwarfUnit::addConstantFPValue(), llvm::DwarfUnit::addConstantValue(), llvm::SelectionDAG::computeKnownBits(), llvm::ConstantFoldLoadFromConstPtr(), createMaskInstrs(), llvm::TargetLowering::expandUnalignedLoad(), llvm::TargetLowering::expandUnalignedStore(), getMemsetStringVal(), llvm::TargetInstrInfo::getStackSlotRange(), GetStoreValueForLoad(), llvm::PPC::getVSPLTImmediate(), llvm::PPC::isVMRGEOShuffleMask(), llvm::PPC::isVMRGHShuffleMask(), llvm::PPC::isVMRGLShuffleMask(), llvm::PPC::isVPKUDUMShuffleMask(), llvm::PPC::isVPKUHUMShuffleMask(), llvm::PPC::isVPKUWUMShuffleMask(), llvm::PPC::isVSLDOIShuffleMask(), LowerF64Op(), llvm::SparcTargetLowering::LowerFormalArguments_32(), ShrinkLoadReplaceStoreWithStore(), and llvm::TargetLowering::SimplifySetCC().
|
inline |
Definition at line 335 of file DataLayout.h.
References llvm::ArrayRef< T >::end(), llvm::find(), llvm::PointerType::getAddressSpace(), and getNonIntegralAddressSpaces().
Referenced by combineLoadToOperationType(), and isNonIntegralPointerType().
Definition at line 341 of file DataLayout.h.
References llvm::dyn_cast(), and isNonIntegralPointerType().
|
inline |
Definition at line 212 of file DataLayout.h.
|
inline |
Definition at line 198 of file DataLayout.h.
References isBigEndian().
| bool DataLayout::operator== | ( | const DataLayout & | Other | ) | const |
Definition at line 401 of file DataLayout.cpp.
References llvm::MipsISD::Ret.
| void DataLayout::reset | ( | StringRef | LayoutDescription | ) |
Parse a data layout string (with fallback to default values).
Definition at line 178 of file DataLayout.cpp.
References llvm::SmallVectorImpl< T >::clear(), DefaultAlignments, and E.
Referenced by DataLayout(), and llvm::Module::setDataLayout().
1.8.6