From e991ced7cb5cb86d1c33b8d400b1be41185bc69f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 6 Feb 2009 04:34:07 +0000 Subject: fix PR3489, use bits instead of bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63916 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/ScalarReplAggregates.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index c1c8e03..a396dc4 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -1431,7 +1431,7 @@ Value *SROA::ConvertScalar_ExtractValue(Value *FromVal, const Type *ToType, Value *Res = UndefValue::get(ST); for (unsigned i = 0, e = ST->getNumElements(); i != e; ++i) { Value *Elt = ConvertScalar_ExtractValue(FromVal, ST->getElementType(i), - Offset+Layout.getElementOffset(i), + Offset+Layout.getElementOffsetInBits(i), Builder); Res = Builder.CreateInsertValue(Res, Elt, i, "tmp"); } @@ -1538,7 +1538,7 @@ Value *SROA::ConvertScalar_InsertValue(Value *SV, Value *Old, for (unsigned i = 0, e = ST->getNumElements(); i != e; ++i) { Value *Elt = Builder.CreateExtractValue(SV, i, "tmp"); Old = ConvertScalar_InsertValue(Elt, Old, - Offset+Layout.getElementOffset(i), + Offset+Layout.getElementOffsetInBits(i), Builder); } return Old; -- cgit v1.1