mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#define LLVM_TRANSFORMS_UTILS_CLONING_H
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@@ -38,7 +38,7 @@ class TargetData;
|
||||
/// CloneModule - Return an exact copy of the specified module
|
||||
///
|
||||
Module *CloneModule(const Module *M);
|
||||
Module *CloneModule(const Module *M, std::map<const Value*, Value*> &ValueMap);
|
||||
Module *CloneModule(const Module *M, DenseMap<const Value*, Value*> &ValueMap);
|
||||
|
||||
/// ClonedCodeInfo - This struct can be used to capture information about code
|
||||
/// being cloned, while it is being cloned.
|
||||
@@ -94,7 +94,7 @@ struct ClonedCodeInfo {
|
||||
/// parameter.
|
||||
///
|
||||
BasicBlock *CloneBasicBlock(const BasicBlock *BB,
|
||||
std::map<const Value*, Value*> &ValueMap,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
const char *NameSuffix = "", Function *F = 0,
|
||||
ClonedCodeInfo *CodeInfo = 0);
|
||||
|
||||
@@ -109,13 +109,13 @@ BasicBlock *CloneBasicBlock(const BasicBlock *BB,
|
||||
/// information about the cloned code if non-null.
|
||||
///
|
||||
Function *CloneFunction(const Function *F,
|
||||
std::map<const Value*, Value*> &ValueMap,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
ClonedCodeInfo *CodeInfo = 0);
|
||||
|
||||
/// CloneFunction - Version of the function that doesn't need the ValueMap.
|
||||
///
|
||||
inline Function *CloneFunction(const Function *F, ClonedCodeInfo *CodeInfo = 0){
|
||||
std::map<const Value*, Value*> ValueMap;
|
||||
DenseMap<const Value*, Value*> ValueMap;
|
||||
return CloneFunction(F, ValueMap, CodeInfo);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ inline Function *CloneFunction(const Function *F, ClonedCodeInfo *CodeInfo = 0){
|
||||
/// specified suffix to all values cloned.
|
||||
///
|
||||
void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
std::map<const Value*, Value*> &ValueMap,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
std::vector<ReturnInst*> &Returns,
|
||||
const char *NameSuffix = "",
|
||||
ClonedCodeInfo *CodeInfo = 0);
|
||||
@@ -139,7 +139,7 @@ void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
/// dead. Since this doesn't produce an exactly copy of the input, it can't be
|
||||
/// used for things like CloneFunction or CloneModule.
|
||||
void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
std::map<const Value*, Value*> &ValueMap,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
std::vector<ReturnInst*> &Returns,
|
||||
const char *NameSuffix = "",
|
||||
ClonedCodeInfo *CodeInfo = 0,
|
||||
@@ -150,7 +150,7 @@ void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
/// saved in ValueMap.
|
||||
///
|
||||
void CloneTraceInto(Function *NewFunc, Trace &T,
|
||||
std::map<const Value*, Value*> &ValueMap,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
const char *NameSuffix);
|
||||
|
||||
/// CloneTrace - Returns a copy of the specified trace.
|
||||
|
Reference in New Issue
Block a user