summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-01-07 01:29:21 +0000
committerAndrew Trick <atrick@apple.com>2012-01-07 01:29:21 +0000
commitf730f39f3f34627f5a958b965fbbf2d260e93c56 (patch)
tree9a4306eda5c9a8d18b9a4e7f87cec0b5f9cd402c /llvm/lib/Analysis
parentd803f45e416482f984dbe4908491c4bda33759f7 (diff)
downloadbcm5719-llvm-f730f39f3f34627f5a958b965fbbf2d260e93c56.tar.gz
bcm5719-llvm-f730f39f3f34627f5a958b965fbbf2d260e93c56.zip
Cleanup comments and argument types related to my previous replaceCongruentPhis checkin.
llvm-svn: 147709
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 0c4bb825bf9..26ae22b56b6 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -1558,8 +1558,8 @@ bool SCEVExpander::hoistStep(Instruction *IncV, Instruction *InsertPos,
return true;
}
-/// Sort Phis by integer width for replaceCongruentIVs.
-static bool width_descending(PHINode *lhs, PHINode *rhs) {
+/// Sort values by integer width for replaceCongruentIVs.
+static bool width_descending(Value *lhs, Value *rhs) {
// Put pointers at the back and make sure pointer < pointer = false.
if (!lhs->getType()->isIntegerTy() || !rhs->getType()->isIntegerTy())
return rhs->getType()->isIntegerTy() && !lhs->getType()->isIntegerTy();
@@ -1632,8 +1632,9 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
// Replacing the congruent phi is sufficient because acyclic redundancy
// elimination, CSE/GVN, should handle the rest. However, once SCEV proves
// that a phi is congruent, it's often the head of an IV user cycle that
- // is isomorphic with the original phi. So it's worth eagerly cleaning up
- // the common case of a single IV increment.
+ // is isomorphic with the original phi. It's worth eagerly cleaning up the
+ // common case of a single IV increment so that DeleteDeadPHIs can remove
+ // cycles that had postinc uses.
const SCEV *TruncExpr = SE.getTruncateOrNoop(SE.getSCEV(OrigInc),
IsomorphicInc->getType());
if (OrigInc != IsomorphicInc
OpenPOWER on IntegriCloud