[llvm-commits] [llvm] r105542 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Dan Gohman gohman at apple.com
Mon Jun 7 12:12:54 PDT 2010


Author: djg
Date: Mon Jun  7 14:12:54 2010
New Revision: 105542

URL: http://llvm.org/viewvc/llvm-project?rev=105542&view=rev
Log:
Micro-optimize this.

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

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=105542&r1=105541&r2=105542&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jun  7 14:12:54 2010
@@ -505,8 +505,10 @@
         return false;
 
       // Primarily, sort the SCEVs by their getSCEVType().
-      if (LHS->getSCEVType() != RHS->getSCEVType())
-        return LHS->getSCEVType() < RHS->getSCEVType();
+      unsigned LST = LHS->getSCEVType();
+      unsigned RST = RHS->getSCEVType();
+      if (LST != RST)
+        return LST < RST;
 
       // Then, pick an arbitrary sort. Use the profiling data for speed.
       const FoldingSetNodeIDRef &L = LHS->getProfile();





More information about the llvm-commits mailing list