Fix test for switch statements and increase
authorDale Johannesen <dalej@apple.com>
Tue, 20 Jul 2010 21:29:12 +0000 (21:29 +0000)
committerDale Johannesen <dalej@apple.com>
Tue, 20 Jul 2010 21:29:12 +0000 (21:29 +0000)
threshold a bit per experimentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108935 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineLICM.cpp

index 83f66ce0948736ebe296db1779a24ab8984c0c3a..9409d88baf6c17920b245e5d90db295f492630c7 100644 (file)
@@ -488,13 +488,14 @@ void MachineLICM::HoistRegion(MachineDomTreeNode *N) {
     MII = NextMII;
   }
 
-  const std::vector<MachineDomTreeNode*> &Children = N->getChildren();
   // Don't hoist things out of a large switch statement.  This often causes
   // code to be hoisted that wasn't going to be executed, and increases
   // register pressure in a situation where it's likely to matter.
-  if (Children.size() < 10)
+  if (BB->succ_size() < 25) {
+    const std::vector<MachineDomTreeNode*> &Children = N->getChildren();
     for (unsigned I = 0, E = Children.size(); I != E; ++I)
       HoistRegion(Children[I]);
+  }
 }
 
 /// IsLICMCandidate - Returns true if the instruction may be a suitable