diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:04:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:04:03 +0000 |
commit | f8af5cf600354830d4ccf59732403f0f073eccb9 (patch) | |
tree | 2ba0398b4c42ad4f55561327538044fd2c925a8b /lib/Target/R600/AMDGPUFrameLowering.cpp | |
parent | 59d6cff90eecf31cb3dd860c4e786674cfdd42eb (diff) |
Diffstat (limited to 'lib/Target/R600/AMDGPUFrameLowering.cpp')
-rw-r--r-- | lib/Target/R600/AMDGPUFrameLowering.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/lib/Target/R600/AMDGPUFrameLowering.cpp b/lib/Target/R600/AMDGPUFrameLowering.cpp index 815d6f71c3be6..40f14d2f67c51 100644 --- a/lib/Target/R600/AMDGPUFrameLowering.cpp +++ b/lib/Target/R600/AMDGPUFrameLowering.cpp @@ -78,27 +78,8 @@ int AMDGPUFrameLowering::getFrameIndexOffset(const MachineFunction &MF, int UpperBound = FI == -1 ? MFI->getNumObjects() : FI; for (int i = MFI->getObjectIndexBegin(); i < UpperBound; ++i) { - const AllocaInst *Alloca = MFI->getObjectAllocation(i); - unsigned ArrayElements; - const Type *AllocaType = Alloca->getAllocatedType(); - const Type *ElementType; - - if (AllocaType->isArrayTy()) { - ArrayElements = AllocaType->getArrayNumElements(); - ElementType = AllocaType->getArrayElementType(); - } else { - ArrayElements = 1; - ElementType = AllocaType; - } - - unsigned VectorElements; - if (ElementType->isVectorTy()) { - VectorElements = ElementType->getVectorNumElements(); - } else { - VectorElements = 1; - } - - Offset += (VectorElements / getStackWidth(MF)) * ArrayElements; + unsigned Size = MFI->getObjectSize(i); + Offset += (Size / (getStackWidth(MF) * 4)); } return Offset; } |