From 1bfc7ab6a770babdcb3c83e4a8762a1b380a3bd4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 3 Feb 2007 00:08:31 +0000 Subject: Switch inliner over to use DenseMap instead of std::map for ValueMap. This speeds up the inliner 16%. llvm-svn: 33801 --- llvm/lib/Transforms/Utils/InlineFunction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp') diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 911bfe0a39a..054c1c77123 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -143,7 +143,7 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock, static void UpdateCallGraphAfterInlining(const Function *Caller, const Function *Callee, Function::iterator FirstNewBlock, - std::map &ValueMap, + DenseMap &ValueMap, CallGraph &CG) { // Update the call graph by deleting the edge from Callee to Caller CallGraphNode *CalleeNode = CG[Callee]; @@ -156,7 +156,7 @@ static void UpdateCallGraphAfterInlining(const Function *Caller, E = CalleeNode->end(); I != E; ++I) { const Instruction *OrigCall = I->first.getInstruction(); - std::map::iterator VMI = ValueMap.find(OrigCall); + DenseMap::iterator VMI = ValueMap.find(OrigCall); // Only copy the edge if the call was inlined! if (VMI != ValueMap.end() && VMI->second) { // If the call was inlined, but then constant folded, there is no edge to @@ -208,7 +208,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) { Function::iterator FirstNewBlock; { // Scope to destroy ValueMap after cloning. - std::map ValueMap; + DenseMap ValueMap; // Calculate the vector of arguments to pass into the function cloner, which // matches up the formal to the actual argument values. -- cgit v1.2.3