[llvm] r282373 - [SCEV] Further isolate incidental data structure; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 25 18:10:25 PDT 2016


Author: sanjoy
Date: Sun Sep 25 20:10:25 2016
New Revision: 282373

URL: http://llvm.org/viewvc/llvm-project?rev=282373&view=rev
Log:
[SCEV] Further isolate incidental data structure; NFC

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

Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=282373&r1=282372&r2=282373&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Sun Sep 25 20:10:25 2016
@@ -577,8 +577,6 @@ private:
     }
   };
 
-  typedef std::pair<BasicBlock *, ExitLimit> EdgeExitInfo;
-
   /// Information about the number of times a particular loop exit may be
   /// reached before exiting the loop.
   struct ExitNotTakenInfo {
@@ -651,6 +649,8 @@ private:
       return *this;
     }
 
+    typedef std::pair<BasicBlock *, ExitLimit> EdgeExitInfo;
+
     /// Initialize BackedgeTakenInfo from a list of exact exit counts.
     BackedgeTakenInfo(ArrayRef<EdgeExitInfo> ExitCounts, bool Complete,
                       const SCEV *MaxCount);

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=282373&r1=282372&r2=282373&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Sep 25 20:10:25 2016
@@ -5667,13 +5667,14 @@ bool ScalarEvolution::BackedgeTakenInfo:
 /// Allocate memory for BackedgeTakenInfo and copy the not-taken count of each
 /// computable exit into a persistent ExitNotTakenInfo array.
 ScalarEvolution::BackedgeTakenInfo::BackedgeTakenInfo(
-    ArrayRef<ScalarEvolution::EdgeExitInfo> ExitCounts, bool Complete,
-    const SCEV *MaxCount)
+    ArrayRef<ScalarEvolution::BackedgeTakenInfo::EdgeExitInfo> ExitCounts,
+    bool Complete, const SCEV *MaxCount)
     : MaxAndComplete(MaxCount, Complete) {
+  typedef ScalarEvolution::BackedgeTakenInfo::EdgeExitInfo EdgeExitInfo;
   ExitNotTaken.reserve(ExitCounts.size());
   std::transform(
       ExitCounts.begin(), ExitCounts.end(), std::back_inserter(ExitNotTaken),
-      [&](const ScalarEvolution::EdgeExitInfo &EEI) {
+      [&](const EdgeExitInfo &EEI) {
         BasicBlock *ExitBB = EEI.first;
         const ExitLimit &EL = EEI.second;
         if (EL.Predicate.isAlwaysTrue())
@@ -5696,7 +5697,9 @@ ScalarEvolution::computeBackedgeTakenCou
   SmallVector<BasicBlock *, 8> ExitingBlocks;
   L->getExitingBlocks(ExitingBlocks);
 
-  SmallVector<ScalarEvolution::EdgeExitInfo, 4> ExitCounts;
+  typedef ScalarEvolution::BackedgeTakenInfo::EdgeExitInfo EdgeExitInfo;
+
+  SmallVector<EdgeExitInfo, 4> ExitCounts;
   bool CouldComputeBECount = true;
   BasicBlock *Latch = L->getLoopLatch(); // may be NULL.
   const SCEV *MustExitMaxBECount = nullptr;




More information about the llvm-commits mailing list