Avoid doing pointless work. Amazingly, this makes us go faster.

Running the inliner on 252.eon used to take 48.4763s, now it takes 14.4148s.

In release mode, it went from taking 25.8741s to taking 11.5712s.

This also fixes a FIXME.

llvm-svn: 8890
This commit is contained in:
Chris Lattner
2003-10-06 15:23:43 +00:00
parent 8bfda656d9
commit 6aa34b0d0b
2 changed files with 5 additions and 8 deletions

View File

@@ -124,14 +124,6 @@ bool InlineFunction(CallSite CS) {
// Make a vector to capture the return instructions in the cloned function...
std::vector<ReturnInst*> Returns;
// Populate the value map with all of the globals in the program.
// FIXME: This should be the default for CloneFunctionInto!
Module &M = *Caller->getParent();
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
ValueMap[I] = I;
for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
ValueMap[I] = I;
// Do all of the hard part of cloning the callee into the caller...
CloneFunctionInto(Caller, CalledFunc, ValueMap, Returns, ".i");