[llvm-commits] [llvm] r71349 - in /llvm/trunk: bindings/ocaml/target/ include/llvm-c/ include/llvm/Target/ lib/Analysis/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/ExecutionEngine/Interpreter/ lib/ExecutionEngine/JIT/ lib/Target/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/AsmPrinter/ lib/Target/CBackend/ lib/Target/CellSPU/AsmPrinter/ lib/Target/IA64/AsmPrinter/ lib/Target/MSIL/ lib/Target/Mips/ lib/Target/Mips/AsmPrinter/ lib/Target/PIC16/ lib/Target/PowerP...
Bill Wendling
isanbard at gmail.com
Sat May 9 00:24:00 PDT 2009
Duncan,
Please make the appropriate changes in llvm-gcc. Thanks!
-bw
On May 9, 2009, at 12:06 AM, Duncan Sands wrote:
> Author: baldrick
> Date: Sat May 9 02:06:46 2009
> New Revision: 71349
>
> URL: http://llvm.org/viewvc/llvm-project?rev=71349&view=rev
> Log:
> Rename PaddedSize to AllocSize, in the hope that this
> will make it more obvious what it represents, and stop
> it being confused with the StoreSize.
>
> Modified:
> llvm/trunk/bindings/ocaml/target/llvm_target.mli
> llvm/trunk/include/llvm-c/Target.h
> llvm/trunk/include/llvm/Target/TargetData.h
> llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
> llvm/trunk/lib/Analysis/ConstantFolding.cpp
> llvm/trunk/lib/Analysis/ScalarEvolution.cpp
> llvm/trunk/lib/Analysis/ValueTracking.cpp
> llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
> llvm/trunk/lib/CodeGen/ELFWriter.cpp
> llvm/trunk/lib/CodeGen/MachOWriter.cpp
> llvm/trunk/lib/CodeGen/MachOWriter.h
> llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
> llvm/trunk/lib/CodeGen/StackProtector.cpp
> llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
> llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp
> llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
> llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
> llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
> llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
> llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
> llvm/trunk/lib/Target/CBackend/CBackend.cpp
> llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
> llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
> llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
> llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
> llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
> llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
> llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
> llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
> llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
> llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
> llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
> llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
> llvm/trunk/lib/Target/Target.cpp
> llvm/trunk/lib/Target/TargetData.cpp
> llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
> llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
> llvm/trunk/lib/Target/X86/X86FastISel.cpp
> llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
> llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
> llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp
> llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
> llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
> llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
> llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
> llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
> llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp
> llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp
> llvm/trunk/utils/TableGen/CallingConvEmitter.cpp
>
> Modified: llvm/trunk/bindings/ocaml/target/llvm_target.mli
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/target/llvm_target.mli?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/bindings/ocaml/target/llvm_target.mli (original)
> +++ llvm/trunk/bindings/ocaml/target/llvm_target.mli Sat May 9
> 02:06:46 2009
> @@ -70,7 +70,7 @@
> external store_size : TargetData.t -> Llvm.lltype -> Int64.t =
> "llvm_store_size"
>
> (** Computes the ABI size of a type in bytes for a target.
> - See the method llvm::TargetData::getTypePaddedSize. *)
> + See the method llvm::TargetData::getTypeAllocSize. *)
> external abi_size : TargetData.t -> Llvm.lltype -> Int64.t =
> "llvm_abi_size"
>
> (** Computes the ABI alignment of a type in bytes for a target.
>
> Modified: llvm/trunk/include/llvm-c/Target.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Target.h?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm-c/Target.h (original)
> +++ llvm/trunk/include/llvm-c/Target.h Sat May 9 02:06:46 2009
> @@ -70,7 +70,7 @@
> unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef,
> LLVMTypeRef);
>
> /** Computes the ABI size of a type in bytes for a target.
> - See the method llvm::TargetData::getTypePaddedSize. */
> + See the method llvm::TargetData::getTypeAllocSize. */
> unsigned long long LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef);
>
> /** Computes the ABI alignment of a type in bytes for a target.
>
> Modified: llvm/trunk/include/llvm/Target/TargetData.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Target/TargetData.h (original)
> +++ llvm/trunk/include/llvm/Target/TargetData.h Sat May 9 02:06:46
> 2009
> @@ -157,8 +157,8 @@
>
> /// Size examples:
> ///
> - /// Type SizeInBits StoreSizeInBits PaddedSizeInBits[*]
> - /// ---- ---------- --------------- ----------------
> + /// Type SizeInBits StoreSizeInBits AllocSizeInBits[*]
> + /// ---- ---------- --------------- ---------------
> /// i1 1 8 8
> /// i8 8 8 8
> /// i19 19 24 32
> @@ -169,7 +169,7 @@
> /// Double 64 64 64
> /// X86_FP80 80 80 96
> ///
> - /// [*] The padded size depends on the alignment, and thus on the
> target.
> + /// [*] The alloc size depends on the alignment, and thus on the
> target.
> /// These values are for x86-32 linux.
>
> /// getTypeSizeInBits - Return the number of bits necessary to
> hold the
> @@ -190,21 +190,21 @@
> return 8*getTypeStoreSize(Ty);
> }
>
> - /// getTypePaddedSize - Return the offset in bytes between
> successive objects
> + /// getTypeAllocSize - Return 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.
> - uint64_t getTypePaddedSize(const Type* Ty) const {
> + uint64_t getTypeAllocSize(const Type* Ty) const {
> // Round up to the next alignment boundary.
> return RoundUpAlignment(getTypeStoreSize(Ty),
> getABITypeAlignment(Ty));
> }
>
> - /// getTypePaddedSizeInBits - Return the offset in bits between
> successive
> + /// getTypeAllocSizeInBits - Return 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.
> - uint64_t getTypePaddedSizeInBits(const Type* Ty) const {
> - return 8*getTypePaddedSize(Ty);
> + uint64_t getTypeAllocSizeInBits(const Type* Ty) const {
> + return 8*getTypeAllocSize(Ty);
> }
>
> /// getABITypeAlignment - Return the minimum ABI-required
> alignment for the
>
> Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
> +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Sat May 9
> 02:06:46 2009
> @@ -123,7 +123,7 @@
> }
>
> if (AccessTy->isSized())
> - return TD.getTypePaddedSize(AccessTy) < Size;
> + return TD.getTypeAllocSize(AccessTy) < Size;
> return false;
> }
>
>
> Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Analysis/ConstantFolding.cpp (original)
> +++ llvm/trunk/lib/Analysis/ConstantFolding.cpp Sat May 9 02:06:46
> 2009
> @@ -77,7 +77,7 @@
> Offset += TD.getStructLayout(ST)->getElementOffset(CI-
> >getZExtValue());
> } else {
> const SequentialType *SQT = cast<SequentialType>(*GTI);
> - Offset += TD.getTypePaddedSize(SQT->getElementType())*CI-
> >getSExtValue();
> + Offset += TD.getTypeAllocSize(SQT->getElementType())*CI-
> >getSExtValue();
> }
> }
> return true;
> @@ -405,8 +405,8 @@
> if (const ArrayType *AT =
> dyn_cast<ArrayType>(GVTy->getElementType())) {
> const Type *ElTy = AT->getElementType();
> - uint64_t PaddedSize = TD-
> >getTypePaddedSize(ElTy);
> - APInt PSA(L->getValue().getBitWidth(),
> PaddedSize);
> + uint64_t AllocSize = TD->getTypeAllocSize(ElTy);
> + APInt PSA(L->getValue().getBitWidth(),
> AllocSize);
> if (ElTy == cast<PointerType>(DestTy)-
> >getElementType() &&
> L->getValue().urem(PSA) == 0) {
> APInt ElemIdx = L->getValue().udiv(PSA);
>
> Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
> +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat May 9 02:06:46
> 2009
> @@ -1961,7 +1961,7 @@
> IntPtrTy);
> LocalOffset =
> getMulExpr(LocalOffset,
> - getIntegerSCEV(TD->getTypePaddedSize(*GTI),
> + getIntegerSCEV(TD->getTypeAllocSize(*GTI),
> IntPtrTy));
> TotalOffset = getAddExpr(TotalOffset, LocalOffset);
> }
>
> Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
> +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Sat May 9 02:06:46 2009
> @@ -459,7 +459,7 @@
> const Type *IndexedTy = GTI.getIndexedType();
> if (!IndexedTy->isSized()) return;
> unsigned GEPOpiBits = Index->getType()-
> >getPrimitiveSizeInBits();
> - uint64_t TypeSize = TD ? TD->getTypePaddedSize(IndexedTy) :
> 1;
> + uint64_t TypeSize = TD ? TD->getTypeAllocSize(IndexedTy) : 1;
> LocalMask = APInt::getAllOnesValue(GEPOpiBits);
> LocalKnownZero = LocalKnownOne = APInt(GEPOpiBits, 0);
> ComputeMaskedBits(Index, LocalMask,
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Sat May 9
> 02:06:46 2009
> @@ -313,7 +313,7 @@
> EmitZeros(NewOffset - Offset);
>
> const Type *Ty = CPE.getType();
> - Offset = NewOffset + TM.getTargetData()->getTypePaddedSize(Ty);
> + Offset = NewOffset + TM.getTargetData()->getTypeAllocSize(Ty);
>
> O << TAI->getPrivateGlobalPrefix() << "CPI" <<
> getFunctionNumber() << '_'
> << CPI << ":\t\t\t\t\t";
> @@ -889,12 +889,12 @@
>
> // We can emit the pointer value into this slot if the slot is
> an
> // integer slot greater or equal to the size of the pointer.
> - if (TD->getTypePaddedSize(Ty) >= TD->getTypePaddedSize(Op-
> >getType()))
> + if (TD->getTypeAllocSize(Ty) >= TD->getTypeAllocSize(Op-
> >getType()))
> return EmitConstantValueOnly(Op);
>
> O << "((";
> EmitConstantValueOnly(Op);
> - APInt ptrMask = APInt::getAllOnesValue(TD-
> >getTypePaddedSizeInBits(Ty));
> + APInt ptrMask = APInt::getAllOnesValue(TD-
> >getTypeAllocSizeInBits(Ty));
>
> SmallString<40> S;
> ptrMask.toStringUnsigned(S);
> @@ -992,14 +992,14 @@
> unsigned AddrSpace) {
> // Print the fields in successive locations. Pad to align if needed!
> const TargetData *TD = TM.getTargetData();
> - unsigned Size = TD->getTypePaddedSize(CVS->getType());
> + unsigned Size = TD->getTypeAllocSize(CVS->getType());
> const StructLayout *cvsLayout = TD->getStructLayout(CVS->getType());
> uint64_t sizeSoFar = 0;
> for (unsigned i = 0, e = CVS->getNumOperands(); i != e; ++i) {
> const Constant* field = CVS->getOperand(i);
>
> // Check if padding is needed and insert one or more 0s.
> - uint64_t fieldSize = TD->getTypePaddedSize(field->getType());
> + uint64_t fieldSize = TD->getTypeAllocSize(field->getType());
> uint64_t padSize = ((i == e-1 ? Size : cvsLayout-
> >getElementOffset(i+1))
> - cvsLayout->getElementOffset(i)) - fieldSize;
> sizeSoFar += fieldSize + padSize;
> @@ -1123,7 +1123,7 @@
> << " long double most significant halfword";
> O << '\n';
> }
> - EmitZeros(TD->getTypePaddedSize(Type::X86_FP80Ty) -
> + EmitZeros(TD->getTypeAllocSize(Type::X86_FP80Ty) -
> TD->getTypeStoreSize(Type::X86_FP80Ty), AddrSpace);
> return;
> } else if (CFP->getType() == Type::PPC_FP128Ty) {
> @@ -1228,7 +1228,7 @@
> void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned
> AddrSpace) {
> const TargetData *TD = TM.getTargetData();
> const Type *type = CV->getType();
> - unsigned Size = TD->getTypePaddedSize(type);
> + unsigned Size = TD->getTypeAllocSize(type);
>
> if (CV->isNullValue() || isa<UndefValue>(CV)) {
> EmitZeros(Size, AddrSpace);
>
> Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
> +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Sat May 9 02:06:46 2009
> @@ -284,7 +284,7 @@
>
> unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
> unsigned Size =
> - TM.getTargetData()->getTypePaddedSize(GV->getType()-
> >getElementType());
> + TM.getTargetData()->getTypeAllocSize(GV->getType()-
> >getElementType());
>
> // If this global has a zero initializer, it is part of the .bss
> or common
> // section.
>
> Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Sat May 9 02:06:46 2009
> @@ -281,7 +281,7 @@
> // "giant object for PIC" optimization.
> for (unsigned i = 0, e = CP.size(); i != e; ++i) {
> const Type *Ty = CP[i].getType();
> - unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty);
> + unsigned Size = TM.getTargetData()->getTypeAllocSize(Ty);
>
> MachOWriter::MachOSection *Sec =
> MOW.getConstSection(CP[i].Val.ConstVal);
> OutputBuffer SecDataOut(Sec->SectionData, is64Bit,
> isLittleEndian);
> @@ -355,7 +355,7 @@
>
> void MachOWriter::AddSymbolToSection(MachOSection *Sec,
> GlobalVariable *GV) {
> const Type *Ty = GV->getType()->getElementType();
> - unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty);
> + unsigned Size = TM.getTargetData()->getTypeAllocSize(Ty);
> unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
>
> // Reserve space in the .bss section for this symbol while
> maintaining the
> @@ -400,7 +400,7 @@
>
> void MachOWriter::EmitGlobal(GlobalVariable *GV) {
> const Type *Ty = GV->getType()->getElementType();
> - unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty);
> + unsigned Size = TM.getTargetData()->getTypeAllocSize(Ty);
> bool NoInit = !GV->hasInitializer();
>
> // If this global has a zero initializer, it is part of the .bss
> or common
> @@ -825,7 +825,7 @@
> continue;
> } else if (const ConstantVector *CP =
> dyn_cast<ConstantVector>(PC)) {
> unsigned ElementSize =
> - TD->getTypePaddedSize(CP->getType()->getElementType());
> + TD->getTypeAllocSize(CP->getType()->getElementType());
> for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
> WorkList.push_back(CPair(CP->getOperand(i), PA
> +i*ElementSize));
> } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(PC)) {
> @@ -926,10 +926,10 @@
> abort();
> }
> } else if (isa<ConstantAggregateZero>(PC)) {
> - memset((void*)PA, 0, (size_t)TD->getTypePaddedSize(PC-
> >getType()));
> + memset((void*)PA, 0, (size_t)TD->getTypeAllocSize(PC-
> >getType()));
> } else if (const ConstantArray *CPA =
> dyn_cast<ConstantArray>(PC)) {
> unsigned ElementSize =
> - TD->getTypePaddedSize(CPA->getType()->getElementType());
> + TD->getTypeAllocSize(CPA->getType()->getElementType());
> for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
> WorkList.push_back(CPair(CPA->getOperand(i), PA
> +i*ElementSize));
> } else if (const ConstantStruct *CPS =
> dyn_cast<ConstantStruct>(PC)) {
>
> Modified: llvm/trunk/lib/CodeGen/MachOWriter.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.h?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/MachOWriter.h (original)
> +++ llvm/trunk/lib/CodeGen/MachOWriter.h Sat May 9 02:06:46 2009
> @@ -468,7 +468,7 @@
>
> const Type *Ty = C->getType();
> if (Ty->isPrimitiveType() || Ty->isInteger()) {
> - unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty);
> + unsigned Size = TM.getTargetData()->getTypeAllocSize(Ty);
> switch(Size) {
> default: break; // Fall through to __TEXT,__const
> case 4:
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat May 9
> 02:06:46 2009
> @@ -5694,7 +5694,7 @@
> // Get the offsets to the 0 and 1 element of the array so
> that we can
> // select between them.
> SDValue Zero = DAG.getIntPtrConstant(0);
> - unsigned EltSize = (unsigned)TD.getTypePaddedSize(Elts[0]-
> >getType());
> + unsigned EltSize = (unsigned)TD.getTypeAllocSize(Elts[0]-
> >getType());
> SDValue One = DAG.getIntPtrConstant(EltSize);
>
> SDValue Cond = DAG.getSetCC(DL,
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Sat May 9
> 02:06:46 2009
> @@ -285,7 +285,7 @@
> if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
> if (CI->getZExtValue() == 0) continue;
> uint64_t Offs =
> - TD.getTypePaddedSize(Ty)*cast<ConstantInt>(CI)-
> >getSExtValue();
> + TD.getTypeAllocSize(Ty)*cast<ConstantInt>(CI)-
> >getSExtValue();
> N = FastEmit_ri_(VT, ISD::ADD, N, Offs, VT);
> if (N == 0)
> // Unhandled operand. Halt "fast" selection and bail.
> @@ -294,7 +294,7 @@
> }
>
> // N = N + Idx * ElementSize;
> - uint64_t ElementSize = TD.getTypePaddedSize(Ty);
> + uint64_t ElementSize = TD.getTypeAllocSize(Ty);
> unsigned IdxN = getRegForGEPIndex(Idx);
> if (IdxN == 0)
> // Unhandled operand. Halt "fast" selection and bail.
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat May 9
> 02:06:46 2009
> @@ -3638,7 +3638,7 @@
> // Increment the pointer, VAList, to the next vaarg
> Tmp3 = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(), VAList,
> DAG.getConstant(TLI.getTargetData()->
> -
> getTypePaddedSize(VT.getTypeForMVT()),
> +
> getTypeAllocSize(VT.getTypeForMVT()),
> TLI.getPointerTy()));
> // Store the incremented VAList to the legalized pointer
> Tmp3 = DAG.getStore(VAList.getValue(1), dl, Tmp3, Tmp2, V, 0);
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/
> ScheduleDAGSDNodesEmit.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp
> (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp
> Sat May 9 02:06:46 2009
> @@ -295,7 +295,7 @@
> Align = TM.getTargetData()->getPrefTypeAlignment(Type);
> if (Align == 0) {
> // Alignment of vector types. FIXME!
> - Align = TM.getTargetData()->getTypePaddedSize(Type);
> + Align = TM.getTargetData()->getTypeAllocSize(Type);
> }
> }
>
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
> (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Sat
> May 9 02:06:46 2009
> @@ -128,7 +128,7 @@
> // Given an array type, recursively traverse the elements.
> if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
> const Type *EltTy = ATy->getElementType();
> - uint64_t EltSize = TLI.getTargetData()->getTypePaddedSize(EltTy);
> + uint64_t EltSize = TLI.getTargetData()->getTypeAllocSize(EltTy);
> for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i)
> ComputeValueVTs(TLI, EltTy, ValueVTs, Offsets,
> StartingOffset + i * EltSize);
> @@ -294,7 +294,7 @@
> if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
> if (ConstantInt *CUI = dyn_cast<ConstantInt>(AI-
> >getArraySize())) {
> const Type *Ty = AI->getAllocatedType();
> - uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty);
> + uint64_t TySize = TLI.getTargetData()->getTypeAllocSize(Ty);
> unsigned Align =
> std::max((unsigned)TLI.getTargetData()-
> >getPrefTypeAlignment(Ty),
> AI->getAlignment());
> @@ -2700,7 +2700,7 @@
> if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) {
> if (CI->getZExtValue() == 0) continue;
> uint64_t Offs =
> - TD->getTypePaddedSize(Ty)*cast<ConstantInt>(CI)-
> >getSExtValue();
> + TD->getTypeAllocSize(Ty)*cast<ConstantInt>(CI)-
> >getSExtValue();
> SDValue OffsVal;
> unsigned PtrBits = TLI.getPointerTy().getSizeInBits();
> if (PtrBits < 64) {
> @@ -2715,7 +2715,7 @@
> }
>
> // N = N + Idx * ElementSize;
> - uint64_t ElementSize = TD->getTypePaddedSize(Ty);
> + uint64_t ElementSize = TD->getTypeAllocSize(Ty);
> SDValue IdxN = getValue(Idx);
>
> // If the index is smaller or larger than intptr_t, truncate
> or extend
> @@ -2756,7 +2756,7 @@
> return; // getValue will auto-populate this.
>
> const Type *Ty = I.getAllocatedType();
> - uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty);
> + uint64_t TySize = TLI.getTargetData()->getTypeAllocSize(Ty);
> unsigned Align =
> std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty),
> I.getAlignment());
> @@ -5199,7 +5199,7 @@
> // Otherwise, create a stack slot and emit a store to it
> before the
> // asm.
> const Type *Ty = OpVal->getType();
> - uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty);
> + uint64_t TySize = TLI.getTargetData()->getTypeAllocSize(Ty);
> unsigned Align = TLI.getTargetData()-
> >getPrefTypeAlignment(Ty);
> MachineFunction &MF = DAG.getMachineFunction();
> int SSFI = MF.getFrameInfo()->CreateStackObject(TySize,
> Align);
> @@ -5500,7 +5500,7 @@
> // i32-ness of the optimizer: we do not want to promote to i64 and
> then
> // multiply on 64-bit targets.
> // FIXME: Malloc inst should go away: PR715.
> - uint64_t ElementSize = TD->getTypePaddedSize(I.getType()-
> >getElementType());
> + uint64_t ElementSize = TD->getTypeAllocSize(I.getType()-
> >getElementType());
> if (ElementSize != 1)
> Src = DAG.getNode(ISD::MUL, getCurDebugLoc(), Src.getValueType(),
> Src, DAG.getConstant(ElementSize,
> Src.getValueType()));
> @@ -5614,7 +5614,7 @@
> const PointerType *Ty = cast<PointerType>(I->getType());
> const Type *ElementTy = Ty->getElementType();
> unsigned FrameAlign = getByValTypeAlignment(ElementTy);
> - unsigned FrameSize = getTargetData()-
> >getTypePaddedSize(ElementTy);
> + unsigned FrameSize = getTargetData()-
> >getTypeAllocSize(ElementTy);
> // For ByVal, alignment should be passed from FE. BE will
> guess if
> // this info is not there but there are cases it cannot get
> right.
> if (F.getParamAlignment(j))
> @@ -5747,7 +5747,7 @@
> const PointerType *Ty = cast<PointerType>(Args[i].Ty);
> const Type *ElementTy = Ty->getElementType();
> unsigned FrameAlign = getByValTypeAlignment(ElementTy);
> - unsigned FrameSize = getTargetData()-
> >getTypePaddedSize(ElementTy);
> + unsigned FrameSize = getTargetData()-
> >getTypeAllocSize(ElementTy);
> // For ByVal, alignment should come from FE. BE will guess
> if this
> // info is not there but there are cases it cannot get right.
> if (Args[i].Alignment)
>
> Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original)
> +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Sat May 9 02:06:46 2009
> @@ -114,7 +114,7 @@
> if (const ArrayType *AT = dyn_cast<ArrayType>(AI-
> >getAllocatedType()))
> // If an array has more than SSPBufferSize bytes of
> allocated space,
> // then we emit stack protectors.
> - if (SSPBufferSize <= TD->getTypePaddedSize(AT))
> + if (SSPBufferSize <= TD->getTypeAllocSize(AT))
> return true;
> }
> }
>
> Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Sat May 9
> 02:06:46 2009
> @@ -55,7 +55,7 @@
>
> char* ExecutionEngine::getMemoryForGV(const GlobalVariable* GV) {
> const Type *ElTy = GV->getType()->getElementType();
> - size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy);
> + size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy);
> return new char[GVSize];
> }
>
> @@ -848,16 +848,16 @@
> return;
> } else if (const ConstantVector *CP =
> dyn_cast<ConstantVector>(Init)) {
> unsigned ElementSize =
> - getTargetData()->getTypePaddedSize(CP->getType()-
> >getElementType());
> + getTargetData()->getTypeAllocSize(CP->getType()-
> >getElementType());
> for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
> InitializeMemory(CP->getOperand(i), (char*)Addr+i*ElementSize);
> return;
> } else if (isa<ConstantAggregateZero>(Init)) {
> - memset(Addr, 0, (size_t)getTargetData()->getTypePaddedSize(Init-
> >getType()));
> + memset(Addr, 0, (size_t)getTargetData()->getTypeAllocSize(Init-
> >getType()));
> return;
> } else if (const ConstantArray *CPA =
> dyn_cast<ConstantArray>(Init)) {
> unsigned ElementSize =
> - getTargetData()->getTypePaddedSize(CPA->getType()-
> >getElementType());
> + getTargetData()->getTypeAllocSize(CPA->getType()-
> >getElementType());
> for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
> InitializeMemory(CPA->getOperand(i), (char*)Addr+i*ElementSize);
> return;
> @@ -1004,7 +1004,7 @@
> InitializeMemory(GV->getInitializer(), GA);
>
> const Type *ElTy = GV->getType()->getElementType();
> - size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy);
> + size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy);
> NumInitBytes += (unsigned)GVSize;
> ++NumGlobals;
> }
>
> Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp
> (original)
> +++ llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp Sat
> May 9 02:06:46 2009
> @@ -750,7 +750,7 @@
> unsigned NumElements =
> getOperandValue(I.getOperand(0), SF).IntVal.getZExtValue();
>
> - unsigned TypeSize = (size_t)TD.getTypePaddedSize(Ty);
> + unsigned TypeSize = (size_t)TD.getTypeAllocSize(Ty);
>
> // Avoid malloc-ing zero bytes, use max()...
> unsigned MemToAlloc = std::max(1U, NumElements * TypeSize);
> @@ -810,7 +810,7 @@
> assert(BitWidth == 64 && "Invalid index type for
> getelementptr");
> Idx = (int64_t)IdxGV.IntVal.getZExtValue();
> }
> - Total += TD.getTypePaddedSize(ST->getElementType())*Idx;
> + Total += TD.getTypeAllocSize(ST->getElementType())*Idx;
> }
> }
>
>
> Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Sat May 9 02:06:46
> 2009
> @@ -632,7 +632,7 @@
> // emit it into memory. It goes in the same array as the
> generated
> // code, jump tables, etc.
> const Type *GlobalType = GV->getType()->getElementType();
> - size_t S = getTargetData()->getTypePaddedSize(GlobalType);
> + size_t S = getTargetData()->getTypeAllocSize(GlobalType);
> size_t A = getTargetData()->getPreferredAlignment(GV);
> if (GV->isThreadLocal()) {
> MutexGuard locked(lock);
> @@ -687,7 +687,7 @@
> ///
> char* JIT::getMemoryForGV(const GlobalVariable* GV) {
> const Type *ElTy = GV->getType()->getElementType();
> - size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy);
> + size_t GVSize = (size_t)getTargetData()->getTypeAllocSize(ElTy);
> if (GV->isThreadLocal()) {
> MutexGuard locked(lock);
> return TJI.allocateThreadLocalMemory(GVSize);
>
> Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Sat May 9
> 02:06:46 2009
> @@ -809,7 +809,7 @@
> unsigned AlignMask = CPE.getAlignment() - 1;
> Size = (Size + AlignMask) & ~AlignMask;
> const Type *Ty = CPE.getType();
> - Size += TD->getTypePaddedSize(Ty);
> + Size += TD->getTypeAllocSize(Ty);
> }
> return Size;
> }
> @@ -838,7 +838,7 @@
>
> unsigned JITEmitter::addSizeOfGlobal(const GlobalVariable *GV,
> unsigned Size) {
> const Type *ElTy = GV->getType()->getElementType();
> - size_t GVSize = (size_t)TheJIT->getTargetData()-
> >getTypePaddedSize(ElTy);
> + size_t GVSize = (size_t)TheJIT->getTargetData()-
> >getTypeAllocSize(ElTy);
> size_t GVAlign =
> (size_t)TheJIT->getTargetData()->getPreferredAlignment(GV);
> DOUT << "JIT: Adding in size " << GVSize << " alignment " <<
> GVAlign;
> @@ -1322,7 +1322,7 @@
> << std::hex << CAddr << std::dec << "]\n";
>
> const Type *Ty = CPE.Val.ConstVal->getType();
> - Offset += TheJIT->getTargetData()->getTypePaddedSize(Ty);
> + Offset += TheJIT->getTargetData()->getTypeAllocSize(Ty);
> }
> }
>
>
> Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Sat May 9
> 02:06:46 2009
> @@ -295,7 +295,7 @@
>
> const TargetData &TD = *Fn.getTarget().getTargetData();
> for (unsigned i = 0, e = CPs.size(); i != e; ++i) {
> - unsigned Size = TD.getTypePaddedSize(CPs[i].getType());
> + unsigned Size = TD.getTypeAllocSize(CPs[i].getType());
> // Verify that all constant pool entries are a multiple of 4
> bytes. If not,
> // we would have to pad them out or something so that
> instructions stay
> // aligned.
>
> Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Sat May
> 9 02:06:46 2009
> @@ -838,7 +838,7 @@
> std::string name = Mang->getValueName(GVar);
> Constant *C = GVar->getInitializer();
> const Type *Type = C->getType();
> - unsigned Size = TD->getTypePaddedSize(Type);
> + unsigned Size = TD->getTypeAllocSize(Type);
> unsigned Align = TD->getPreferredAlignmentLog(GVar);
> bool isDarwin = Subtarget->isTargetDarwin();
>
>
> Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Sat
> May 9 02:06:46 2009
> @@ -224,7 +224,7 @@
>
> std::string name = Mang->getValueName(GVar);
> Constant *C = GVar->getInitializer();
> - unsigned Size = TD->getTypePaddedSize(C->getType());
> + unsigned Size = TD->getTypeAllocSize(C->getType());
> unsigned Align = TD->getPreferredAlignmentLog(GVar);
>
> // 0: Switch to section
>
> Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
> +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Sat May 9 02:06:46
> 2009
> @@ -497,7 +497,7 @@
> const VectorType *VTy = cast<VectorType>(Ty);
> return printSimpleType(Out, VTy->getElementType(), isSigned,
> " __attribute__((vector_size(" +
> - utostr(TD->getTypePaddedSize(VTy)) + " ))) " +
> NameSoFar);
> + utostr(TD->getTypeAllocSize(VTy)) + " ))) " +
> NameSoFar);
> }
>
> default:
> @@ -542,7 +542,7 @@
> const VectorType *VTy = cast<VectorType>(Ty);
> return printSimpleType(Out, VTy->getElementType(), isSigned,
> " __attribute__((vector_size(" +
> - utostr(TD->getTypePaddedSize(VTy)) + " ))) " +
> NameSoFar);
> + utostr(TD->getTypeAllocSize(VTy)) + " ))) " +
> NameSoFar);
> }
>
> default:
>
> Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Sat
> May 9 02:06:46 2009
> @@ -530,7 +530,7 @@
>
> Constant *C = GVar->getInitializer();
> const Type *Type = C->getType();
> - unsigned Size = TD->getTypePaddedSize(Type);
> + unsigned Size = TD->getTypeAllocSize(Type);
> unsigned Align = TD->getPreferredAlignmentLog(GVar);
>
> SwitchToSection(TAI->SectionForGlobal(GVar));
>
> Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
> +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Sat May 9
> 02:06:46 2009
> @@ -117,7 +117,7 @@
> Constant *C = cast<GlobalVariable>(GV)->getInitializer();
> const Type *Ty = cast<ArrayType>(C->getType())->getElementType();
>
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
> if (Size) {
> unsigned Align = TD->getPreferredAlignment(GV);
> if (Align <= 32)
> @@ -138,7 +138,7 @@
> DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
> const TargetData *TD = TM.getTargetData();
>
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
> if (Size == 4)
> return FourByteConstantSection;
> else if (Size == 8)
>
> Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original)
> +++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Sat May 9 02:06:46
> 2009
> @@ -151,7 +151,7 @@
> // FIXME: string here is temporary, until stuff will fully land in.
> // We cannot use {Four,Eight,Sixteen}ByteConstantSection here,
> since it's
> // currently directly used by asmprinter.
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
> if (Size == 4 || Size == 8 || Size == 16) {
> std::string Name = ".rodata.cst" + utostr(Size);
>
> @@ -169,7 +169,7 @@
> Constant *C = cast<GlobalVariable>(GV)->getInitializer();
> const Type *Ty = cast<ArrayType>(C->getType())->getElementType();
>
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
> if (Size <= 16) {
> assert(getCStringSection() && "Should have string section
> prefix");
>
>
> Modified: llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp Sat
> May 9 02:06:46 2009
> @@ -269,7 +269,7 @@
> O << "\n\n";
> std::string name = Mang->getValueName(GVar);
> Constant *C = GVar->getInitializer();
> - unsigned Size = TD->getTypePaddedSize(C->getType());
> + unsigned Size = TD->getTypeAllocSize(C->getType());
> unsigned Align = TD->getPreferredAlignmentLog(GVar);
>
> printVisibility(name, GVar->getVisibility());
>
> Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original)
> +++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Sat May 9 02:06:46 2009
> @@ -385,7 +385,7 @@
> case Type::DoubleTyID:
> return "r8";
> case Type::PointerTyID:
> - return "i"+utostr(TD->getTypePaddedSize(Ty));
> + return "i"+utostr(TD->getTypeAllocSize(Ty));
> default:
> cerr << "TypeID = " << Ty->getTypeID() << '\n';
> assert(0 && "Invalid type in TypeToPostfix()");
> @@ -695,14 +695,14 @@
> uint64_t FieldIndex = cast<ConstantInt>(IndexValue)-
> >getZExtValue();
> // Offset is the sum of all previous structure fields.
> for (uint64_t F = 0; F<FieldIndex; ++F)
> - Size += TD->getTypePaddedSize(StrucTy-
> >getContainedType((unsigned)F));
> + Size += TD->getTypeAllocSize(StrucTy-
> >getContainedType((unsigned)F));
> printPtrLoad(Size);
> printSimpleInstruction("add");
> continue;
> } else if (const SequentialType* SeqTy =
> dyn_cast<SequentialType>(*I)) {
> - Size = TD->getTypePaddedSize(SeqTy->getElementType());
> + Size = TD->getTypeAllocSize(SeqTy->getElementType());
> } else {
> - Size = TD->getTypePaddedSize(*I);
> + Size = TD->getTypeAllocSize(*I);
> }
> // Add offset of current element to stack top.
> if (!isZeroValue(IndexValue)) {
> @@ -1027,7 +1027,7 @@
>
>
> void MSILWriter::printAllocaInstruction(const AllocaInst* Inst) {
> - uint64_t Size = TD->getTypePaddedSize(Inst->getAllocatedType());
> + uint64_t Size = TD->getTypeAllocSize(Inst->getAllocatedType());
> // Constant optimization.
> if (const ConstantInt* CInt = dyn_cast<ConstantInt>(Inst-
> >getOperand(0))) {
> printPtrLoad(CInt->getZExtValue()*Size);
> @@ -1443,7 +1443,7 @@
> // Print not duplicated type
> if (Printed.insert(Ty).second) {
> Out << ".class value explicit ansi sealed '" << Name << "'";
> - Out << " { .pack " << 1 << " .size " << TD-
> >getTypePaddedSize(Ty);
> + Out << " { .pack " << 1 << " .size " << TD-
> >getTypeAllocSize(Ty);
> Out << " }\n\n";
> }
> }
> @@ -1473,7 +1473,7 @@
> const Type* Ty = C->getType();
> // Print zero initialized constant.
> if (isa<ConstantAggregateZero>(C) || C->isNullValue()) {
> - TySize = TD->getTypePaddedSize(C->getType());
> + TySize = TD->getTypeAllocSize(C->getType());
> Offset += TySize;
> Out << "int8 (0) [" << TySize << "]";
> return;
> @@ -1481,14 +1481,14 @@
> // Print constant initializer
> switch (Ty->getTypeID()) {
> case Type::IntegerTyID: {
> - TySize = TD->getTypePaddedSize(Ty);
> + TySize = TD->getTypeAllocSize(Ty);
> const ConstantInt* Int = cast<ConstantInt>(C);
> Out << getPrimitiveTypeName(Ty,true) << "(" << Int-
> >getSExtValue() << ")";
> break;
> }
> case Type::FloatTyID:
> case Type::DoubleTyID: {
> - TySize = TD->getTypePaddedSize(Ty);
> + TySize = TD->getTypeAllocSize(Ty);
> const ConstantFP* FP = cast<ConstantFP>(C);
> if (Ty->getTypeID() == Type::FloatTyID)
> Out << "int32 (" <<
> @@ -1507,7 +1507,7 @@
> }
> break;
> case Type::PointerTyID:
> - TySize = TD->getTypePaddedSize(C->getType());
> + TySize = TD->getTypeAllocSize(C->getType());
> // Initialize with global variable address
> if (const GlobalVariable *G = dyn_cast<GlobalVariable>(C)) {
> std::string name = getValueName(G);
>
> Modified: llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp Sat
> May 9 02:06:46 2009
> @@ -484,7 +484,7 @@
> std::string name = Mang->getValueName(GVar);
> Constant *C = GVar->getInitializer();
> const Type *CTy = C->getType();
> - unsigned Size = TD->getTypePaddedSize(CTy);
> + unsigned Size = TD->getTypeAllocSize(CTy);
> const ConstantArray *CVA = dyn_cast<ConstantArray>(C);
> bool printSizeAndType = true;
>
>
> Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Sat May 9
> 02:06:46 2009
> @@ -210,7 +210,7 @@
> return false;
>
> const Type *Ty = GV->getType()->getElementType();
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
>
> // if this is a internal constant string, there is a special
> // section for it, but not in small data/bss.
> @@ -551,7 +551,7 @@
> // hacking it. This feature should come soon so we can uncomment the
> // stuff below.
> //if (!Subtarget->hasABICall() &&
> - // IsInSmallSection(getTargetData()->getTypePaddedSize(C-
> >getType()))) {
> + // IsInSmallSection(getTargetData()->getTypeAllocSize(C-
> >getType()))) {
> // SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP);
> // SDValue GOT = DAG.getGLOBAL_OFFSET_TABLE(MVT::i32);
> // ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode);
>
> Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original)
> +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Sat May 9
> 02:06:46 2009
> @@ -66,7 +66,7 @@
>
> if (isa<GlobalVariable>(GV)) {
> const TargetData *TD = TM.getTargetData();
> - unsigned Size = TD->getTypePaddedSize(GV->getType()-
> >getElementType());
> + unsigned Size = TD->getTypeAllocSize(GV->getType()-
> >getElementType());
> unsigned Threshold = Subtarget->getSSectionThreshold();
>
> if (Size > 0 && Size <= Threshold) {
>
> Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Sat May 9
> 02:06:46 2009
> @@ -286,7 +286,7 @@
> const Type *RetType = F->getReturnType();
> unsigned RetSize = 0;
> if (RetType->getTypeID() != Type::VoidTyID)
> - RetSize = TD->getTypePaddedSize(RetType);
> + RetSize = TD->getTypeAllocSize(RetType);
>
> //Emit function return value space
> if(RetSize > 0)
> @@ -300,7 +300,7 @@
> for (Function::const_arg_iterator argi = F->arg_begin(),
> arge = F->arg_end(); argi != arge ; ++argi) {
> const Type *Ty = argi->getType();
> - ArgSize += TD->getTypePaddedSize(Ty);
> + ArgSize += TD->getTypeAllocSize(Ty);
> }
> O << FunctionLabelBegin << CurrentFnName << ".args. RES " <<
> ArgSize
> << "\n";
> @@ -340,7 +340,7 @@
> I->setSection("fadata." + CurrentFnName + ".#");
> Constant *C = I->getInitializer();
> const Type *Ty = C->getType();
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
> FrameSize += Size;
> // Emit memory reserve directive.
> O << FunctionLabelBegin << VarName << " RES " << Size << "\n";
> @@ -374,7 +374,7 @@
> std::string Name = Mang->getValueName(Items[j]);
> Constant *C = Items[j]->getInitializer();
> const Type *Ty = C->getType();
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
>
> O << Name << " " <<"RES"<< " " << Size ;
> O << "\n";
>
> Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp (original)
> +++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp Sat May 9
> 02:06:46 2009
> @@ -72,7 +72,7 @@
> // Find how much space this global needs.
> const TargetData *TD = TM.getTargetData();
> const Type *Ty = C->getType();
> - unsigned ValSize = TD->getTypePaddedSize(Ty);
> + unsigned ValSize = TD->getTypeAllocSize(Ty);
>
> // Go through all BSS Sections and assign this variable
> // to the first available section having enough space.
> @@ -118,7 +118,7 @@
> // Find how much space this global needs.
> const TargetData *TD = TM.getTargetData();
> const Type *Ty = C->getType();
> - unsigned ValSize = TD->getTypePaddedSize(Ty);
> + unsigned ValSize = TD->getTypeAllocSize(Ty);
>
> // Go through all IDATA Sections and assign this variable
> // to the first available section having enough space.
>
> Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Sat
> May 9 02:06:46 2009
> @@ -687,7 +687,7 @@
>
> Constant *C = GVar->getInitializer();
> const Type *Type = C->getType();
> - unsigned Size = TD->getTypePaddedSize(Type);
> + unsigned Size = TD->getTypeAllocSize(Type);
> unsigned Align = TD->getPreferredAlignmentLog(GVar);
>
> SwitchToSection(TAI->SectionForGlobal(GVar));
> @@ -927,7 +927,7 @@
>
> Constant *C = GVar->getInitializer();
> const Type *Type = C->getType();
> - unsigned Size = TD->getTypePaddedSize(Type);
> + unsigned Size = TD->getTypeAllocSize(Type);
> unsigned Align = TD->getPreferredAlignmentLog(GVar);
>
> SwitchToSection(TAI->SectionForGlobal(GVar));
>
> Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Sat
> May 9 02:06:46 2009
> @@ -253,7 +253,7 @@
> O << "\n\n";
> std::string name = Mang->getValueName(GVar);
> Constant *C = GVar->getInitializer();
> - unsigned Size = TD->getTypePaddedSize(C->getType());
> + unsigned Size = TD->getTypeAllocSize(C->getType());
> unsigned Align = TD->getPreferredAlignment(GVar);
>
> printVisibility(name, GVar->getVisibility());
>
> Modified: llvm/trunk/lib/Target/Target.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Target.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Target.cpp (original)
> +++ llvm/trunk/lib/Target/Target.cpp Sat May 9 02:06:46 2009
> @@ -53,7 +53,7 @@
> }
>
> unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD,
> LLVMTypeRef Ty) {
> - return unwrap(TD)->getTypePaddedSize(unwrap(Ty));
> + return unwrap(TD)->getTypeAllocSize(unwrap(Ty));
> }
>
> unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef
> Ty) {
>
> Modified: llvm/trunk/lib/Target/TargetData.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/TargetData.cpp (original)
> +++ llvm/trunk/lib/Target/TargetData.cpp Sat May 9 02:06:46 2009
> @@ -58,7 +58,7 @@
> StructAlignment = std::max(TyAlign, StructAlignment);
>
> MemberOffsets[i] = StructSize;
> - StructSize += TD.getTypePaddedSize(Ty); // Consume space for
> this data item
> + StructSize += TD.getTypeAllocSize(Ty); // Consume space for
> this data item
> }
>
> // Empty structures have alignment of 1 byte.
> @@ -425,7 +425,7 @@
> return getPointerSizeInBits();
> case Type::ArrayTyID: {
> const ArrayType *ATy = cast<ArrayType>(Ty);
> - return getTypePaddedSizeInBits(ATy->getElementType())*ATy-
> >getNumElements();
> + return getTypeAllocSizeInBits(ATy->getElementType())*ATy-
> >getNumElements();
> }
> case Type::StructTyID:
> // Get the layout annotation... which is lazily created on demand.
> @@ -568,7 +568,7 @@
>
> // Get the array index and the size of each array element.
> int64_t arrayIdx = cast<ConstantInt>(Indices[CurIDX])-
> >getSExtValue();
> - Result += arrayIdx * (int64_t)getTypePaddedSize(Ty);
> + Result += arrayIdx * (int64_t)getTypeAllocSize(Ty);
> }
> }
>
>
> Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Sat
> May 9 02:06:46 2009
> @@ -76,7 +76,7 @@
> Ty = cast<PointerType>(Ty)->getElementType();
>
> // Size should be aligned to DWORD boundary
> - Size += ((TD->getTypePaddedSize(Ty) + 3)/4)*4;
> + Size += ((TD->getTypeAllocSize(Ty) + 3)/4)*4;
> }
>
> // We're not supporting tooooo huge arguments :)
> @@ -811,7 +811,7 @@
> std::string name = Mang->getValueName(GVar);
> Constant *C = GVar->getInitializer();
> const Type *Type = C->getType();
> - unsigned Size = TD->getTypePaddedSize(Type);
> + unsigned Size = TD->getTypeAllocSize(Type);
> unsigned Align = TD->getPreferredAlignmentLog(GVar);
>
> printVisibility(name, GVar->getVisibility());
>
> Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
> (original)
> +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Sat
> May 9 02:06:46 2009
> @@ -59,7 +59,7 @@
> Ty = cast<PointerType>(Ty)->getElementType();
>
> // Size should be aligned to DWORD boundary
> - Size += ((TD->getTypePaddedSize(Ty) + 3)/4)*4;
> + Size += ((TD->getTypeAllocSize(Ty) + 3)/4)*4;
> }
>
> // We're not supporting tooooo huge arguments :)
>
> Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Sat May 9 02:06:46 2009
> @@ -393,7 +393,7 @@
> unsigned Idx = cast<ConstantInt>(Op)->getZExtValue();
> Disp += SL->getElementOffset(Idx);
> } else {
> - uint64_t S = TD.getTypePaddedSize(GTI.getIndexedType());
> + uint64_t S = TD.getTypeAllocSize(GTI.getIndexedType());
> if (ConstantInt *CI = dyn_cast<ConstantInt>(Op)) {
> // Constant-offset addressing.
> Disp += CI->getSExtValue() * S;
> @@ -1490,7 +1490,7 @@
> unsigned Align = TD.getPrefTypeAlignment(C->getType());
> if (Align == 0) {
> // Alignment of vector types. FIXME!
> - Align = TD.getTypePaddedSize(C->getType());
> + Align = TD.getTypeAllocSize(C->getType());
> }
>
> // x86-32 PIC requires a PIC base register for constant pools.
>
> Modified: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp Sat May 9
> 02:06:46 2009
> @@ -220,7 +220,7 @@
>
> EmitAlignment(Align, GV, 2);
>
> - unsigned Size = TD->getTypePaddedSize(C->getType());
> + unsigned Size = TD->getTypeAllocSize(C->getType());
> if (GV->isThreadLocal()) {
> Size *= MaxThreads;
> }
>
> Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Sat May 9
> 02:06:46 2009
> @@ -270,7 +270,7 @@
> }
> SDValue base = getGlobalAddressWrapper(GA, GV, DAG);
> const TargetData *TD = TM.getTargetData();
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
> SDValue offset = DAG.getNode(ISD::MUL, dl, MVT::i32,
> BuildGetId(DAG, dl),
> DAG.getConstant(Size, MVT::i32));
> return DAG.getNode(ISD::ADD, dl, MVT::i32, base, offset);
>
> Modified: llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp (original)
> +++ llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp Sat May 9
> 02:06:46 2009
> @@ -106,7 +106,7 @@
> XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
> const TargetData *TD = TM.getTargetData();
>
> - unsigned Size = TD->getTypePaddedSize(Ty);
> + unsigned Size = TD->getTypeAllocSize(Ty);
> if (Size == 4 || Size == 8 || Size == 16) {
> std::string Name = ".cp.const" + utostr(Size);
>
>
> Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
> +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Sat May 9 02:06:46
> 2009
> @@ -513,7 +513,7 @@
> return 0; // It's not worth it.
> NewGlobals.reserve(NumElements);
>
> - uint64_t EltSize = TD.getTypePaddedSize(STy->getElementType());
> + uint64_t EltSize = TD.getTypeAllocSize(STy->getElementType());
> unsigned EltAlign = TD.getABITypeAlignment(STy->getElementType());
> for (unsigned i = 0, e = NumElements; i != e; ++i) {
> Constant *In = getAggregateConstantElement(Init,
> @@ -1448,7 +1448,7 @@
> // (2048 bytes currently), as we don't want to introduce a 16M
> global or
> // something.
> if (NElements->getZExtValue()*
> - TD.getTypePaddedSize(MI->getAllocatedType()) < 2048) {
> + TD.getTypeAllocSize(MI->getAllocatedType()) < 2048) {
> GVI = OptimizeGlobalAddressOfMalloc(GV, MI);
> return true;
> }
>
> Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
> (original)
> +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Sat
> May 9 02:06:46 2009
> @@ -305,11 +305,11 @@
> if (AllocaInst* A = dyn_cast<AllocaInst>(*I)) {
> if (ConstantInt* C = dyn_cast<ConstantInt>(A-
> >getArraySize()))
> pointerSize = C->getZExtValue() *
> - TD.getTypePaddedSize(A-
> >getAllocatedType());
> + TD.getTypeAllocSize(A->getAllocatedType());
> } else {
> const PointerType* PT = cast<PointerType>(
> cast<Argument>(*I)-
> >getType());
> - pointerSize = TD.getTypePaddedSize(PT->getElementType());
> + pointerSize = TD.getTypeAllocSize(PT->getElementType());
> }
>
> // See if the call site touches it
> @@ -382,10 +382,10 @@
> if (AllocaInst* A = dyn_cast<AllocaInst>(*I)) {
> if (ConstantInt* C = dyn_cast<ConstantInt>(A->getArraySize()))
> pointerSize = C->getZExtValue() *
> - TD.getTypePaddedSize(A->getAllocatedType());
> + TD.getTypeAllocSize(A->getAllocatedType());
> } else {
> const PointerType* PT = cast<PointerType>(cast<Argument>(*I)-
> >getType());
> - pointerSize = TD.getTypePaddedSize(PT->getElementType());
> + pointerSize = TD.getTypeAllocSize(PT->getElementType());
> }
>
> // See if this pointer could alias it
>
> Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
> (original)
> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sat
> May 9 02:06:46 2009
> @@ -5202,7 +5202,7 @@
> for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end();
> i != e;
> ++i, ++GTI) {
> Value *Op = *i;
> - uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType()) &
> PtrSizeMask;
> + uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType()) &
> PtrSizeMask;
> if (ConstantInt *OpC = dyn_cast<ConstantInt>(Op)) {
> if (OpC->isZero()) continue;
>
> @@ -5294,7 +5294,7 @@
> if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
> Offset += TD.getStructLayout(STy)->getElementOffset(CI-
> >getZExtValue());
> } else {
> - uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType());
> + uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType());
> Offset += Size*CI->getSExtValue();
> }
> } else {
> @@ -5310,7 +5310,7 @@
> Value *VariableIdx = GEP->getOperand(i);
> // Determine the scale factor of the variable element. For
> example, this is
> // 4 if the variable index is into an array of i32.
> - uint64_t VariableScale =
> TD.getTypePaddedSize(GTI.getIndexedType());
> + uint64_t VariableScale = TD.getTypeAllocSize(GTI.getIndexedType());
>
> // Verify that there are no other variable indices. If so, emit
> the hard way.
> for (++i, ++GTI; i != e; ++i, ++GTI) {
> @@ -5324,7 +5324,7 @@
> if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
> Offset += TD.getStructLayout(STy)->getElementOffset(CI-
> >getZExtValue());
> } else {
> - uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType());
> + uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType());
> Offset += Size*CI->getSExtValue();
> }
> }
> @@ -7606,8 +7606,8 @@
> if (!AI.hasOneUse() && !hasOneUsePlusDeclare(&AI) &&
> CastElTyAlign == AllocElTyAlign) return 0;
>
> - uint64_t AllocElTySize = TD->getTypePaddedSize(AllocElTy);
> - uint64_t CastElTySize = TD->getTypePaddedSize(CastElTy);
> + uint64_t AllocElTySize = TD->getTypeAllocSize(AllocElTy);
> + uint64_t CastElTySize = TD->getTypeAllocSize(CastElTy);
> if (CastElTySize == 0 || AllocElTySize == 0) return 0;
>
> // See if we can satisfy the modulus by pulling a scale out of the
> array
> @@ -7905,7 +7905,7 @@
> // is something like [0 x {int, int}]
> const Type *IntPtrTy = TD->getIntPtrType();
> int64_t FirstIdx = 0;
> - if (int64_t TySize = TD->getTypePaddedSize(Ty)) {
> + if (int64_t TySize = TD->getTypeAllocSize(Ty)) {
> FirstIdx = Offset/TySize;
> Offset -= FirstIdx*TySize;
>
> @@ -7937,7 +7937,7 @@
> Offset -= SL->getElementOffset(Elt);
> Ty = STy->getElementType(Elt);
> } else if (const ArrayType *AT = dyn_cast<ArrayType>(Ty)) {
> - uint64_t EltSize = TD->getTypePaddedSize(AT->getElementType());
> + uint64_t EltSize = TD->getTypeAllocSize(AT->getElementType());
> assert(EltSize && "Cannot index into a zero-sized array");
> NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize));
> Offset %= EltSize;
> @@ -8687,7 +8687,7 @@
> // is a single-index GEP.
> if (X->getType() == CI.getType()) {
> // Get the size of the pointee type.
> - uint64_t Size = TD->getTypePaddedSize(DestPointee);
> + uint64_t Size = TD->getTypeAllocSize(DestPointee);
>
> // Convert the constant to intptr type.
> APInt Offset = Cst->getValue();
> @@ -8707,7 +8707,7 @@
> // "inttoptr+GEP" instead of "add+intptr".
>
> // Get the size of the pointee type.
> - uint64_t Size = TD->getTypePaddedSize(DestPointee);
> + uint64_t Size = TD->getTypeAllocSize(DestPointee);
>
> // Convert the constant to intptr type.
> APInt Offset = Cst->getValue();
> @@ -9811,7 +9811,7 @@
> const Type* DstTy = cast<PointerType>(CI->getType())-
> >getElementType();
> if (!SrcTy->isSized() || !DstTy->isSized())
> return false;
> - if (TD->getTypePaddedSize(SrcTy) != TD->getTypePaddedSize(DstTy))
> + if (TD->getTypeAllocSize(SrcTy) != TD->getTypeAllocSize(DstTy))
> return false;
> return true;
> }
> @@ -10966,8 +10966,8 @@
> const Type *SrcElTy = cast<PointerType>(X->getType())-
> >getElementType();
> const Type *ResElTy=cast<PointerType>(PtrOp->getType())-
> >getElementType();
> if (isa<ArrayType>(SrcElTy) &&
> - TD->getTypePaddedSize(cast<ArrayType>(SrcElTy)-
> >getElementType()) ==
> - TD->getTypePaddedSize(ResElTy)) {
> + TD->getTypeAllocSize(cast<ArrayType>(SrcElTy)-
> >getElementType()) ==
> + TD->getTypeAllocSize(ResElTy)) {
> Value *Idx[2];
> Idx[0] = Constant::getNullValue(Type::Int32Ty);
> Idx[1] = GEP.getOperand(1);
> @@ -10984,7 +10984,7 @@
>
> if (isa<ArrayType>(SrcElTy) && ResElTy == Type::Int8Ty) {
> uint64_t ArrayEltSize =
> - TD->getTypePaddedSize(cast<ArrayType>(SrcElTy)-
> >getElementType());
> + TD->getTypeAllocSize(cast<ArrayType>(SrcElTy)-
> >getElementType());
>
> // Check to see if "tmp" is a scale by a multiple of
> ArrayEltSize. We
> // allow either a mul, shift, or constant here.
> @@ -11137,7 +11137,7 @@
> // If alloca'ing a zero byte object, replace the alloca with a
> null pointer.
> // Note that we only do this for alloca's, because malloc should
> allocate
> // and return a unique pointer, even for a zero byte allocation.
> - if (TD->getTypePaddedSize(AI.getAllocatedType()) == 0)
> + if (TD->getTypeAllocSize(AI.getAllocatedType()) == 0)
> return ReplaceInstUsesWith(AI,
> Constant::getNullValue(AI.getType()));
>
> // If the alignment is 0 (unspecified), assign it the preferred
> alignment.
>
> Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Sat May 9
> 02:06:46 2009
> @@ -104,7 +104,7 @@
>
> // Otherwise, we have a sequential type like an array or
> vector. Multiply
> // the index by the ElementSize.
> - uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType());
> + uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType());
> Offset += Size*OpC->getSExtValue();
> }
>
> @@ -511,7 +511,7 @@
> if (!srcArraySize)
> return false;
>
> - uint64_t srcSize = TD.getTypePaddedSize(srcAlloca-
> >getAllocatedType()) *
> + uint64_t srcSize = TD.getTypeAllocSize(srcAlloca-
> >getAllocatedType()) *
> srcArraySize->getZExtValue();
>
> if (cpyLength->getZExtValue() < srcSize)
> @@ -526,7 +526,7 @@
> if (!destArraySize)
> return false;
>
> - uint64_t destSize = TD.getTypePaddedSize(A->getAllocatedType()) *
> + uint64_t destSize = TD.getTypeAllocSize(A->getAllocatedType()) *
> destArraySize->getZExtValue();
>
> if (destSize < srcSize)
> @@ -538,7 +538,7 @@
> return false;
>
> const Type* StructTy = cast<PointerType>(A->getType())-
> >getElementType();
> - uint64_t destSize = TD.getTypePaddedSize(StructTy);
> + uint64_t destSize = TD.getTypeAllocSize(StructTy);
>
> if (destSize < srcSize)
> return false;
>
> Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
> (original)
> +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Sat
> May 9 02:06:46 2009
> @@ -252,7 +252,7 @@
> // transform the allocation instruction if it is an array
> allocation
> // (allocations OF arrays are ok though), and an allocation of a
> scalar
> // value cannot be decomposed at all.
> - uint64_t AllocaSize = TD->getTypePaddedSize(AI-
> >getAllocatedType());
> + uint64_t AllocaSize = TD->getTypeAllocSize(AI-
> >getAllocatedType());
>
> // Do not promote any struct whose size is too big.
> if (AllocaSize > SRThreshold) continue;
> @@ -601,7 +601,7 @@
>
> // If not the whole aggregate, give up.
> if (Length->getZExtValue() !=
> - TD->getTypePaddedSize(AI->getType()->getElementType()))
> + TD->getTypeAllocSize(AI->getType()->getElementType()))
> return MarkUnsafe(Info);
>
> // We only know about memcpy/memset/memmove.
> @@ -637,8 +637,8 @@
> // cast a {i32,i32}* to i64* and store through it. This is
> similar to the
> // memcpy case and occurs in various "byval" cases and
> emulated memcpys.
> if (isa<IntegerType>(SI->getOperand(0)->getType()) &&
> - TD->getTypePaddedSize(SI->getOperand(0)->getType()) ==
> - TD->getTypePaddedSize(AI->getType()->getElementType())) {
> + TD->getTypeAllocSize(SI->getOperand(0)->getType()) ==
> + TD->getTypeAllocSize(AI->getType()->getElementType())) {
> Info.isMemCpyDst = true;
> continue;
> }
> @@ -652,8 +652,8 @@
> // cast a {i32,i32}* to i64* and load through it. This is
> similar to the
> // memcpy case and occurs in various "byval" cases and
> emulated memcpys.
> if (isa<IntegerType>(LI->getType()) &&
> - TD->getTypePaddedSize(LI->getType()) ==
> - TD->getTypePaddedSize(AI->getType()->getElementType())) {
> + TD->getTypeAllocSize(LI->getType()) ==
> + TD->getTypeAllocSize(AI->getType()->getElementType())) {
> Info.isMemCpySrc = true;
> continue;
> }
> @@ -782,7 +782,7 @@
> } else {
> const Type *EltTy =
> cast<SequentialType>(OtherPtr->getType())->getElementType();
> - EltOffset = TD->getTypePaddedSize(EltTy)*i;
> + EltOffset = TD->getTypeAllocSize(EltTy)*i;
> }
>
> // The alignment of the other pointer is the guaranteed
> alignment of the
> @@ -865,7 +865,7 @@
> OtherElt = new BitCastInst(OtherElt, BytePtrTy,OtherElt-
> >getNameStr(),
> MI);
>
> - unsigned EltSize = TD->getTypePaddedSize(EltTy);
> + unsigned EltSize = TD->getTypeAllocSize(EltTy);
>
> // Finally, insert the meminst for this element.
> if (isa<MemTransferInst>(MI)) {
> @@ -899,7 +899,7 @@
> // and store the element value to the individual alloca.
> Value *SrcVal = SI->getOperand(0);
> const Type *AllocaEltTy = AI->getType()->getElementType();
> - uint64_t AllocaSizeBits = TD->getTypePaddedSizeInBits(AllocaEltTy);
> + uint64_t AllocaSizeBits = TD->getTypeAllocSizeInBits(AllocaEltTy);
>
> // If this isn't a store of an integer to the whole alloca, it may
> be a store
> // to the first element. Just ignore the store in this case and
> normal SROA
> @@ -922,7 +922,7 @@
> uint64_t Shift = Layout->getElementOffsetInBits(i);
>
> if (TD->isBigEndian())
> - Shift = AllocaSizeBits-Shift-TD-
> >getTypePaddedSizeInBits(FieldTy);
> + Shift = AllocaSizeBits-Shift-TD-
> >getTypeAllocSizeInBits(FieldTy);
>
> Value *EltVal = SrcVal;
> if (Shift) {
> @@ -957,7 +957,7 @@
> } else {
> const ArrayType *ATy = cast<ArrayType>(AllocaEltTy);
> const Type *ArrayEltTy = ATy->getElementType();
> - uint64_t ElementOffset = TD->getTypePaddedSizeInBits(ArrayEltTy);
> + uint64_t ElementOffset = TD->getTypeAllocSizeInBits(ArrayEltTy);
> uint64_t ElementSizeBits = TD->getTypeSizeInBits(ArrayEltTy);
>
> uint64_t Shift;
> @@ -1012,7 +1012,7 @@
> // Extract each element out of the NewElts according to its
> structure offset
> // and form the result value.
> const Type *AllocaEltTy = AI->getType()->getElementType();
> - uint64_t AllocaSizeBits = TD->getTypePaddedSizeInBits(AllocaEltTy);
> + uint64_t AllocaSizeBits = TD->getTypeAllocSizeInBits(AllocaEltTy);
>
> // If this isn't a load of the whole alloca to an integer, it may
> be a load
> // of the first element. Just ignore the load in this case and
> normal SROA
> @@ -1032,7 +1032,7 @@
> Layout = TD->getStructLayout(EltSTy);
> } else {
> const Type *ArrayEltTy = cast<ArrayType>(AllocaEltTy)-
> >getElementType();
> - ArrayEltBitOffset = TD->getTypePaddedSizeInBits(ArrayEltTy);
> + ArrayEltBitOffset = TD->getTypeAllocSizeInBits(ArrayEltTy);
> }
>
> Value *ResultVal = Constant::getNullValue(LI->getType());
> @@ -1126,7 +1126,7 @@
> } else if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
> return HasPadding(VTy->getElementType(), TD);
> }
> - return TD.getTypeSizeInBits(Ty) != TD.getTypePaddedSizeInBits(Ty);
> + return TD.getTypeSizeInBits(Ty) != TD.getTypeAllocSizeInBits(Ty);
> }
>
> /// isSafeStructAllocaToScalarRepl - Check to see if the specified
> allocation of
> @@ -1527,7 +1527,7 @@
> // Otherwise it must be an element access.
> unsigned Elt = 0;
> if (Offset) {
> - unsigned EltSize = TD->getTypePaddedSizeInBits(VTy-
> >getElementType());
> + unsigned EltSize = TD->getTypeAllocSizeInBits(VTy-
> >getElementType());
> Elt = Offset/EltSize;
> assert(EltSize*Elt == Offset && "Invalid modulus in validity
> checking");
> }
> @@ -1555,7 +1555,7 @@
> }
>
> if (const ArrayType *AT = dyn_cast<ArrayType>(ToType)) {
> - uint64_t EltSize = TD->getTypePaddedSizeInBits(AT-
> >getElementType());
> + uint64_t EltSize = TD->getTypeAllocSizeInBits(AT-
> >getElementType());
> Value *Res = UndefValue::get(AT);
> for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) {
> Value *Elt = ConvertScalar_ExtractValue(FromVal, AT-
> >getElementType(),
> @@ -1630,15 +1630,15 @@
> const Type *AllocaType = Old->getType();
>
> if (const VectorType *VTy = dyn_cast<VectorType>(AllocaType)) {
> - uint64_t VecSize = TD->getTypePaddedSizeInBits(VTy);
> - uint64_t ValSize = TD->getTypePaddedSizeInBits(SV->getType());
> + uint64_t VecSize = TD->getTypeAllocSizeInBits(VTy);
> + uint64_t ValSize = TD->getTypeAllocSizeInBits(SV->getType());
>
> // Changing the whole vector with memset or with an access of a
> different
> // vector type?
> if (ValSize == VecSize)
> return Builder.CreateBitCast(SV, AllocaType, "tmp");
>
> - uint64_t EltSize = TD->getTypePaddedSizeInBits(VTy-
> >getElementType());
> + uint64_t EltSize = TD->getTypeAllocSizeInBits(VTy-
> >getElementType());
>
> // Must be an element insertion.
> unsigned Elt = Offset/EltSize;
> @@ -1665,7 +1665,7 @@
> }
>
> if (const ArrayType *AT = dyn_cast<ArrayType>(SV->getType())) {
> - uint64_t EltSize = TD->getTypePaddedSizeInBits(AT-
> >getElementType());
> + uint64_t EltSize = TD->getTypeAllocSizeInBits(AT-
> >getElementType());
> for (unsigned i = 0, e = AT->getNumElements(); i != e; ++i) {
> Value *Elt = Builder.CreateExtractValue(SV, i, "tmp");
> Old = ConvertScalar_InsertValue(Elt, Old, Offset+i*EltSize,
> Builder);
>
> Modified: llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp Sat May 9
> 02:06:46 2009
> @@ -225,7 +225,7 @@
> cast<ConstantInt>(AddrInst->getOperand(i))->getZExtValue();
> ConstantOffset += SL->getElementOffset(Idx);
> } else {
> - uint64_t TypeSize = TD-
> >getTypePaddedSize(GTI.getIndexedType());
> + uint64_t TypeSize = TD-
> >getTypeAllocSize(GTI.getIndexedType());
> if (ConstantInt *CI = dyn_cast<ConstantInt>(AddrInst-
> >getOperand(i))) {
> ConstantOffset += CI->getSExtValue()*TypeSize;
> } else if (TypeSize) { // Scales of zero don't do anything.
>
> Modified: llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp Sat May 9
> 02:06:46 2009
> @@ -116,7 +116,7 @@
> Value *MallocArg;
> if (LowerMallocArgToInteger)
> MallocArg = ConstantInt::get(Type::Int64Ty,
> - TD.getTypePaddedSize(AllocTy));
> + TD.getTypeAllocSize(AllocTy));
> else
> MallocArg = ConstantExpr::getSizeOf(AllocTy);
> MallocArg =
> ConstantExpr::getTruncOrBitCast(cast<Constant>(MallocArg),
>
> Modified: llvm/trunk/utils/TableGen/CallingConvEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CallingConvEmitter.cpp?rev=71349&r1=71348&r2=71349&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/utils/TableGen/CallingConvEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/CallingConvEmitter.cpp Sat May 9
> 02:06:46 2009
> @@ -163,7 +163,7 @@
> O << Size << ", ";
> else
> O << "\n" << IndentStr << "
> State.getTarget().getTargetData()"
> - "->getTypePaddedSize(LocVT.getTypeForMVT()), ";
> + "->getTypeAllocSize(LocVT.getTypeForMVT()), ";
> if (Align)
> O << Align;
> else
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list