mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-27 14:24:40 +00:00
When ScalarEvolution is told to forget the trip count for a loop, have
it also forget any SCEVs associated with loop-header PHIs in the loop, as they may be dependent on trip count information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70633 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -333,6 +333,11 @@ namespace llvm {
|
|||||||
/// expression cannot be evaluated, return UnknownValue itself.
|
/// expression cannot be evaluated, return UnknownValue itself.
|
||||||
SCEVHandle getSCEVAtScope(SCEV *S, const Loop *L);
|
SCEVHandle getSCEVAtScope(SCEV *S, const Loop *L);
|
||||||
|
|
||||||
|
/// forgetLoopPHIs - Delete the memoized SCEVs associated with the
|
||||||
|
/// PHI nodes in the given loop. This is used when the trip count of
|
||||||
|
/// the loop may have changed.
|
||||||
|
void forgetLoopPHIs(const Loop *L);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static char ID; // Pass identification, replacement for typeid
|
static char ID; // Pass identification, replacement for typeid
|
||||||
ScalarEvolution();
|
ScalarEvolution();
|
||||||
|
@ -2111,9 +2111,7 @@ ScalarEvolution::getBackedgeTakenInfo(const Loop *L) {
|
|||||||
// conservative estimates made without the benefit
|
// conservative estimates made without the benefit
|
||||||
// of trip count information.
|
// of trip count information.
|
||||||
if (ItCount.hasAnyInfo())
|
if (ItCount.hasAnyInfo())
|
||||||
for (BasicBlock::iterator I = L->getHeader()->begin();
|
forgetLoopPHIs(L);
|
||||||
PHINode *PN = dyn_cast<PHINode>(I); ++I)
|
|
||||||
deleteValueFromRecords(PN);
|
|
||||||
}
|
}
|
||||||
return Pair.first->second;
|
return Pair.first->second;
|
||||||
}
|
}
|
||||||
@ -2124,6 +2122,16 @@ ScalarEvolution::getBackedgeTakenInfo(const Loop *L) {
|
|||||||
/// is deleted.
|
/// is deleted.
|
||||||
void ScalarEvolution::forgetLoopBackedgeTakenCount(const Loop *L) {
|
void ScalarEvolution::forgetLoopBackedgeTakenCount(const Loop *L) {
|
||||||
BackedgeTakenCounts.erase(L);
|
BackedgeTakenCounts.erase(L);
|
||||||
|
forgetLoopPHIs(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// forgetLoopPHIs - Delete the memoized SCEVs associated with the
|
||||||
|
/// PHI nodes in the given loop. This is used when the trip count of
|
||||||
|
/// the loop may have changed.
|
||||||
|
void ScalarEvolution::forgetLoopPHIs(const Loop *L) {
|
||||||
|
for (BasicBlock::iterator I = L->getHeader()->begin();
|
||||||
|
PHINode *PN = dyn_cast<PHINode>(I); ++I)
|
||||||
|
deleteValueFromRecords(PN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ComputeBackedgeTakenCount - Compute the number of times the backedge
|
/// ComputeBackedgeTakenCount - Compute the number of times the backedge
|
||||||
|
Reference in New Issue
Block a user