forked from OSchip/llvm-project
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:
parent
018e55a187
commit
715b27f058
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue