From 0b9ee775f5e2c8c2cc344357795328371b7c1d05 Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Mon, 18 May 2015 16:49:34 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237587 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/IndVarSimplify.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 2ba3109354b..600589c904c 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -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(PN->clone()); - NewPN->takeName(PN); - NewPN->insertBefore(PN); - PN->replaceAllUsesWith(NewPN); - PN->eraseFromParent(); - } } } -- 2.11.0