Micro-optimize this.
authorDan Gohman <gohman@apple.com>
Mon, 7 Jun 2010 19:12:54 +0000 (19:12 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 7 Jun 2010 19:12:54 +0000 (19:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105542 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index 1d6f21d3e380ea2e5b113d4efafcb414c64b9887..08831dfd227ee3e568c4f9695dbd7e9f8de3c95c 100644 (file)
@@ -505,8 +505,10 @@ namespace {
         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();