]> granicus.if.org Git - llvm/commitdiff
[LoopAccesses] Handle case when no memchecks are needed after partitioning
authorAdam Nemet <anemet@apple.com>
Thu, 2 Apr 2015 17:51:57 +0000 (17:51 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 2 Apr 2015 17:51:57 +0000 (17:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233930 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LoopAccessAnalysis.cpp

index 1818e93eb0e39819fb539b8aa0e9370a050974f3..159efff1a7094f3eed22e681fdf63e8d3530a5f9 100644 (file)
@@ -1211,9 +1211,8 @@ static Instruction *getFirstInst(Instruction *FirstInst, Value *V,
 
 std::pair<Instruction *, Instruction *> LoopAccessInfo::addRuntimeCheck(
     Instruction *Loc, const SmallVectorImpl<int> *PtrPartition) const {
-  Instruction *tnullptr = nullptr;
   if (!PtrRtCheck.Need)
-    return std::pair<Instruction *, Instruction *>(tnullptr, tnullptr);
+    return std::make_pair(nullptr, nullptr);
 
   unsigned NumPointers = PtrRtCheck.Pointers.size();
   SmallVector<TrackingVH<Value> , 2> Starts;
@@ -1284,6 +1283,9 @@ std::pair<Instruction *, Instruction *> 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.