Two problems with these lines of code:
authorChris Lattner <sabre@nondot.org>
Mon, 9 Feb 2004 00:59:07 +0000 (00:59 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 9 Feb 2004 00:59:07 +0000 (00:59 +0000)
 1. The "work" was not in the assert, so it was punishing the optimized release
 2. getNamedFunction is _very_ expensive in large programs.  It is not designed
    to be used like this, and was taking 7% of the execution time of the code
    generator on perlbmk.

Since the assert "can never fail", I'm just killing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11214 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Pass.cpp

index 40a3b7d17fe05c0427cd670066e89134aa040b6a..33f606f6cec61dc165978fc470bc77a150739b76 100644 (file)
@@ -91,8 +91,6 @@ FunctionPassManager::~FunctionPassManager() { delete PM; }
 void FunctionPassManager::add(FunctionPass *P) { PM->add(P); }
 void FunctionPassManager::add(ImmutablePass *IP) { PM->add(IP); }
 bool FunctionPassManager::run(Function &F) { 
-  Function *mF = MP->getModule()->getNamedFunction(F.getName());
-  assert((&F == mF) && "ModuleProvider does not contain this function!");
   MP->materializeFunction(&F);
   return PM->run(F); 
 }