diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 5 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 18 |
4 files changed, 15 insertions, 14 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 3d0348d5d1..bcba15192c 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -273,7 +273,7 @@ bool FastISel::SelectGetElementPtr(User *I) { if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) { if (CI->getZExtValue() == 0) continue; uint64_t Offs = - TD.getABITypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue(); + TD.getTypePaddedSize(Ty)*cast<ConstantInt>(CI)->getSExtValue(); N = FastEmit_ri_(VT, ISD::ADD, N, Offs, VT); if (N == 0) // Unhandled operand. Halt "fast" selection and bail. @@ -282,7 +282,7 @@ bool FastISel::SelectGetElementPtr(User *I) { } // N = N + Idx * ElementSize; - uint64_t ElementSize = TD.getABITypeSize(Ty); + uint64_t ElementSize = TD.getTypePaddedSize(Ty); unsigned IdxN = getRegForGEPIndex(Idx); if (IdxN == 0) // Unhandled operand. Halt "fast" selection and bail. diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 97b526f4fe..c535f3a082 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3572,8 +3572,9 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { SDValue VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2, V, 0); // Increment the pointer, VAList, to the next vaarg Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList, - DAG.getConstant(TLI.getTargetData()->getABITypeSize(VT.getTypeForMVT()), - TLI.getPointerTy())); + DAG.getConstant(TLI.getTargetData()-> + getTypePaddedSize(VT.getTypeForMVT()), + TLI.getPointerTy())); // Store the incremented VAList to the legalized pointer Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0); // Load the actual argument out of the pointer VAList diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp index d617965158..e93d4a64f3 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp @@ -296,7 +296,7 @@ void ScheduleDAGSDNodes::AddOperand(MachineInstr *MI, SDValue Op, Align = TM.getTargetData()->getPreferredTypeAlignmentShift(Type); if (Align == 0) { // Alignment of vector types. FIXME! - Align = TM.getTargetData()->getABITypeSize(Type); + Align = TM.getTargetData()->getTypePaddedSize(Type); Align = Log2_64(Align); } } diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index c8985b47f0..294acd8370 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -125,7 +125,7 @@ static void ComputeValueVTs(const TargetLowering &TLI, const Type *Ty, // 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()->getABITypeSize(EltTy); + uint64_t EltSize = TLI.getTargetData()->getTypePaddedSize(EltTy); for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) ComputeValueVTs(TLI, EltTy, ValueVTs, Offsets, StartingOffset + i * EltSize); @@ -288,7 +288,7 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf, 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()->getABITypeSize(Ty); + uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty); unsigned Align = std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), AI->getAlignment()); @@ -2603,14 +2603,14 @@ void SelectionDAGLowering::visitGetElementPtr(User &I) { if (ConstantInt *CI = dyn_cast<ConstantInt>(Idx)) { if (CI->getZExtValue() == 0) continue; uint64_t Offs = - TD->getABITypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue(); + TD->getTypePaddedSize(Ty)*cast<ConstantInt>(CI)->getSExtValue(); N = DAG.getNode(ISD::ADD, N.getValueType(), N, DAG.getIntPtrConstant(Offs)); continue; } // N = N + Idx * ElementSize; - uint64_t ElementSize = TD->getABITypeSize(Ty); + uint64_t ElementSize = TD->getTypePaddedSize(Ty); SDValue IdxN = getValue(Idx); // If the index is smaller or larger than intptr_t, truncate or extend @@ -2646,7 +2646,7 @@ void SelectionDAGLowering::visitAlloca(AllocaInst &I) { return; // getValue will auto-populate this. const Type *Ty = I.getAllocatedType(); - uint64_t TySize = TLI.getTargetData()->getABITypeSize(Ty); + uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty); unsigned Align = std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), I.getAlignment()); @@ -4951,7 +4951,7 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { // Otherwise, create a stack slot and emit a store to it before the // asm. const Type *Ty = OpVal->getType(); - uint64_t TySize = TLI.getTargetData()->getABITypeSize(Ty); + uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty); unsigned Align = TLI.getTargetData()->getPrefTypeAlignment(Ty); MachineFunction &MF = DAG.getMachineFunction(); int SSFI = MF.getFrameInfo()->CreateStackObject(TySize, Align); @@ -5236,7 +5236,7 @@ void SelectionDAGLowering::visitMalloc(MallocInst &I) { Src = DAG.getNode(ISD::ZERO_EXTEND, IntPtr, Src); // Scale the source by the type size. - uint64_t ElementSize = TD->getABITypeSize(I.getType()->getElementType()); + uint64_t ElementSize = TD->getTypePaddedSize(I.getType()->getElementType()); Src = DAG.getNode(ISD::MUL, Src.getValueType(), Src, DAG.getIntPtrConstant(ElementSize)); @@ -5337,7 +5337,7 @@ void TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG, const PointerType *Ty = cast<PointerType>(I->getType()); const Type *ElementTy = Ty->getElementType(); unsigned FrameAlign = getByValTypeAlignment(ElementTy); - unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy); + unsigned FrameSize = getTargetData()->getTypePaddedSize(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)) @@ -5470,7 +5470,7 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy, const PointerType *Ty = cast<PointerType>(Args[i].Ty); const Type *ElementTy = Ty->getElementType(); unsigned FrameAlign = getByValTypeAlignment(ElementTy); - unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy); + unsigned FrameSize = getTargetData()->getTypePaddedSize(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) |