Don't crash if the load/store pointer is not a GEP.

Fix by Shivarama Rao <Shivarama.Rao@amd.com>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166427 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem
2012-10-22 18:27:56 +00:00
parent 81750822f4
commit 782090aa02
2 changed files with 58 additions and 1 deletions

View File

@ -389,7 +389,7 @@ Value *SingleBlockLoopVectorizer::getConsecutiveVector(Value* Val) {
}
bool LoopVectorizationLegality::isConsecutiveGep(Value *Ptr) {
GetElementPtrInst *Gep = dyn_cast<GetElementPtrInst>(Ptr);
GetElementPtrInst *Gep = dyn_cast_or_null<GetElementPtrInst>(Ptr);
if (!Gep)
return false;