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

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 15:44:22 PDT 2015


Author: anemet
Date: Fri Aug  7 17:44:21 2015
New Revision: 244369

URL: http://llvm.org/viewvc/llvm-project?rev=244369&view=rev
Log:
[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.

Modified:
    llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h
    llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp

Modified: llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h?rev=244369&r1=244368&r2=244369&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopAccessAnalysis.h Fri Aug  7 17:44:21 2015
@@ -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

Modified: llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp?rev=244369&r1=244368&r2=244369&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopAccessAnalysis.cpp Fri Aug  7 17:44:21 2015
@@ -412,19 +412,6 @@ void RuntimePointerChecking::print(raw_o
   }
 }
 
-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(Run
   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;




More information about the llvm-commits mailing list