summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNadav Rotem <nadav.rotem@intel.com>2012-03-26 21:00:53 +0000
committerNadav Rotem <nadav.rotem@intel.com>2012-03-26 21:00:53 +0000
commita8f3562e8f9220462dcf72fb292f55fa9b1a1b9c (patch)
tree94e7c239eef1edbe9343e04f7f17bec3e8db3406 /llvm/lib
parent91e1080bcb5246f68e1890b492a7b94802d92ee6 (diff)
downloadbcm5719-llvm-a8f3562e8f9220462dcf72fb292f55fa9b1a1b9c.tar.gz
bcm5719-llvm-a8f3562e8f9220462dcf72fb292f55fa9b1a1b9c.zip
153465 was incorrect. In this code we wanted to check that the pointer operand is of pointer type (and not vector type).
llvm-svn: 153468
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 8802ba448e7..066b2ec89c3 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -915,13 +915,12 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
// Handle gep(bitcast x) and gep(gep x, 0, 0, 0).
Value *StrippedPtr = PtrOp->stripPointerCasts();
+ PointerType *StrippedPtrTy = dyn_cast<PointerType>(StrippedPtr->getType());
- // We do not handle pointer-vector geps here
- if (!StrippedPtr)
+ // We do not handle pointer-vector geps here.
+ if (!StrippedPtrTy)
return 0;
- PointerType *StrippedPtrTy = dyn_cast<PointerType>(StrippedPtr->getType());
-
if (StrippedPtr != PtrOp &&
StrippedPtrTy->getAddressSpace() == GEP.getPointerAddressSpace()) {
OpenPOWER on IntegriCloud