From: Adam Nemet <anemet@apple.com>
Date: Fri, 7 Aug 2015 22:44:21 +0000 (+0000)
Subject: [LAA] Remove unused pointer partition argument from getNumberOfChecks, NFC
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0346fc9343c7ca24e7c5acc522007155850516f5;p=llvm

[LAA] Remove unused pointer partition argument from getNumberOfChecks, NFC

This is unused after filtering checks was moved to the clients.

As a result, we can just return the number of the checks in the
precomputed set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244369 91177308-0d34-0410-b5e6-96231b3b80d8
---

diff --git a/include/llvm/Analysis/LoopAccessAnalysis.h b/include/llvm/Analysis/LoopAccessAnalysis.h
index 2aa19ca682d..093b0a3d88f 100644
--- a/include/llvm/Analysis/LoopAccessAnalysis.h
+++ b/include/llvm/Analysis/LoopAccessAnalysis.h
@@ -393,7 +393,7 @@ public:
 
   /// \brief Returns the number of run-time checks required according to
   /// needsChecking.
-  unsigned getNumberOfChecks(const SmallVectorImpl<int> *PtrPartition) const;
+  unsigned getNumberOfChecks() const { return Checks.size(); }
 
   /// \brief Print the list run-time memory checks necessary.
   void print(raw_ostream &OS, unsigned Depth = 0) const;
@@ -484,9 +484,8 @@ public:
 
   /// \brief Number of memchecks required to prove independence of otherwise
   /// may-alias pointers.
-  unsigned getNumRuntimePointerChecks(
-    const SmallVectorImpl<int> *PtrPartition = nullptr) const {
-    return PtrRtChecking.getNumberOfChecks(PtrPartition);
+  unsigned getNumRuntimePointerChecks() const {
+    return PtrRtChecking.getNumberOfChecks();
   }
 
   /// Return true if the block BB needs to be predicated in order for the loop
diff --git a/lib/Analysis/LoopAccessAnalysis.cpp b/lib/Analysis/LoopAccessAnalysis.cpp
index 645b47758de..f42b93d6dfa 100644
--- a/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/lib/Analysis/LoopAccessAnalysis.cpp
@@ -412,19 +412,6 @@ void RuntimePointerChecking::print(raw_ostream &OS, unsigned Depth) const {
   }
 }
 
-unsigned RuntimePointerChecking::getNumberOfChecks(
-    const SmallVectorImpl<int> *PtrPartition) const {
-
-  unsigned NumPartitions = CheckingGroups.size();
-  unsigned CheckCount = 0;
-
-  for (unsigned I = 0; I < NumPartitions; ++I)
-    for (unsigned J = I + 1; J < NumPartitions; ++J)
-      if (needsChecking(CheckingGroups[I], CheckingGroups[J], PtrPartition))
-        CheckCount++;
-  return CheckCount;
-}
-
 namespace {
 /// \brief Analyses memory accesses in a loop.
 ///
@@ -648,7 +635,7 @@ bool AccessAnalysis::canCheckPtrAtRT(RuntimePointerChecking &RtCheck,
   if (NeedRTCheck && CanDoRT)
     RtCheck.generateChecks(DepCands, IsDepCheckNeeded);
 
-  DEBUG(dbgs() << "LAA: We need to do " << RtCheck.getNumberOfChecks(nullptr)
+  DEBUG(dbgs() << "LAA: We need to do " << RtCheck.getNumberOfChecks()
                << " pointer comparisons.\n");
 
   RtCheck.Need = NeedRTCheck;