Revert r53540 - it does not compile.
authorDuncan Sands <baldrick@free.fr>
Mon, 14 Jul 2008 07:59:28 +0000 (07:59 +0000)
committerDuncan Sands <baldrick@free.fr>
Mon, 14 Jul 2008 07:59:28 +0000 (07:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53549 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineCost.cpp

index 10cb77bbcba61835a17736f3c1368650eaf770ca..c17705bf85090504a74bfe0681d1d839e1791a63 100644 (file)
@@ -100,27 +100,9 @@ void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
   for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
     for (BasicBlock::const_iterator II = BB->begin(), E = BB->end();
          II != E; ++II) {
+      if (isa<DbgInfoIntrinsic>(II)) continue;  // Debug intrinsics don't count.
       if (isa<PHINode>(II)) continue;           // PHI nodes don't count.
 
-      // Special handling for calls.
-      if (isa<CallInst>(II) || isa<InvokeInst>(II)) {
-        if (isa<DbgInfoIntrinsic>(II))
-          continue;  // Debug intrinsics don't count as size.
-        
-        CallSite CS = CallSite::get(const_cast<Instruction*>(&*II));
-        
-        // If this function contains a call to setjmp or _setjmp, never inline
-        // it.  This is a hack because we depend on the user marking their local
-        // variables as volatile if they are live across a setjmp call, and they
-        // probably won't do this in callers.
-        if (Function *F = CS.getCalledFunction())
-          if (F->isDeclaration() && 
-              (F->isName("setjmp") || F->isName("_setjmp"))) {
-            NeverInline = true;
-            return;
-          }
-      }
-      
       if (isa<ExtractElementInst>(II) || isa<VectorType>(II->getType()))
         ++NumVectorInsts; 
       
@@ -212,10 +194,6 @@ int InlineCostAnalyzer::getInlineCost(CallSite CS,
   // If we haven't calculated this information yet, do so now.
   if (CalleeFI.NumBlocks == 0)
     CalleeFI.analyzeFunction(Callee);
-  
-  // If we should never inline this, return a huge cost.
-  if (CalleeFI.NeverInline)
-    return 2000000000;
     
   // Add to the inline quality for properties that make the call valuable to
   // inline.  This includes factors that indicate that the result of inlining