Implement bitfield clears
[oota-llvm.git] / lib / Transforms / IPO / InlineSimple.cpp
index 770f05c162a0875a7044868fdb87a9716aee7c40..4355c6c4a19faa95fa3823a7ae9d76c8a3f1fff6 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "Inliner.h"
 #include "llvm/Instructions.h"
+#include "llvm/IntrinsicInst.h"
 #include "llvm/Function.h"
 #include "llvm/Type.h"
 #include "llvm/Support/CallSite.h"
@@ -147,7 +148,7 @@ void 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) {
-      ++NumInsts;
+      if (!isa<DbgInfoIntrinsic>(II)) ++NumInsts;
 
       // If there is an alloca in the body of the function, we cannot currently
       // inline the function without the risk of exploding the stack.
@@ -166,7 +167,7 @@ void FunctionInfo::analyzeFunction(Function *F) {
 
   // Check out all of the arguments to the function, figuring out how much
   // code can be eliminated if one of the arguments is a constant.
-  for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I)
+  for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
     ArgumentWeights.push_back(ArgInfo(CountCodeReductionForConstant(I),
                                       CountCodeReductionForAlloca(I)));
 }
@@ -193,7 +194,7 @@ int SimpleInliner::getInlineCost(CallSite CS) {
   // make it almost guaranteed to be inlined.
   //
   if (Callee->hasInternalLinkage() && Callee->hasOneUse())
-    InlineCost -= 5000;
+    InlineCost -= 30000;
 
   // Get information about the callee...
   FunctionInfo &CalleeFI = CachedFunctionInfo[Callee];