aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-11-22 16:32:50 +0000
committerDuncan Sands <baldrick@free.fr>2010-11-22 16:32:50 +0000
commita63395a30f9227bde826749d3480046301b47332 (patch)
tree98e2d9964feb8bea8b582060b45add77b35c6fa0 /lib/Analysis
parentd87e571e6240c3d7d18b0a5f823a9c622c16c0aa (diff)
If a GEP index simply advances by multiples of a type of zero size,
then replace the index with zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119974 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/InstructionSimplify.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index e617ff2980..4b6320bb46 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -714,7 +714,7 @@ Value *llvm::SimplifyGEPInst(Value *const *Ops, unsigned NumOps,
// getelementptr P, N -> P if P points to a type of zero size.
if (TD) {
const Type *Ty = PtrTy->getElementType();
- if (Ty->isSized() && !TD->getTypeAllocSize(Ty))
+ if (Ty->isSized() && TD->getTypeAllocSize(Ty) == 0)
return Ops[0];
}
}