[SCEV] Further isolate incidental data structure; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjoy Das 2016-09-26 01:10:25 +00:00
parent 475c580270
commit 643807ace9
2 changed files with 9 additions and 6 deletions

View 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);

View 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;