diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-03 00:08:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-03 00:08:31 +0000 |
commit | 5e665f559419c7f58a4fd9360cd488f065505c44 (patch) | |
tree | b0b885dc43015823c992923bd3a03b0cb4defa7b /lib/Transforms/Utils/InlineFunction.cpp | |
parent | 4642ca6589d3002861963744a157169f15d1ee90 (diff) |
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
Diffstat (limited to 'lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | lib/Transforms/Utils/InlineFunction.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<const Value*, Value*> &ValueMap, + DenseMap<const Value*, Value*> &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<const Value*, Value*>::iterator VMI = ValueMap.find(OrigCall); + DenseMap<const Value*, Value*>::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<const Value*, Value*> ValueMap; + DenseMap<const Value*, Value*> ValueMap; // Calculate the vector of arguments to pass into the function cloner, which // matches up the formal to the actual argument values. |