[llvm-commits] [llvm] r147709 - /llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp

Andrew Trick atrick at apple.com
Fri Jan 6 17:29:21 PST 2012


Author: atrick
Date: Fri Jan  6 19:29:21 2012
New Revision: 147709

URL: http://llvm.org/viewvc/llvm-project?rev=147709&view=rev
Log:
Cleanup comments and argument types related to my previous replaceCongruentPhis checkin.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=147709&r1=147708&r2=147709&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Fri Jan  6 19:29:21 2012
@@ -1558,8 +1558,8 @@
   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 @@
       // 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





More information about the llvm-commits mailing list