[llvm-commits] [llvm] r58352 - in /llvm/trunk: include/llvm/Transforms/Utils/InlineCost.h lib/Transforms/IPO/InlineAlways.cpp lib/Transforms/Utils/BasicInliner.cpp
Daniel Dunbar
daniel at zuster.org
Tue Oct 28 16:24:26 PDT 2008
Author: ddunbar
Date: Tue Oct 28 18:24:26 2008
New Revision: 58352
URL: http://llvm.org/viewvc/llvm-project?rev=58352&view=rev
Log:
Assorted comment/naming fixes, 80-col violations, and reindentation.
- No functionality change.
Modified:
llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h
llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp
llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp
Modified: llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h?rev=58352&r1=58351&r2=58352&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/InlineCost.h Tue Oct 28 18:24:26 2008
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef INLINECOST_H
-#define INLINECOST_H
+#ifndef LLVM_TRANSFORMS_UTILS_INLINECOST_H
+#define LLVM_TRANSFORMS_UTILS_INLINECOST_H
#include "llvm/ADT/SmallPtrSet.h"
#include <map>
@@ -46,7 +46,7 @@
/// is used to estimate the code size cost of inlining it.
unsigned NumInsts, NumBlocks;
- /// NumVectorInsts - Keep track how many instrctions produce vector
+ /// NumVectorInsts - Keep track of how many instructions produce vector
/// values. The inliner is being more aggressive with inlining vector
/// kernels.
unsigned NumVectorInsts;
Modified: llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp?rev=58352&r1=58351&r2=58352&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp Tue Oct 28 18:24:26 2008
@@ -51,14 +51,13 @@
char AlwaysInliner::ID = 0;
static RegisterPass<AlwaysInliner>
-X("always-inline", "Inliner that handles always_inline functions");
+X("always-inline", "Inliner for always_inline functions");
Pass *llvm::createAlwaysInlinerPass() { return new AlwaysInliner(); }
// doInitialization - Initializes the vector of functions that have not
// been annotated with the "always inline" attribute.
bool AlwaysInliner::doInitialization(CallGraph &CG) {
-
Module &M = CG.getModule();
for (Module::iterator I = M.begin(), E = M.end();
@@ -68,4 +67,3 @@
return false;
}
-
Modified: llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp?rev=58352&r1=58351&r2=58352&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp Tue Oct 28 18:24:26 2008
@@ -28,7 +28,7 @@
static cl::opt<unsigned>
BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
- cl::desc("Control the amount of basic inlining to perform (default = 200)"));
+ cl::desc("Control the amount of basic inlining to perform (default = 200)"));
namespace llvm {
@@ -95,22 +95,23 @@
bool Changed = false;
do {
Changed = false;
- for (unsigned index = 0; index != CallSites.size() && !CallSites.empty(); ++index) {
+ for (unsigned index = 0; index != CallSites.size() && !CallSites.empty();
+ ++index) {
CallSite CS = CallSites[index];
if (Function *Callee = CS.getCalledFunction()) {
- // Eliminate calls taht are never inlinable.
+ // Eliminate calls that are never inlinable.
if (Callee->isDeclaration() ||
CS.getInstruction()->getParent()->getParent() == Callee) {
CallSites.erase(CallSites.begin() + index);
- --index;
- continue;
+ --index;
+ continue;
}
int InlineCost = CA.getInlineCost(CS, NeverInline);
if (InlineCost >= (int) BasicInlineThreshold) {
- DOUT << " NOT Inlining: cost = " << InlineCost
- << ", call: " << *CS.getInstruction();
- continue;
+ DOUT << " NOT Inlining: cost = " << InlineCost
+ << ", call: " << *CS.getInstruction();
+ continue;
}
DOUT << " Inlining: cost=" << InlineCost
@@ -119,7 +120,7 @@
// Inline
if (InlineFunction(CS, NULL, TD)) {
if (Callee->use_empty() && Callee->hasInternalLinkage())
- DeadFunctions.insert(Callee);
+ DeadFunctions.insert(Callee);
Changed = true;
CallSites.erase(CallSites.begin() + index);
--index;
More information about the llvm-commits
mailing list