summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-02-27 05:53:43 +0000
committerNadav Rotem <nrotem@apple.com>2013-02-27 05:53:43 +0000
commit464e807d41b73e960ca1aac901c9a320bc93eb60 (patch)
tree05a5022cf86dd476190d3654979e88fab1ec96ff /llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
parentc5eda3ad2b375559dcb39cb57d7ab964dbd30ba7 (diff)
downloadbcm5719-llvm-464e807d41b73e960ca1aac901c9a320bc93eb60.tar.gz
bcm5719-llvm-464e807d41b73e960ca1aac901c9a320bc93eb60.zip
For each function that we optimize we initialize a new list of lib functions. For each function name we malloc memory. This patch changes the Libcall map to use BumpPtrAllocator. Now we malloc only once. This speeds up instcombine by a few % on a large c++ program.
llvm-svn: 176170
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 8ad566c893c..9b39bf40c88 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -23,6 +23,7 @@
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/Support/Allocator.h"
#include "llvm/Target/TargetLibraryInfo.h"
#include "llvm/Transforms/Utils/BuildLibCalls.h"
@@ -1672,7 +1673,7 @@ class LibCallSimplifierImpl {
const TargetLibraryInfo *TLI;
const LibCallSimplifier *LCS;
bool UnsafeFPShrink;
- StringMap<LibCallOptimization*> Optimizations;
+ StringMap<LibCallOptimization*, BumpPtrAllocator> Optimizations;
// Fortified library call optimizations.
MemCpyChkOpt MemCpyChk;
OpenPOWER on IntegriCloud