From 90fec840ebd7210aeb011e411e663359d7a8b45f Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Thu, 2 Apr 2015 17:51:57 +0000 Subject: [LoopAccesses] Handle case when no memchecks are needed after partitioning llvm-svn: 233930 --- llvm/lib/Analysis/LoopAccessAnalysis.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 1818e93eb0e..159efff1a70 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -1211,9 +1211,8 @@ static Instruction *getFirstInst(Instruction *FirstInst, Value *V, std::pair LoopAccessInfo::addRuntimeCheck( Instruction *Loc, const SmallVectorImpl *PtrPartition) const { - Instruction *tnullptr = nullptr; if (!PtrRtCheck.Need) - return std::pair(tnullptr, tnullptr); + return std::make_pair(nullptr, nullptr); unsigned NumPointers = PtrRtCheck.Pointers.size(); SmallVector , 2> Starts; @@ -1284,6 +1283,9 @@ std::pair LoopAccessInfo::addRuntimeCheck( } } + if (!MemoryRuntimeCheck) + return std::make_pair(nullptr, nullptr); + // We have to do this trickery because the IRBuilder might fold the check to a // constant expression in which case there is no Instruction anchored in a // the block. -- cgit v1.2.3