LLVM  6.0.0svn
Classes | Macros | Functions | Variables
EfficiencySanitizer.cpp File Reference
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
Include dependency graph for EfficiencySanitizer.cpp:

Go to the source code of this file.

Classes

struct  ShadowMemoryParams
 

Macros

#define DEBUG_TYPE   "esan"
 

Functions

 STATISTIC (NumInstrumentedLoads, "Number of instrumented loads")
 
 STATISTIC (NumInstrumentedStores, "Number of instrumented stores")
 
 STATISTIC (NumFastpaths, "Number of instrumented fastpaths")
 
 STATISTIC (NumAccessesWithIrregularSize, "Number of accesses with a size outside our targeted callout sizes")
 
 STATISTIC (NumIgnoredStructs, "Number of ignored structs")
 
 STATISTIC (NumIgnoredGEPs, "Number of ignored GEP instructions")
 
 STATISTIC (NumInstrumentedGEPs, "Number of instrumented GEP instructions")
 
 STATISTIC (NumAssumedIntraCacheLine, "Number of accesses assumed to be intra-cache-line")
 
 INITIALIZE_PASS_BEGIN (EfficiencySanitizer, "esan", "EfficiencySanitizer: finds performance issues.", false, false) INITIALIZE_PASS_END(EfficiencySanitizer
 

Variables

static cl::opt< boolClToolCacheFrag ("esan-cache-frag", cl::init(false), cl::desc("Detect data cache fragmentation"), cl::Hidden)
 
static cl::opt< boolClToolWorkingSet ("esan-working-set", cl::init(false), cl::desc("Measure the working set size"), cl::Hidden)
 
static cl::opt< boolClInstrumentLoadsAndStores ("esan-instrument-loads-and-stores", cl::init(true), cl::desc("Instrument loads and stores"), cl::Hidden)
 
static cl::opt< boolClInstrumentMemIntrinsics ("esan-instrument-memintrinsics", cl::init(true), cl::desc("Instrument memintrinsics (memset/memcpy/memmove)"), cl::Hidden)
 
static cl::opt< boolClInstrumentFastpath ("esan-instrument-fastpath", cl::init(true), cl::desc("Instrument fastpath"), cl::Hidden)
 
static cl::opt< boolClAuxFieldInfo ("esan-aux-field-info", cl::init(true), cl::desc("Generate binary with auxiliary struct field information"), cl::Hidden)
 
static cl::opt< boolClAssumeIntraCacheLine ("esan-assume-intra-cache-line", cl::init(true), cl::desc("Assume each memory access touches just one cache line, for " "better performance but with a potential loss of accuracy."), cl::Hidden)
 
static const uint64_t EsanCtorAndDtorPriority = 0
 
static const char *const EsanModuleCtorName = "esan.module_ctor"
 
static const char *const EsanModuleDtorName = "esan.module_dtor"
 
static const char *const EsanInitName = "__esan_init"
 
static const char *const EsanExitName = "__esan_exit"
 
static const char *const EsanWhichToolName = "__esan_which_tool"
 
static const ShadowMemoryParams ShadowParams47
 
static const ShadowMemoryParams ShadowParams40
 
static const int ShadowScale []
 
static const unsigned MaxStructCounterNameSize = 512
 
 esan
 
EfficiencySanitizer __pad0__
 
EfficiencySanitizer false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "esan"

Definition at line 41 of file EfficiencySanitizer.cpp.

Function Documentation

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( EfficiencySanitizer  ,
"esan"  ,
"EfficiencySanitizer: finds performance issues."  ,
false  ,
false   
)

◆ STATISTIC() [1/8]

STATISTIC ( NumInstrumentedLoads  ,
"Number of instrumented loads"   
)

◆ STATISTIC() [2/8]

STATISTIC ( NumInstrumentedStores  ,
"Number of instrumented stores  
)

◆ STATISTIC() [3/8]

STATISTIC ( NumFastpaths  ,
"Number of instrumented fastpaths"   
)

◆ STATISTIC() [4/8]

STATISTIC ( NumAccessesWithIrregularSize  ,
"Number of accesses with a size outside our targeted callout sizes"   
)

◆ STATISTIC() [5/8]

STATISTIC ( NumIgnoredStructs  ,
"Number of ignored structs"   
)

◆ STATISTIC() [6/8]

STATISTIC ( NumIgnoredGEPs  ,
"Number of ignored GEP instructions  
)

◆ STATISTIC() [7/8]

STATISTIC ( NumInstrumentedGEPs  ,
"Number of instrumented GEP instructions  
)

◆ STATISTIC() [8/8]

STATISTIC ( NumAssumedIntraCacheLine  ,
"Number of accesses assumed to be intra-cache-line"   
)

Variable Documentation

◆ __pad0__

EfficiencySanitizer __pad0__

Definition at line 243 of file EfficiencySanitizer.cpp.

◆ ClAssumeIntraCacheLine

cl::opt<bool> ClAssumeIntraCacheLine("esan-assume-intra-cache-line", cl::init(true), cl::desc("Assume each memory access touches just one cache line, for " "better performance but with a potential loss of accuracy."), cl::Hidden)
static

◆ ClAuxFieldInfo

cl::opt<bool> ClAuxFieldInfo("esan-aux-field-info", cl::init(true), cl::desc("Generate binary with auxiliary struct field information"), cl::Hidden)
static

◆ ClInstrumentFastpath

cl::opt<bool> ClInstrumentFastpath("esan-instrument-fastpath", cl::init(true), cl::desc("Instrument fastpath"), cl::Hidden)
static

◆ ClInstrumentLoadsAndStores

cl::opt<bool> ClInstrumentLoadsAndStores("esan-instrument-loads-and-stores", cl::init(true), cl::desc("Instrument loads and stores"), cl::Hidden)
static

◆ ClInstrumentMemIntrinsics

cl::opt<bool> ClInstrumentMemIntrinsics("esan-instrument-memintrinsics", cl::init(true), cl::desc("Instrument memintrinsics (memset/memcpy/memmove)"), cl::Hidden)
static

◆ ClToolCacheFrag

cl::opt<bool> ClToolCacheFrag("esan-cache-frag", cl::init(false), cl::desc("Detect data cache fragmentation"), cl::Hidden)
static

◆ ClToolWorkingSet

cl::opt<bool> ClToolWorkingSet("esan-working-set", cl::init(false), cl::desc("Measure the working set size"), cl::Hidden)
static

◆ esan

esan

Definition at line 243 of file EfficiencySanitizer.cpp.

◆ EsanCtorAndDtorPriority

const uint64_t EsanCtorAndDtorPriority = 0
static

Definition at line 88 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ EsanExitName

const char* const EsanExitName = "__esan_exit"
static

Definition at line 92 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ EsanInitName

const char* const EsanInitName = "__esan_init"
static

Definition at line 91 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ EsanModuleCtorName

const char* const EsanModuleCtorName = "esan.module_ctor"
static

Definition at line 89 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ EsanModuleDtorName

const char* const EsanModuleDtorName = "esan.module_dtor"
static

Definition at line 90 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ EsanWhichToolName

const char* const EsanWhichToolName = "__esan_which_tool"
static

Definition at line 96 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ false

EfficiencySanitizer false

Definition at line 243 of file EfficiencySanitizer.cpp.

◆ MaxStructCounterNameSize

const unsigned MaxStructCounterNameSize = 512
static

Definition at line 128 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ ShadowParams40

const ShadowMemoryParams ShadowParams40
static
Initial value:
= {
0x0fffffffffull,
{
0x1300000000ull, 0x2200000000ull, 0x4400000000ull,
}}

Definition at line 113 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ ShadowParams47

const ShadowMemoryParams ShadowParams47
static
Initial value:
= {
0x00000fffffffffffull,
{
0x0000130000000000ull, 0x0000220000000000ull, 0x0000440000000000ull,
}}

Definition at line 107 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().

◆ ShadowScale

const int ShadowScale[]
static
Initial value:
= {
0,
2,
6,
}

Definition at line 120 of file EfficiencySanitizer.cpp.

Referenced by llvm::createEfficiencySanitizerPass().