[llvm-commits] [llvm] r53712 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp

Evan Cheng evan.cheng at apple.com
Wed Jul 16 18:31:49 PDT 2008


Author: evancheng
Date: Wed Jul 16 20:31:49 2008
New Revision: 53712

URL: http://llvm.org/viewvc/llvm-project?rev=53712&view=rev
Log:
Inliner tweak. Function calls should cost more than one instruction!

Modified:
    llvm/trunk/lib/Transforms/Utils/InlineCost.cpp

Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=53712&r1=53711&r2=53712&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Wed Jul 16 20:31:49 2008
@@ -119,6 +119,11 @@
             NeverInline = true;
             return;
           }
+        
+        // Calls often compile into many machine instructions.  Bump up their
+        // cost to reflect this.
+        if (!isa<IntrinsicInst>(II))
+          NumInsts += 5;
       }
       
       if (isa<ExtractElementInst>(II) || isa<VectorType>(II->getType()))





More information about the llvm-commits mailing list