diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-11 20:23:52 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-11 20:23:52 +0000 |
| commit | b19151686f949398bfc8101572cbc697f2b55ff4 (patch) | |
| tree | 74003caac7524478202bca59c5989c0a41b421c4 /llvm/lib | |
| parent | 171d2d474f66ca96087b6ba4afe00b6073cdfb0a (diff) | |
| download | bcm5719-llvm-b19151686f949398bfc8101572cbc697f2b55ff4.tar.gz bcm5719-llvm-b19151686f949398bfc8101572cbc697f2b55ff4.zip | |
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
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index fd15f2e1ca8..b6604a930d6 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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; |

