[llvm-commits] [llvm] r153468 - /llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
Nadav Rotem
nadav.rotem at intel.com
Mon Mar 26 14:00:53 PDT 2012
Author: nadav
Date: Mon Mar 26 16:00:53 2012
New Revision: 153468
URL: http://llvm.org/viewvc/llvm-project?rev=153468&view=rev
Log:
153465 was incorrect. In this code we wanted to check that the pointer operand is of pointer type (and not vector type).
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=153468&r1=153467&r2=153468&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Mon Mar 26 16:00:53 2012
@@ -915,13 +915,12 @@
// 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()) {
More information about the llvm-commits
mailing list