aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/InstCombine/InstructionCombining.cpp
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
commit02f0a49bbaa9a0f881ef18abd3b06168c2b35135 (patch)
tree6e169e79bc932f045dd846771947cb260ca684ef /lib/Transforms/InstCombine/InstructionCombining.cpp
parentb38aae442f0e3ce11a6231455b180bfc66ab5d3e (diff)
downloadexternal_llvm-02f0a49bbaa9a0f881ef18abd3b06168c2b35135.zip
external_llvm-02f0a49bbaa9a0f881ef18abd3b06168c2b35135.tar.gz
external_llvm-02f0a49bbaa9a0f881ef18abd3b06168c2b35135.tar.bz2
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
Diffstat (limited to 'lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp
index 8802ba4..066b2ec 100644
--- a/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/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()) {