mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Rename forgetLoopBackedgeTakenCount to forgetLoop, because it
clears out more information than just the stored backedge taken count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -563,11 +563,10 @@ namespace llvm {
|
|||||||
/// has an analyzable loop-invariant backedge-taken count.
|
/// has an analyzable loop-invariant backedge-taken count.
|
||||||
bool hasLoopInvariantBackedgeTakenCount(const Loop *L);
|
bool hasLoopInvariantBackedgeTakenCount(const Loop *L);
|
||||||
|
|
||||||
/// forgetLoopBackedgeTakenCount - This method should be called by the
|
/// forgetLoop - This method should be called by the client when it has
|
||||||
/// client when it has changed a loop in a way that may effect
|
/// changed a loop in a way that may effect ScalarEvolution's ability to
|
||||||
/// ScalarEvolution's ability to compute a trip count, or if the loop
|
/// compute a trip count, or if the loop is deleted.
|
||||||
/// is deleted.
|
void forgetLoop(const Loop *L);
|
||||||
void forgetLoopBackedgeTakenCount(const Loop *L);
|
|
||||||
|
|
||||||
/// GetMinTrailingZeros - Determine the minimum number of zero bits that S
|
/// GetMinTrailingZeros - Determine the minimum number of zero bits that S
|
||||||
/// is guaranteed to end in (at every loop iteration). It is, at the same
|
/// is guaranteed to end in (at every loop iteration). It is, at the same
|
||||||
|
@@ -3265,9 +3265,8 @@ ScalarEvolution::getBackedgeTakenInfo(const Loop *L) {
|
|||||||
// Now that we know more about the trip count for this loop, forget any
|
// Now that we know more about the trip count for this loop, forget any
|
||||||
// existing SCEV values for PHI nodes in this loop since they are only
|
// existing SCEV values for PHI nodes in this loop since they are only
|
||||||
// conservative estimates made without the benefit of trip count
|
// conservative estimates made without the benefit of trip count
|
||||||
// information. This is similar to the code in
|
// information. This is similar to the code in forgetLoop, except that
|
||||||
// forgetLoopBackedgeTakenCount, except that it handles SCEVUnknown PHI
|
// it handles SCEVUnknown PHI nodes specially.
|
||||||
// nodes specially.
|
|
||||||
if (ItCount.hasAnyInfo()) {
|
if (ItCount.hasAnyInfo()) {
|
||||||
SmallVector<Instruction *, 16> Worklist;
|
SmallVector<Instruction *, 16> Worklist;
|
||||||
PushLoopPHIs(L, Worklist);
|
PushLoopPHIs(L, Worklist);
|
||||||
@@ -3301,13 +3300,14 @@ ScalarEvolution::getBackedgeTakenInfo(const Loop *L) {
|
|||||||
return Pair.first->second;
|
return Pair.first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// forgetLoopBackedgeTakenCount - This method should be called by the
|
/// forgetLoop - This method should be called by the client when it has
|
||||||
/// client when it has changed a loop in a way that may effect
|
/// changed a loop in a way that may effect ScalarEvolution's ability to
|
||||||
/// ScalarEvolution's ability to compute a trip count, or if the loop
|
/// compute a trip count, or if the loop is deleted.
|
||||||
/// is deleted.
|
void ScalarEvolution::forgetLoop(const Loop *L) {
|
||||||
void ScalarEvolution::forgetLoopBackedgeTakenCount(const Loop *L) {
|
// Drop any stored trip count value.
|
||||||
BackedgeTakenCounts.erase(L);
|
BackedgeTakenCounts.erase(L);
|
||||||
|
|
||||||
|
// Drop information about expressions based on loop-header PHIs.
|
||||||
SmallVector<Instruction *, 16> Worklist;
|
SmallVector<Instruction *, 16> Worklist;
|
||||||
PushLoopPHIs(L, Worklist);
|
PushLoopPHIs(L, Worklist);
|
||||||
|
|
||||||
|
@@ -322,7 +322,7 @@ void IndVarSimplify::RewriteNonIntegerIVs(Loop *L) {
|
|||||||
// may not have been able to compute a trip count. Now that we've done some
|
// may not have been able to compute a trip count. Now that we've done some
|
||||||
// re-writing, the trip count may be computable.
|
// re-writing, the trip count may be computable.
|
||||||
if (Changed)
|
if (Changed)
|
||||||
SE->forgetLoopBackedgeTakenCount(L);
|
SE->forgetLoop(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
||||||
|
@@ -161,7 +161,7 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) {
|
|||||||
// Tell ScalarEvolution that the loop is deleted. Do this before
|
// Tell ScalarEvolution that the loop is deleted. Do this before
|
||||||
// deleting the loop so that ScalarEvolution can look at the loop
|
// deleting the loop so that ScalarEvolution can look at the loop
|
||||||
// to determine what it needs to clean up.
|
// to determine what it needs to clean up.
|
||||||
SE.forgetLoopBackedgeTakenCount(L);
|
SE.forgetLoop(L);
|
||||||
|
|
||||||
// Connect the preheader directly to the exit block.
|
// Connect the preheader directly to the exit block.
|
||||||
TerminatorInst* TI = preheader->getTerminator();
|
TerminatorInst* TI = preheader->getTerminator();
|
||||||
|
@@ -157,7 +157,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
|
|||||||
// Anything ScalarEvolution may know about this loop or the PHI nodes
|
// Anything ScalarEvolution may know about this loop or the PHI nodes
|
||||||
// in its header will soon be invalidated.
|
// in its header will soon be invalidated.
|
||||||
if (ScalarEvolution *SE = getAnalysisIfAvailable<ScalarEvolution>())
|
if (ScalarEvolution *SE = getAnalysisIfAvailable<ScalarEvolution>())
|
||||||
SE->forgetLoopBackedgeTakenCount(L);
|
SE->forgetLoop(L);
|
||||||
|
|
||||||
// Find new Loop header. NewHeader is a Header's one and only successor
|
// Find new Loop header. NewHeader is a Header's one and only successor
|
||||||
// that is inside loop. Header's other successor is outside the
|
// that is inside loop. Header's other successor is outside the
|
||||||
|
Reference in New Issue
Block a user