mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-08 13:00:43 +00:00
[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:
parent
475c580270
commit
643807ace9
@ -577,8 +577,6 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::pair<BasicBlock *, ExitLimit> EdgeExitInfo;
|
|
||||||
|
|
||||||
/// Information about the number of times a particular loop exit may be
|
/// Information about the number of times a particular loop exit may be
|
||||||
/// reached before exiting the loop.
|
/// reached before exiting the loop.
|
||||||
struct ExitNotTakenInfo {
|
struct ExitNotTakenInfo {
|
||||||
@ -651,6 +649,8 @@ private:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef std::pair<BasicBlock *, ExitLimit> EdgeExitInfo;
|
||||||
|
|
||||||
/// Initialize BackedgeTakenInfo from a list of exact exit counts.
|
/// Initialize BackedgeTakenInfo from a list of exact exit counts.
|
||||||
BackedgeTakenInfo(ArrayRef<EdgeExitInfo> ExitCounts, bool Complete,
|
BackedgeTakenInfo(ArrayRef<EdgeExitInfo> ExitCounts, bool Complete,
|
||||||
const SCEV *MaxCount);
|
const SCEV *MaxCount);
|
||||||
|
@ -5667,13 +5667,14 @@ bool ScalarEvolution::BackedgeTakenInfo::hasOperand(const SCEV *S,
|
|||||||
/// Allocate memory for BackedgeTakenInfo and copy the not-taken count of each
|
/// Allocate memory for BackedgeTakenInfo and copy the not-taken count of each
|
||||||
/// computable exit into a persistent ExitNotTakenInfo array.
|
/// computable exit into a persistent ExitNotTakenInfo array.
|
||||||
ScalarEvolution::BackedgeTakenInfo::BackedgeTakenInfo(
|
ScalarEvolution::BackedgeTakenInfo::BackedgeTakenInfo(
|
||||||
ArrayRef<ScalarEvolution::EdgeExitInfo> ExitCounts, bool Complete,
|
ArrayRef<ScalarEvolution::BackedgeTakenInfo::EdgeExitInfo> ExitCounts,
|
||||||
const SCEV *MaxCount)
|
bool Complete, const SCEV *MaxCount)
|
||||||
: MaxAndComplete(MaxCount, Complete) {
|
: MaxAndComplete(MaxCount, Complete) {
|
||||||
|
typedef ScalarEvolution::BackedgeTakenInfo::EdgeExitInfo EdgeExitInfo;
|
||||||
ExitNotTaken.reserve(ExitCounts.size());
|
ExitNotTaken.reserve(ExitCounts.size());
|
||||||
std::transform(
|
std::transform(
|
||||||
ExitCounts.begin(), ExitCounts.end(), std::back_inserter(ExitNotTaken),
|
ExitCounts.begin(), ExitCounts.end(), std::back_inserter(ExitNotTaken),
|
||||||
[&](const ScalarEvolution::EdgeExitInfo &EEI) {
|
[&](const EdgeExitInfo &EEI) {
|
||||||
BasicBlock *ExitBB = EEI.first;
|
BasicBlock *ExitBB = EEI.first;
|
||||||
const ExitLimit &EL = EEI.second;
|
const ExitLimit &EL = EEI.second;
|
||||||
if (EL.Predicate.isAlwaysTrue())
|
if (EL.Predicate.isAlwaysTrue())
|
||||||
@ -5696,7 +5697,9 @@ ScalarEvolution::computeBackedgeTakenCount(const Loop *L,
|
|||||||
SmallVector<BasicBlock *, 8> ExitingBlocks;
|
SmallVector<BasicBlock *, 8> ExitingBlocks;
|
||||||
L->getExitingBlocks(ExitingBlocks);
|
L->getExitingBlocks(ExitingBlocks);
|
||||||
|
|
||||||
SmallVector<ScalarEvolution::EdgeExitInfo, 4> ExitCounts;
|
typedef ScalarEvolution::BackedgeTakenInfo::EdgeExitInfo EdgeExitInfo;
|
||||||
|
|
||||||
|
SmallVector<EdgeExitInfo, 4> ExitCounts;
|
||||||
bool CouldComputeBECount = true;
|
bool CouldComputeBECount = true;
|
||||||
BasicBlock *Latch = L->getLoopLatch(); // may be NULL.
|
BasicBlock *Latch = L->getLoopLatch(); // may be NULL.
|
||||||
const SCEV *MustExitMaxBECount = nullptr;
|
const SCEV *MustExitMaxBECount = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user