From 0e622b4f8873fa0609e482689eca5b38a0f98fb6 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 27 Mar 2015 20:56:11 +0000 Subject: [PATCH] Constrain the type of a parameter now that callers without this constraint have been removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233419 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/InstCombine/InstCombineInternal.h | 2 +- lib/Transforms/InstCombine/InstructionCombining.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/Transforms/InstCombine/InstCombineInternal.h b/lib/Transforms/InstCombine/InstCombineInternal.h index fb2321df2e0..813690216a1 100644 --- a/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/lib/Transforms/InstCombine/InstCombineInternal.h @@ -316,7 +316,7 @@ private: bool ShouldChangeType(Type *From, Type *To) const; Value *dyn_castNegVal(Value *V) const; Value *dyn_castFNegVal(Value *V, bool NoSignedZero = false) const; - Type *FindElementAtOffset(Type *PtrTy, int64_t Offset, + Type *FindElementAtOffset(PointerType *PtrTy, int64_t Offset, SmallVectorImpl &NewIndices); Instruction *FoldOpIntoSelect(Instruction &Op, SelectInst *SI); diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 90551e4af22..02b91700ae9 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -869,11 +869,9 @@ Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I) { /// whether or not there is a sequence of GEP indices into the pointed type that /// will land us at the specified offset. If so, fill them into NewIndices and /// return the resultant element type, otherwise return null. -Type *InstCombiner::FindElementAtOffset(Type *PtrTy, int64_t Offset, +Type *InstCombiner::FindElementAtOffset(PointerType *PtrTy, int64_t Offset, SmallVectorImpl &NewIndices) { - assert(PtrTy->isPtrOrPtrVectorTy()); - - Type *Ty = PtrTy->getPointerElementType(); + Type *Ty = PtrTy->getElementType(); if (!Ty->isSized()) return nullptr;