summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2015-05-18 16:49:34 +0000
committerAndrew Trick <atrick@apple.com>2015-05-18 16:49:34 +0000
commit715b27f0588747f38ef4932ce1e54dc42c5962e4 (patch)
tree904b897dadd84e7b9532c3e51a09030b4600ba72 /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
parent018e55a18751000a153d4bd3ed4637970fb6f03e (diff)
downloadbcm5719-llvm-715b27f0588747f38ef4932ce1e54dc42c5962e4.tar.gz
bcm5719-llvm-715b27f0588747f38ef4932ce1e54dc42c5962e4.zip
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
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 2ba3109354b..600589c904c 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/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<PHINode>(PN->clone());
- NewPN->takeName(PN);
- NewPN->insertBefore(PN);
- PN->replaceAllUsesWith(NewPN);
- PN->eraseFromParent();
- }
}
}
OpenPOWER on IntegriCloud