153465 was incorrect. In this code we wanted to check that the pointer operand is of pointer type (and not vector type).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153468 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem 2012-03-26 21:00:53 +00:00
parent b38aae442f
commit 02f0a49bba

View File

@ -915,13 +915,12 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
// Handle gep(bitcast x) and gep(gep x, 0, 0, 0).
Value *StrippedPtr = PtrOp->stripPointerCasts();
// We do not handle pointer-vector geps here
if (!StrippedPtr)
return 0;
PointerType *StrippedPtrTy = dyn_cast<PointerType>(StrippedPtr->getType());
// We do not handle pointer-vector geps here.
if (!StrippedPtrTy)
return 0;
if (StrippedPtr != PtrOp &&
StrippedPtrTy->getAddressSpace() == GEP.getPointerAddressSpace()) {