|
LLVM
3.7.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 (unsigned Width) const |
| Returns true if the specified type is known to be a native integer type supported by the CPU. More... | |
| bool | isIllegalInteger (unsigned 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 |
| const char * | getLinkerPrivateGlobalPrefix () const |
| char | getGlobalPrefix () const |
| const char * | 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... | |
| 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 | getLargestLegalIntTypeSize () const |
| Returns the size of largest legal integer type size, or 0 if none are set. More... | |
| uint64_t | getIndexedOffset (Type *Ty, 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 104 of file DataLayout.h.
|
inlineexplicit |
Constructs a DataLayout from a specification string. See reset().
Definition at line 185 of file DataLayout.h.
References reset().
Initialize target data from properties stored in the module.
Definition at line 376 of file DataLayout.cpp.
References init().
|
inline |
Definition at line 194 of file DataLayout.h.
References llvm::DL.
| DataLayout::~DataLayout | ( | ) |
Definition at line 547 of file DataLayout.cpp.
Returns true if the given alignment exceeds the natural stack alignment.
Definition at line 249 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 304 of file DataLayout.h.
Referenced by llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), and SwitchToLookupTable().
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 680 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 674 of file DataLayout.cpp.
Referenced by computeKnownBits(), llvm::FastISel::createMachineMemOperandFor(), getAdjustedAlignment(), llvm::X86TargetLowering::getByValTypeAlignment(), llvm::TargetLoweringBase::getByValTypeAlignment(), llvm::SelectionDAG::getEVTAlignment(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), getMemsetStores(), getPreferredAlignment(), llvm::NVPTXTargetLowering::getPrototype(), getTypeAllocSize(), InlineCallIfPossible(), isDereferenceablePointer(), llvm::isSafeToLoadUnconditionally(), LLVMABIAlignmentOfType(), LLVMCallFrameAlignmentOfType(), llvm::FastISel::lowerCallTo(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::PPCTargetLowering::PerformDAGCombine(), SRAGlobal(), llvm::InstCombiner::visitLoadInst(), llvm::InstCombiner::visitStoreInst(), and XFormVExtractWithShuffleIntoLoad().
|
inline |
Definition at line 267 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.
This is used to implement getelementptr.
Definition at line 721 of file DataLayout.cpp.
References llvm::gep_type_begin(), llvm::Type::getContext(), llvm::StructLayout::getElementOffset(), llvm::Type::getInt32Ty(), getStructLayout(), llvm::Intrinsic::getType(), getTypeAllocSize(), llvm::Type::isPointerTy(), and llvm::ArrayRef< T >::size().
Referenced by llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(), and SymbolicallyEvaluateGEP().
| 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 694 of file DataLayout.cpp.
References llvm::IntegerType::get(), and getPointerSizeInBits().
Referenced by llvm::IntrinsicLowering::AddPrototypes(), CastGEPIndices(), checkStringCopyLibFuncSignature(), CoerceAvailableValueToLoadType(), llvm::ObjectSizeOffsetEvaluator::compute(), llvm::ConstantFoldCompareInstOperands(), convertPointerToIntegerType(), convertValue(), llvm::EmitFWrite(), llvm::EmitGEPOffset(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), llvm::ARMSelectionDAGInfo::EmitSpecializedLibcall(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNLen(), llvm::XCoreSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::AArch64SelectionDAGInfo::EmitTargetCodeForMemset(), llvm::X86SelectionDAGInfo::EmitTargetCodeForMemset(), EvaluateGEPOffsetExpression(), GetConstantInt(), llvm::ScalarEvolution::getEffectiveSCEVType(), llvm::IRBuilderBase::getIntPtrTy(), llvm::SelectionDAG::getMemcpy(), llvm::SelectionDAG::getMemmove(), llvm::SelectionDAG::getMemset(), GetStoreValueForLoad(), llvm::FastISel::hasTrivialKill(), isEliminableCastPair(), llvm::CastInst::isNoopCast(), llvm::AsmPrinter::lowerConstant(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::IntrinsicLowering::LowerIntrinsicCall(), PerformHeapAllocSRoA(), ReadDataFromGlobal(), simplifyAllocaArraySize(), SimplifyBranchOnICmpChain(), stripAndComputeConstantOffsets(), SymbolicallyEvaluateGEP(), 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 699 of file DataLayout.cpp.
References 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 432 of file DataLayout.h.
References llvm::Type::getIntNTy(), and getLargestLegalIntTypeSize().
| unsigned DataLayout::getLargestLegalIntTypeSize | ( | ) | const |
Returns the size of largest legal integer type size, or 0 if none are set.
Definition at line 716 of file DataLayout.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), and llvm::Max.
Referenced by getLargestLegalIntType().
|
inline |
Definition at line 261 of file DataLayout.h.
Referenced by llvm::MachineFunction::getJTISymbol(), and getNameWithPrefixImpl().
Definition at line 150 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().
Layout pointer alignment FIXME: The defaults need to be removed once all of the backends/clients are updated.
Definition at line 575 of file DataLayout.cpp.
References 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 584 of file DataLayout.cpp.
References 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 593 of file DataLayout.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by addByteCountSuffix(), llvm::AsmPrinter::doFinalization(), llvm::AddressPool::emit(), llvm::AArch64FrameLowering::emitCalleeSavedFrameMoves(), llvm::EHStreamer::emitExceptionTable(), llvm::DwarfUnit::emitHeader(), llvm::TargetLoweringBase::emitPatchPoint(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::DIEInteger::EmitValue(), llvm::MachineJumpTableInfo::getEntrySize(), llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(), getPointerSizeInBits(), llvm::DIEEntry::getRefAddrSize(), llvm::MSP430TargetLowering::getReturnAddressFrameIndex(), llvm::TargetLoweringBase::getScalarShiftAmountTy(), llvm::AsmPrinter::GetSizeOfEncodedValue(), isTargetNullPtr(), LLVMPointerSize(), LLVMPointerSizeForAS(), llvm::MSP430TargetLowering::LowerRETURNADDR(), llvm::DIEInteger::SizeOf(), llvm::DIEExpr::SizeOf(), llvm::DIELabel::SizeOf(), llvm::DIEDelta::SizeOf(), and llvm::DIELocList::SizeOf().
Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients are updated.
Definition at line 329 of file DataLayout.h.
References getPointerSize().
Referenced by llvm::GEPOperator::accumulateConstantOffset(), llvm::BitSetInfo::containsValue(), DecomposeGEPExpression(), llvm::ExecutionEngine::getConstantValue(), getIntPtrType(), getNoopInput(), llvm::TargetLoweringBase::getPointerTy(), getTypeSizeInBits(), lle_X_sprintf(), llvm::TargetLowering::ParseConstraints(), llvm::Value::stripAndAccumulateInBoundsConstantOffsets(), and llvm::WinException::WinException().
Definition at line 340 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 602 of file DataLayout.cpp.
References llvm::Type::getScalarType(), getTypeSizeInBits(), llvm::Type::isPointerTy(), and llvm::Type::isPtrOrPtrVectorTy().
Referenced by llvm::ObjectSizeOffsetVisitor::compute(), llvm::ConstantFoldInstOperands(), getBitWidth(), llvm::SelectionDAG::getGlobalAddress(), getIntPtrType(), getNaturalGEPWithType(), llvm::TargetTransformInfoImplBase::getOperationCost(), llvm::getOrEnforceKnownAlignment(), llvm::GetPointerBaseWithConstantOffset(), getPointerTypeSize(), llvm::SelectionDAG::InferPtrAlignment(), llvm::CastInst::isBitOrNoopPointerCastable(), IsConstantOffsetFromGlobal(), isDereferenceablePointer(), and llvm::AsmPrinter::lowerConstant().
| 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 761 of file DataLayout.cpp.
References getABITypeAlignment(), llvm::GlobalObject::getAlignment(), llvm::SequentialType::getElementType(), getPrefTypeAlignment(), llvm::GlobalValue::getType(), getTypeSizeInBits(), and llvm::GlobalVariable::hasInitializer().
Referenced by computeKnownBits(), getPreferredAlignmentLog(), LLVMPreferredAlignmentOfGlobal(), 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 785 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 688 of file DataLayout.cpp.
References 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 684 of file DataLayout.cpp.
Referenced by allowableAlignment(), llvm::SelectionDAG::CreateStackTemporary(), llvm::SelectionDAG::getConstantPool(), getOpenCLAlignment(), getPreferredAlignment(), getPreferredTypeAlignmentShift(), HandleByValArgument(), llvm::isSafeToLoadUnconditionally(), LLVMPreferredAlignmentOfType(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), llvm::FunctionLoweringInfo::set(), llvm::InstCombiner::visitAllocaInst(), llvm::InstCombiner::visitLoadInst(), llvm::SelectionDAGBuilder::visitSPDescriptorParent(), and llvm::InstCombiner::visitStoreInst().
|
inline |
Definition at line 281 of file DataLayout.h.
References llvm_unreachable.
Referenced by llvm::ARMAsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::MSP430MCInstLower::GetConstantPoolIndexSymbol(), llvm::AsmPrinter::GetCPISymbol(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), llvm::MachineFunction::getJTISymbol(), llvm::AsmPrinter::GetJTSetSymbol(), llvm::MSP430MCInstLower::GetJumpTableSymbol(), getNameWithPrefixImpl(), llvm::MachineFunction::getPICBaseSymbol(), llvm::PPCFunctionInfo::getPICOffsetSymbol(), GetSymbolFromOperand(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), 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 709 of file DataLayout.cpp.
References llvm::Type::getIntNTy().
|
inline |
Definition at line 253 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 225 of file DataLayout.h.
Referenced by llvm::Module::getDataLayoutStr(), and LLVMCopyStringRepOfTargetData().
| 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 551 of file DataLayout.cpp.
References llvm::StructType::getNumElements().
Referenced by llvm::GEPOperator::accumulateConstantOffset(), aliasSameBasePointerGEPs(), computeArraySize(), llvm::ComputeValueVTs(), DecomposeGEPExpression(), llvm::EmitGEPOffset(), emitGlobalConstantStruct(), EvaluateGEPOffsetExpression(), getIndexedOffset(), getNaturalGEPRecursively(), GetOffsetFromIndex(), llvm::ScalarEvolution::getOffsetOfExpr(), getTypePartition(), getTypeSizeInBits(), HasPadding(), llvm::ExecutionEngine::InitializeMemory(), isGEPFoldable(), isGEPKnownNonNull(), LLVMElementAtOffset(), LLVMOffsetOfElement(), PerformHeapAllocSRoA(), ReadDataFromGlobal(), llvm::FastISel::selectGetElementPtr(), SRAGlobal(), stripAggregateTypeWrapping(), SymbolicallyEvaluateGEP(), and TryToOptimizeStoreOfMallocToGlobal().
|
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 388 of file DataLayout.h.
References getABITypeAlignment(), getTypeStoreSize(), and llvm::RoundUpToAlignment().
Referenced by llvm::GEPOperator::accumulateConstantOffset(), addByteCountSuffix(), canReplaceGEPIdxWithZero(), computeArraySize(), llvm::ComputeValueVTs(), DecomposeGEPExpression(), 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(), FoldReinterpretLoadFromConstPtr(), llvm::getGEPInductionOperand(), getIndexedOffset(), llvm::ARMTTIImpl::getInterleavedMemoryOpCost(), llvm::AArch64TTIImpl::getInterleavedMemoryOpCost(), llvm::TargetLoweringObjectFile::getKindForGlobal(), getNaturalGEPRecursively(), getNaturalGEPWithOffset(), GetOffsetFromIndex(), llvm::NVPTXTargetLowering::getPrototype(), llvm::MachineConstantPoolEntry::getSectionKind(), llvm::ScalarEvolution::getSizeOfExpr(), llvm::SparcTargetLowering::getSRetArgSize(), llvm::getStrideFromPointer(), getTypeAllocSizeInBits(), getTypePartition(), llvm::ExecutionEngine::InitializeMemory(), llvm::MipsTargetObjectFile::IsConstantInSmallSection(), isDereferenceablePointer(), isGEPFoldable(), isGEPKnownNonNull(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSectionImpl(), llvm::isInductionPHI(), llvm::XCoreTargetLowering::isLegalAddressingMode(), isObjectSizeLessThanOrEq(), isSafeToEliminateVarargsCast(), llvm::isSafeToLoadUnconditionally(), LLVMABISizeOfType(), llvm::FastISel::lowerCallTo(), llvm::AsmPrinter::lowerConstant(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), llvm::NVPTXTargetLowering::LowerReturn(), PerformHeapAllocSRoA(), ReadDataFromGlobal(), llvm::FastISel::selectGetElementPtr(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), llvm::FunctionLoweringInfo::set(), SRAGlobal(), stripAggregateTypeWrapping(), SymbolicallyEvaluateGEP(), TryToOptimizeStoreOfMallocToGlobal(), 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 398 of file DataLayout.h.
References getTypeAllocSize().
Referenced by FoldBitCast(), FoldReinterpretLoadFromConstPtr(), llvm::ARMTTIImpl::getInterleavedMemoryOpCost(), getTypeSizeInBits(), HasPadding(), isRepeatedByteSequence(), llvm::AsmPrinter::lowerConstant(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), 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 507 of file DataLayout.h.
References llvm::Type::ArrayTyID, llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::SequentialType::getElementType(), llvm::Type::getIntegerBitWidth(), llvm::ArrayType::getNumElements(), llvm::VectorType::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 AnalyzeLoadFromClobberingLoad(), AnalyzeLoadFromClobberingStore(), AnalyzeLoadFromClobberingWrite(), CanCoerceMustAliasedValueToLoad(), canConvertValue(), llvm::FastISel::canFoldAddIntoGEP(), CoerceAvailableValueToLoadType(), combineLoadToOperationType(), computeKnownBits(), ComputeNumSignBits(), ConstantFoldLoadThroughBitcast(), FoldBitCast(), llvm::ExecutionEngine::getConstantValue(), GetMemInstValueForLoad(), getMemSetPatternValue(), getNaturalGEPRecursively(), llvm::TargetTransformInfoImplBase::getOperationCost(), getPointerTypeSizeInBits(), getPreferredAlignment(), GetStoreValueForLoad(), llvm::ScalarEvolution::getTypeSizeInBits(), getTypeStoreSize(), HasPadding(), isIntegerWideningViable(), llvm::AArch64TargetLowering::isLegalAddressingMode(), isSimpleEnoughValueToCommitHelper(), isVectorPromotionViable(), LLVMSizeOfTypeInBits(), llvm::TargetLowering::ParseConstraints(), stripAggregateTypeWrapping(), SymbolicallyEvaluateBinop(), and SymbolicallyEvaluateGEP().
|
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 371 of file DataLayout.h.
References getTypeSizeInBits().
Referenced by AnalyzeLoadFromClobberingLoad(), CanShareConstantPoolEntry(), llvm::IRBuilder< true, TargetFolder >::CreateExtractInteger(), llvm::FastISel::createMachineMemOperandFor(), emitGlobalConstantFP(), extractInteger(), llvm::FindAvailableLoadedValue(), llvm::MemoryLocation::getForArgument(), GetLoadValueForLoad(), getTypeAllocSize(), llvm::AliasAnalysis::getTypeStoreSize(), getTypeStoreSizeInBits(), HandleByValArgumentInit(), insertInteger(), isDereferenceableFromAttribute(), isDereferenceablePointer(), isIntegerWideningViableForSlice(), llvm::isSafeToLoadUnconditionally(), LLVMStoreSizeOfType(), llvm::ExecutionEngine::LoadValueFromMemory(), and llvm::ExecutionEngine::StoreValueToMemory().
|
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 379 of file DataLayout.h.
References getTypeStoreSize().
Referenced by combineLoadToOperationType(), isDereferenceableFromAttribute(), llvm::isDereferenceablePointer(), isIntegerWideningViable(), and isIntegerWideningViableForSlice().
|
inline |
Definition at line 259 of file DataLayout.h.
Referenced by llvm::AsmPrinter::EmitJumpTableInfo().
|
inline |
Definition at line 255 of file DataLayout.h.
Referenced by llvm::Mangler::getNameWithPrefix().
Definition at line 380 of file DataLayout.cpp.
References llvm::Module::getDataLayout().
Referenced by DataLayout().
|
inline |
Definition at line 218 of file DataLayout.h.
Referenced by CoerceAvailableValueToLoadType(), llvm::IRBuilder< true, TargetFolder >::CreateExtractInteger(), emitGlobalConstantFP(), emitGlobalConstantLargeInt(), ExpandBITCAST(), extractInteger(), llvm::SelectionDAG::getConstant(), getCopyFromParts(), getCopyToParts(), GetLoadValueForLoad(), getMemSetPatternValue(), llvm::TargetLoweringBase::hasBigEndianPartOrdering(), insertInteger(), isExtendedBUILD_VECTOR(), isNEONModifiedImm(), operator=(), OptimizeIntegerToVectorInsertions(), OptimizeIntToFloatBitCast(), PerformSTORECombine(), PerformVMOVRRDCombine(), and SkipExtensionForVMULL().
|
inline |
Test if the DataLayout was constructed from an empty string.
Definition at line 230 of file DataLayout.h.
Referenced by llvm::ExecutionEngine::getMangledName().
Definition at line 246 of file DataLayout.h.
References isLegalInteger().
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 239 of file DataLayout.h.
Referenced by llvm::IVUsers::AddUsersImpl(), combineLoadToOperationType(), llvm::TargetTransformInfoImplBase::getOperationCost(), isIllegalInteger(), isIntegerWideningViable(), visitIVCast(), and llvm::InstCombiner::visitPHINode().
|
inline |
Layout endianness...
Definition at line 217 of file DataLayout.h.
Referenced by llvm::DwarfUnit::addConstantFPValue(), llvm::DwarfUnit::addConstantValue(), llvm::ConstantFoldLoadFromConstPtr(), ExpandUnalignedLoad(), ExpandUnalignedStore(), FoldBitCast(), FoldReinterpretLoadFromConstPtr(), 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(), LLVMByteOrder(), ReadDataFromGlobal(), ShrinkLoadReplaceStoreWithStore(), and llvm::TargetLowering::SimplifySetCC().
|
inline |
Definition at line 209 of file DataLayout.h.
References Other.
|
inline |
Definition at line 196 of file DataLayout.h.
References isBigEndian().
| bool DataLayout::operator== | ( | const DataLayout & | Other | ) | const |
Definition at line 382 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 173 of file DataLayout.cpp.
References DefaultAlignments.
Referenced by DataLayout(), and llvm::Module::setDataLayout().
1.8.6