From 5e665f559419c7f58a4fd9360cd488f065505c44 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%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33801 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/InlineFunction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Transforms/Utils/InlineFunction.cpp') diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 911bfe0a39..054c1c7712 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/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-18-g5258