mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 08:46:23 +00:00
indvars: remove ExprToIVMap because it won't be needed by LFTR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135334 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d152d03a47
commit
6f684b0bec
@ -81,15 +81,12 @@ static cl::opt<bool> DisableIVRewrite(
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class IndVarSimplify : public LoopPass {
|
class IndVarSimplify : public LoopPass {
|
||||||
typedef DenseMap< const SCEV *, AssertingVH<PHINode> > ExprToIVMapTy;
|
|
||||||
|
|
||||||
IVUsers *IU;
|
IVUsers *IU;
|
||||||
LoopInfo *LI;
|
LoopInfo *LI;
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
TargetData *TD;
|
TargetData *TD;
|
||||||
|
|
||||||
ExprToIVMapTy ExprToIVMap;
|
|
||||||
SmallVector<WeakVH, 16> DeadInsts;
|
SmallVector<WeakVH, 16> DeadInsts;
|
||||||
bool Changed;
|
bool Changed;
|
||||||
public:
|
public:
|
||||||
@ -120,7 +117,6 @@ namespace {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void releaseMemory() {
|
virtual void releaseMemory() {
|
||||||
ExprToIVMap.clear();
|
|
||||||
DeadInsts.clear();
|
DeadInsts.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1409,13 +1405,14 @@ void IndVarSimplify::SimplifyIVUsersNoRewrite(Loop *L, SCEVExpander &Rewriter) {
|
|||||||
/// populate ExprToIVMap for use later.
|
/// populate ExprToIVMap for use later.
|
||||||
///
|
///
|
||||||
void IndVarSimplify::SimplifyCongruentIVs(Loop *L) {
|
void IndVarSimplify::SimplifyCongruentIVs(Loop *L) {
|
||||||
|
DenseMap<const SCEV *, PHINode *> ExprToIVMap;
|
||||||
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ++I) {
|
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ++I) {
|
||||||
PHINode *Phi = cast<PHINode>(I);
|
PHINode *Phi = cast<PHINode>(I);
|
||||||
if (!SE->isSCEVable(Phi->getType()))
|
if (!SE->isSCEVable(Phi->getType()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const SCEV *S = SE->getSCEV(Phi);
|
const SCEV *S = SE->getSCEV(Phi);
|
||||||
ExprToIVMapTy::const_iterator Pos;
|
DenseMap<const SCEV *, PHINode *>::const_iterator Pos;
|
||||||
bool Inserted;
|
bool Inserted;
|
||||||
tie(Pos, Inserted) = ExprToIVMap.insert(std::make_pair(S, Phi));
|
tie(Pos, Inserted) = ExprToIVMap.insert(std::make_pair(S, Phi));
|
||||||
if (Inserted)
|
if (Inserted)
|
||||||
@ -1709,7 +1706,6 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
DT = &getAnalysis<DominatorTree>();
|
DT = &getAnalysis<DominatorTree>();
|
||||||
TD = getAnalysisIfAvailable<TargetData>();
|
TD = getAnalysisIfAvailable<TargetData>();
|
||||||
|
|
||||||
ExprToIVMap.clear();
|
|
||||||
DeadInsts.clear();
|
DeadInsts.clear();
|
||||||
Changed = false;
|
Changed = false;
|
||||||
|
|
||||||
@ -1746,8 +1742,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
if (!DisableIVRewrite)
|
if (!DisableIVRewrite)
|
||||||
SimplifyIVUsers(Rewriter);
|
SimplifyIVUsers(Rewriter);
|
||||||
|
|
||||||
// Eliminate redundant IV cycles and populate ExprToIVMap.
|
// Eliminate redundant IV cycles.
|
||||||
// TODO: use ExprToIVMap to allow LFTR without canonical IVs
|
|
||||||
if (DisableIVRewrite)
|
if (DisableIVRewrite)
|
||||||
SimplifyCongruentIVs(L);
|
SimplifyCongruentIVs(L);
|
||||||
|
|
||||||
@ -1838,7 +1833,6 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
// can be deleted in the loop below, causing the AssertingVH in the cache to
|
// can be deleted in the loop below, causing the AssertingVH in the cache to
|
||||||
// trigger.
|
// trigger.
|
||||||
Rewriter.clear();
|
Rewriter.clear();
|
||||||
ExprToIVMap.clear();
|
|
||||||
|
|
||||||
// Now that we're done iterating through lists, clean up any instructions
|
// Now that we're done iterating through lists, clean up any instructions
|
||||||
// which are now dead.
|
// which are now dead.
|
||||||
|
Loading…
Reference in New Issue
Block a user