diff options
author | Dan Gohman <gohman@apple.com> | 2010-02-24 22:05:23 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-02-24 22:05:23 +0000 |
commit | c382bc3c0f476bf94303d9892af4e2cee173bfe5 (patch) | |
tree | 177ed972f2efd65c0f0296b1899e97042128a4cb /lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | |
parent | 46ca5efdd5b748ba8aa62168f7753cb46b683bc5 (diff) |
Make getTypeSizeInBits work correctly for array types; it should return
the number of value bits, not the number of bits of allocation for in-memory
storage.
Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and
vectors.
Fix several places in CodeGen which compute offsets into in-memory vectors
to use TargetData information.
This fixes PR1784.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypes.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp index 0d929f12c9..2c364dc34a 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp @@ -966,7 +966,8 @@ SDValue DAGTypeLegalizer::GetVectorElementPointer(SDValue VecPtr, EVT EltVT, Index = DAG.getNode(ISD::ZERO_EXTEND, dl, TLI.getPointerTy(), Index); // Calculate the element offset and add it to the pointer. - unsigned EltSize = EltVT.getSizeInBits() / 8; // FIXME: should be ABI size. + unsigned EltSize = TLI.getTargetData()-> + getTypeAllocSize(EltVT.getTypeForEVT(*DAG.getContext())); Index = DAG.getNode(ISD::MUL, dl, Index.getValueType(), Index, DAG.getConstant(EltSize, Index.getValueType())); |