mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-12 02:47:10 +00:00
Use consistent terminology for loop exit/exiting blocks. Name change only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136677 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7a3824b923
commit
fcb4356dee
@ -264,11 +264,11 @@ namespace llvm {
|
|||||||
/// ExitNotTakenInfo - Information about the number of times a particular
|
/// ExitNotTakenInfo - Information about the number of times a particular
|
||||||
/// loop exit may be reached before exiting the loop.
|
/// loop exit may be reached before exiting the loop.
|
||||||
struct ExitNotTakenInfo {
|
struct ExitNotTakenInfo {
|
||||||
BasicBlock *ExitBlock;
|
BasicBlock *ExitingBlock;
|
||||||
const SCEV *ExactNotTaken;
|
const SCEV *ExactNotTaken;
|
||||||
PointerIntPair<ExitNotTakenInfo*, 1> NextExit;
|
PointerIntPair<ExitNotTakenInfo*, 1> NextExit;
|
||||||
|
|
||||||
ExitNotTakenInfo() : ExitBlock(0), ExactNotTaken(0) {}
|
ExitNotTakenInfo() : ExitingBlock(0), ExactNotTaken(0) {}
|
||||||
|
|
||||||
/// isCompleteList - Return true if all loop exits are computable.
|
/// isCompleteList - Return true if all loop exits are computable.
|
||||||
bool isCompleteList() const {
|
bool isCompleteList() const {
|
||||||
@ -309,7 +309,7 @@ namespace llvm {
|
|||||||
/// computed information, or whether it's all SCEVCouldNotCompute
|
/// computed information, or whether it's all SCEVCouldNotCompute
|
||||||
/// values.
|
/// values.
|
||||||
bool hasAnyInfo() const {
|
bool hasAnyInfo() const {
|
||||||
return ExitNotTaken.ExitBlock || !isa<SCEVCouldNotCompute>(Max);
|
return ExitNotTaken.ExitingBlock || !isa<SCEVCouldNotCompute>(Max);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getExact - Return an expression indicating the exact backedge-taken
|
/// getExact - Return an expression indicating the exact backedge-taken
|
||||||
@ -321,7 +321,7 @@ namespace llvm {
|
|||||||
/// getExact - Return the number of times this loop exit may fall through
|
/// getExact - Return the number of times this loop exit may fall through
|
||||||
/// to the back edge. The loop is guaranteed not to exit via this block
|
/// to the back edge. The loop is guaranteed not to exit via this block
|
||||||
/// before this number of iterations, but may exit via another block.
|
/// before this number of iterations, but may exit via another block.
|
||||||
const SCEV *getExact(BasicBlock *ExitBlock, ScalarEvolution *SE) const;
|
const SCEV *getExact(BasicBlock *ExitingBlock, ScalarEvolution *SE) const;
|
||||||
|
|
||||||
/// getMax - Get the max backedge taken count for the loop.
|
/// getMax - Get the max backedge taken count for the loop.
|
||||||
const SCEV *getMax(ScalarEvolution *SE) const;
|
const SCEV *getMax(ScalarEvolution *SE) const;
|
||||||
@ -711,9 +711,9 @@ namespace llvm {
|
|||||||
const SCEV *LHS, const SCEV *RHS);
|
const SCEV *LHS, const SCEV *RHS);
|
||||||
|
|
||||||
// getExitCount - Get the expression for the number of loop iterations for
|
// getExitCount - Get the expression for the number of loop iterations for
|
||||||
// which this loop is guaranteed not to exit via ExitBlock. Otherwise return
|
// which this loop is guaranteed not to exit via ExitingBlock. Otherwise
|
||||||
// SCEVCouldNotCompute.
|
// return SCEVCouldNotCompute.
|
||||||
const SCEV *getExitCount(Loop *L, BasicBlock *ExitBlock);
|
const SCEV *getExitCount(Loop *L, BasicBlock *ExitingBlock);
|
||||||
|
|
||||||
/// getBackedgeTakenCount - If the specified loop has a predictable
|
/// getBackedgeTakenCount - If the specified loop has a predictable
|
||||||
/// backedge-taken count, return it, otherwise return a SCEVCouldNotCompute
|
/// backedge-taken count, return it, otherwise return a SCEVCouldNotCompute
|
||||||
|
@ -3814,10 +3814,10 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) {
|
|||||||
//
|
//
|
||||||
|
|
||||||
// getExitCount - Get the expression for the number of loop iterations for which
|
// getExitCount - Get the expression for the number of loop iterations for which
|
||||||
// this loop is guaranteed not to exit via ExitBlock. Otherwise return
|
// this loop is guaranteed not to exit via ExitintBlock. Otherwise return
|
||||||
// SCEVCouldNotCompute.
|
// SCEVCouldNotCompute.
|
||||||
const SCEV *ScalarEvolution::getExitCount(Loop *L, BasicBlock *ExitBlock) {
|
const SCEV *ScalarEvolution::getExitCount(Loop *L, BasicBlock *ExitingBlock) {
|
||||||
return getBackedgeTakenInfo(L).getExact(ExitBlock, this);
|
return getBackedgeTakenInfo(L).getExact(ExitingBlock, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getBackedgeTakenCount - If the specified loop has a predictable
|
/// getBackedgeTakenCount - If the specified loop has a predictable
|
||||||
@ -4002,7 +4002,7 @@ ScalarEvolution::BackedgeTakenInfo::getExact(ScalarEvolution *SE) const {
|
|||||||
if (!ExitNotTaken.isCompleteList()) return SE->getCouldNotCompute();
|
if (!ExitNotTaken.isCompleteList()) return SE->getCouldNotCompute();
|
||||||
|
|
||||||
// We need at least one computable exit.
|
// We need at least one computable exit.
|
||||||
if (!ExitNotTaken.ExitBlock) return SE->getCouldNotCompute();
|
if (!ExitNotTaken.ExitingBlock) return SE->getCouldNotCompute();
|
||||||
assert(ExitNotTaken.ExactNotTaken && "uninitialized not-taken info");
|
assert(ExitNotTaken.ExactNotTaken && "uninitialized not-taken info");
|
||||||
|
|
||||||
const SCEV *BECount = 0;
|
const SCEV *BECount = 0;
|
||||||
@ -4021,12 +4021,12 @@ ScalarEvolution::BackedgeTakenInfo::getExact(ScalarEvolution *SE) const {
|
|||||||
|
|
||||||
/// getExact - Get the exact not taken count for this loop exit.
|
/// getExact - Get the exact not taken count for this loop exit.
|
||||||
const SCEV *
|
const SCEV *
|
||||||
ScalarEvolution::BackedgeTakenInfo::getExact(BasicBlock *ExitBlock,
|
ScalarEvolution::BackedgeTakenInfo::getExact(BasicBlock *ExitingBlock,
|
||||||
ScalarEvolution *SE) const {
|
ScalarEvolution *SE) const {
|
||||||
for (const ExitNotTakenInfo *ENT = &ExitNotTaken;
|
for (const ExitNotTakenInfo *ENT = &ExitNotTaken;
|
||||||
ENT != 0; ENT = ENT->getNextExit()) {
|
ENT != 0; ENT = ENT->getNextExit()) {
|
||||||
|
|
||||||
if (ENT->ExitBlock == ExitBlock)
|
if (ENT->ExitingBlock == ExitingBlock)
|
||||||
return ENT->ExactNotTaken;
|
return ENT->ExactNotTaken;
|
||||||
}
|
}
|
||||||
return SE->getCouldNotCompute();
|
return SE->getCouldNotCompute();
|
||||||
@ -4050,7 +4050,7 @@ ScalarEvolution::BackedgeTakenInfo::BackedgeTakenInfo(
|
|||||||
unsigned NumExits = ExitCounts.size();
|
unsigned NumExits = ExitCounts.size();
|
||||||
if (NumExits == 0) return;
|
if (NumExits == 0) return;
|
||||||
|
|
||||||
ExitNotTaken.ExitBlock = ExitCounts[0].first;
|
ExitNotTaken.ExitingBlock = ExitCounts[0].first;
|
||||||
ExitNotTaken.ExactNotTaken = ExitCounts[0].second;
|
ExitNotTaken.ExactNotTaken = ExitCounts[0].second;
|
||||||
if (NumExits == 1) return;
|
if (NumExits == 1) return;
|
||||||
|
|
||||||
@ -4060,14 +4060,14 @@ ScalarEvolution::BackedgeTakenInfo::BackedgeTakenInfo(
|
|||||||
ExitNotTakenInfo *PrevENT = &ExitNotTaken;
|
ExitNotTakenInfo *PrevENT = &ExitNotTaken;
|
||||||
for (unsigned i = 1; i < NumExits; ++i, PrevENT = ENT, ++ENT) {
|
for (unsigned i = 1; i < NumExits; ++i, PrevENT = ENT, ++ENT) {
|
||||||
PrevENT->setNextExit(ENT);
|
PrevENT->setNextExit(ENT);
|
||||||
ENT->ExitBlock = ExitCounts[i].first;
|
ENT->ExitingBlock = ExitCounts[i].first;
|
||||||
ENT->ExactNotTaken = ExitCounts[i].second;
|
ENT->ExactNotTaken = ExitCounts[i].second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// clear - Invalidate this result and free the ExitNotTakenInfo array.
|
/// clear - Invalidate this result and free the ExitNotTakenInfo array.
|
||||||
void ScalarEvolution::BackedgeTakenInfo::clear() {
|
void ScalarEvolution::BackedgeTakenInfo::clear() {
|
||||||
ExitNotTaken.ExitBlock = 0;
|
ExitNotTaken.ExitingBlock = 0;
|
||||||
ExitNotTaken.ExactNotTaken = 0;
|
ExitNotTaken.ExactNotTaken = 0;
|
||||||
delete[] ExitNotTaken.getNextExit();
|
delete[] ExitNotTaken.getNextExit();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user