From 6b76cdf0d5b207bb431285e6584477f219640acc Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Mon, 26 Sep 2016 01:10:25 +0000 Subject: [PATCH] [SCEV] Further isolate incidental data structure; NFC llvm-svn: 282373 --- llvm/include/llvm/Analysis/ScalarEvolution.h | 4 ++-- llvm/lib/Analysis/ScalarEvolution.cpp | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h index 4b5fb47..09f6e8a 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolution.h +++ b/llvm/include/llvm/Analysis/ScalarEvolution.h @@ -577,8 +577,6 @@ private: } }; - typedef std::pair 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 EdgeExitInfo; + /// Initialize BackedgeTakenInfo from a list of exact exit counts. BackedgeTakenInfo(ArrayRef ExitCounts, bool Complete, const SCEV *MaxCount); diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 746487d..b6edbb8 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -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 ExitCounts, bool Complete, - const SCEV *MaxCount) + ArrayRef 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 ExitingBlocks; L->getExitingBlocks(ExitingBlocks); - SmallVector ExitCounts; + typedef ScalarEvolution::BackedgeTakenInfo::EdgeExitInfo EdgeExitInfo; + + SmallVector ExitCounts; bool CouldComputeBECount = true; BasicBlock *Latch = L->getLoopLatch(); // may be NULL. const SCEV *MustExitMaxBECount = nullptr; -- 2.7.4