indvars cruft: don't replace phi nodes for no reason.

Don't replace a phi with an identical phi. This was done long ago to
"preserve" IVUsers analysis. The code has already called
SE->forgetValue(PN) so I see no purpose in creating a new value for
the phi.

llvm-svn: 237587
This commit is contained in:
Andrew Trick 2015-05-18 16:49:34 +00:00
parent 018e55a187
commit 715b27f058
1 changed files with 0 additions and 10 deletions

View File

@ -621,16 +621,6 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L, SCEVExpander &Rewriter) {
PN->eraseFromParent();
}
}
// If we were unable to completely replace the PHI node, clone the PHI and
// delete the original one. This purges the original phi.
if (!LCSSASafePhiForRAUW) {
PHINode *NewPN = cast<PHINode>(PN->clone());
NewPN->takeName(PN);
NewPN->insertBefore(PN);
PN->replaceAllUsesWith(NewPN);
PN->eraseFromParent();
}
}
}