]> granicus.if.org Git - llvm/commitdiff
[SCEV] Further isolate incidental data structure; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 26 Sep 2016 01:10:25 +0000 (01:10 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 26 Sep 2016 01:10:25 +0000 (01:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282373 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp

index 4b5fb473dce6a2300eec9f8a93322cab95bdd1fa..09f6e8aa2c82d7c10779cdd2ae8b8ab5754bb044 100644 (file)
@@ -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);
index 746487dcde1b67c562ab2fada449475b287e8024..b6edbb8e974d6e1d2467a2d98c8f13cd03e81e9e 100644 (file)
@@ -5667,13 +5667,14 @@ bool ScalarEvolution::BackedgeTakenInfo::hasOperand(const SCEV *S,
 /// 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::computeBackedgeTakenCount(const Loop *L,
   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;