1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

do not generated GEPs into vectors where they don't already exist.

We should treat vectors as atomic types, not like arrays.

llvm-svn: 62046
This commit is contained in:
Chris Lattner 2009-01-11 20:23:52 +00:00
parent d2011c4015
commit d1e5994f90

View File

@ -7739,13 +7739,12 @@ static bool FindElementAtOffset(const Type *Ty, int64_t Offset,
Offset -= SL->getElementOffset(Elt);
Ty = STy->getElementType(Elt);
} else if (isa<ArrayType>(Ty) || isa<VectorType>(Ty)) {
const SequentialType *STy = cast<SequentialType>(Ty);
uint64_t EltSize = TD->getABITypeSize(STy->getElementType());
} else if (const ArrayType *AT = dyn_cast<ArrayType>(Ty)) {
uint64_t EltSize = TD->getABITypeSize(AT->getElementType());
assert(EltSize && "Cannot index into a zero-sized array");
NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize));
Offset %= EltSize;
Ty = STy->getElementType();
Ty = AT->getElementType();
} else {
// Otherwise, we can't index into the middle of this atomic type, bail.
return false;