Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::MemSSAStat Class Reference

#include <SVFGStat.h>

Inheritance diagram for SVF::MemSSAStat:
SVF::PTAStat SVF::SVFStat

Public Member Functions

 MemSSAStat (MemSSA *)
virtual ~MemSSAStat ()
virtual void performStat () override
virtual void printStat (std::string str="") override
Public Member Functions inherited from SVF::PTAStat
 PTAStat (PointerAnalysis *p)
virtual ~PTAStat ()
void setMemUsageBefore (u32_t vmrss, u32_t vmsize)
void setMemUsageAfter (u32_t vmrss, u32_t vmsize)
void performStat () override
void callgraphStat () override
Public Member Functions inherited from SVF::SVFStat
 SVFStat ()
virtual ~SVFStat ()
virtual void startClk ()
virtual void endClk ()
virtual void performStatPerQuery (NodeID)
virtual void printStatPerQuery (NodeID, const PointsTo &)

Static Public Attributes

static const char * TotalTimeOfConstructMemSSA = "TotalMSSATime"
 Total time for constructing memory SSA.
static const char * TimeOfGeneratingMemRegions = "GenRegionTime"
 Time for allocating regions.
static const char * TimeOfCreateMUCHI = "GenMUCHITime"
 Time for generating mu/chi for load/store/calls.
static const char * TimeOfInsertingPHI = "InsertPHITime"
 Time for inserting phis.
static const char * TimeOfSSARenaming = "SSARenameTime"
 Time for SSA rename.
static const char * NumOfMaxRegion = "MaxRegSize"
 Number of max points-to set in region.
static const char * NumOfAveragePtsInRegion = "AverageRegSize"
 Number of average points-to set in region.
static const char * NumOfMemRegions = "MemRegions"
 Number of memory regions.
static const char * NumOfEntryChi = "FunEntryChi"
 Number of function entry chi.
static const char * NumOfRetMu = "FunRetMu"
 Number of function return mu.
static const char * NumOfCSChi = "CSChiNode"
 Number of call site chi.
static const char * NumOfCSMu = "CSMuNode"
 Number of call site mu.
static const char * NumOfLoadMu = "LoadMuNode"
 Number of load mu.
static const char * NumOfStoreChi = "StoreChiNode"
 Number of store chi.
static const char * NumOfMSSAPhi = "MSSAPhi"
 Number of mssa phi.
static const char * NumOfFunHasEntryChi = "FunHasEntryChi"
 Number of functions which have entry chi.
static const char * NumOfFunHasRetMu = "FunHasRetMu"
 Number of functions which have return mu.
static const char * NumOfCSHasChi = "CSHasChi"
 Number of call sites which have chi.
static const char * NumOfCSHasMu = "CSHasMu"
 Number of call sites which have mu.
static const char * NumOfLoadHasMu = "LoadHasMu"
 Number of loads which have mu.
static const char * NumOfStoreHasChi = "StoreHasChi"
 Number of stores which have chi.
static const char * NumOfBBHasMSSAPhi = "BBHasMSSAPhi"
 Number of basic blocks which have mssa phi.
Static Public Attributes inherited from SVF::SVFStat
static bool printGeneralStats = true
 SVF's general statistics are only printed once even if you run multiple anayses.
static double timeOfBuildingLLVMModule = 0
static double timeOfBuildingSymbolTable = 0
static double timeOfBuildingSVFIR = 0

Private Attributes

MemSSA * mssa

Additional Inherited Members

Public Types inherited from SVF::SVFStat
enum class  ClockType { Wall , CPU }
typedef OrderedMap< std::string, u32_t > NUMStatMap
typedef OrderedMap< std::string, double > TIMEStatMap
Static Public Member Functions inherited from SVF::SVFStat
static double getClk (bool mark=false)
Public Attributes inherited from SVF::PTAStat
NodeBS localVarInRecursion
Public Attributes inherited from SVF::SVFStat
NUMStatMap generalNumMap
NUMStatMap PTNumStatMap
TIMEStatMap timeStatMap
double startTime
double endTime
Protected Attributes inherited from SVF::PTAStat
PointerAnalysis * pta
u32_t _vmrssUsageBefore
u32_t _vmrssUsageAfter
u32_t _vmsizeUsageBefore
u32_t _vmsizeUsageAfter

Detailed Description

Definition at line 48 of file SVFGStat.h.

Constructor & Destructor Documentation

◆ MemSSAStat()

MemSSAStat::MemSSAStat ( MemSSA * memSSA)

Constructor

Definition at line 65 of file SVFGStat.cpp.

65 : PTAStat(nullptr)
66{
67 mssa = memSSA;
68 startClk();
69}
MemSSA * mssa
Definition SVFGStat.h:88
PTAStat(PointerAnalysis *p)
Definition PTAStat.cpp:40
virtual void startClk()
Definition SVFStat.h:61

◆ ~MemSSAStat()

virtual SVF::MemSSAStat::~MemSSAStat ( )
inlinevirtual

Definition at line 79 of file SVFGStat.h.

80 {
81
82 }

Member Function Documentation

◆ performStat()

void MemSSAStat::performStat ( )
overridevirtual

Start stating

Implements SVF::SVFStat.

Definition at line 74 of file SVFGStat.cpp.

75{
76
77 endClk();
78
79 MRGenerator* mrGenerator = mssa->getMRGenerator();
80 u32_t regionNumber = mrGenerator->getMRNum();
81
82 u32_t maxRegionSize = 0;
83 u32_t totalRegionPtsNum = 0;
84 MRGenerator::MRSet & mrSet = mrGenerator->getMRSet();
85 MRGenerator::MRSet::const_iterator it = mrSet.begin();
86 MRGenerator::MRSet::const_iterator eit = mrSet.end();
87 for (; it != eit; it++)
88 {
89 const MemRegion* region = *it;
90 u32_t regionSize = region->getRegionSize();
91 if (regionSize > maxRegionSize)
92 maxRegionSize = regionSize;
93 totalRegionPtsNum += regionSize;
94 }
95
101
102 PTNumStatMap[NumOfMaxRegion] = maxRegionSize;
103 timeStatMap[NumOfAveragePtsInRegion] = (regionNumber == 0) ? 0 : ((double)totalRegionPtsNum / regionNumber);
104 PTNumStatMap[NumOfMemRegions] = regionNumber;
105 PTNumStatMap[NumOfEntryChi] = mssa->getFunEntryChiNum();
106 PTNumStatMap[NumOfRetMu] = mssa->getFunRetMuNum();
107 PTNumStatMap[NumOfCSChi] = mssa->getCallSiteChiNum();
108 PTNumStatMap[NumOfCSMu] = mssa->getCallSiteMuNum();
109 PTNumStatMap[NumOfLoadMu] = mssa->getLoadMuNum();
110 PTNumStatMap[NumOfStoreChi] = mssa->getStoreChiNum();
111 PTNumStatMap[NumOfMSSAPhi] = mssa->getBBPhiNum();
112
113 PTNumStatMap[NumOfFunHasEntryChi] = mssa->getFunToEntryChiSetMap().size();
114 PTNumStatMap[NumOfFunHasRetMu] = mssa->getFunToRetMuSetMap().size();
115 PTNumStatMap[NumOfCSHasChi] = mssa->getCallSiteToChiSetMap().size();
116 PTNumStatMap[NumOfCSHasMu] = mssa->getCallSiteToMuSetMap().size();
117 PTNumStatMap[NumOfLoadHasMu] = mssa->getLoadToMUSetMap().size();
118 PTNumStatMap[NumOfStoreHasChi] = mssa->getStoreToChiSetMap().size();
119 PTNumStatMap[NumOfBBHasMSSAPhi] = mssa->getBBToPhiSetMap().size();
120
121 printStat();
122
123}
#define TIMEINTERVAL
Definition SVFType.h:604
MRSet & getMRSet()
Definition MemRegion.h:184
OrderedSet< const MemRegion *, MemRegion::equalMemRegion > MRSet
Get typedef from Pointer Analysis.
Definition MemRegion.h:145
u32_t getMRNum() const
Definition MemRegion.h:439
u32_t getRegionSize() const
Return memory object number inside a region.
Definition MemRegion.h:126
static const char * TimeOfInsertingPHI
Time for inserting phis.
Definition SVFGStat.h:55
static const char * NumOfRetMu
Number of function return mu.
Definition SVFGStat.h:62
static const char * NumOfLoadMu
Number of load mu.
Definition SVFGStat.h:65
static const char * NumOfStoreHasChi
Number of stores which have chi.
Definition SVFGStat.h:74
static const char * TimeOfCreateMUCHI
Time for generating mu/chi for load/store/calls.
Definition SVFGStat.h:54
static const char * NumOfMSSAPhi
Number of mssa phi.
Definition SVFGStat.h:67
static const char * NumOfBBHasMSSAPhi
Number of basic blocks which have mssa phi.
Definition SVFGStat.h:75
static const char * NumOfAveragePtsInRegion
Number of average points-to set in region.
Definition SVFGStat.h:59
static const char * TimeOfGeneratingMemRegions
Time for allocating regions.
Definition SVFGStat.h:53
static const char * NumOfCSMu
Number of call site mu.
Definition SVFGStat.h:64
static const char * TotalTimeOfConstructMemSSA
Total time for constructing memory SSA.
Definition SVFGStat.h:52
static const char * NumOfStoreChi
Number of store chi.
Definition SVFGStat.h:66
static const char * TimeOfSSARenaming
Time for SSA rename.
Definition SVFGStat.h:56
static const char * NumOfCSChi
Number of call site chi.
Definition SVFGStat.h:63
static const char * NumOfMemRegions
Number of memory regions.
Definition SVFGStat.h:60
static const char * NumOfFunHasRetMu
Number of functions which have return mu.
Definition SVFGStat.h:70
static const char * NumOfMaxRegion
Number of max points-to set in region.
Definition SVFGStat.h:58
static const char * NumOfLoadHasMu
Number of loads which have mu.
Definition SVFGStat.h:73
virtual void printStat(std::string str="") override
Definition SVFGStat.cpp:128
static const char * NumOfEntryChi
Number of function entry chi.
Definition SVFGStat.h:61
static const char * NumOfCSHasChi
Number of call sites which have chi.
Definition SVFGStat.h:71
static const char * NumOfFunHasEntryChi
Number of functions which have entry chi.
Definition SVFGStat.h:69
static const char * NumOfCSHasMu
Number of call sites which have mu.
Definition SVFGStat.h:72
static double timeOfGeneratingMemRegions
Statistics.
Definition MemSSA.h:107
static double timeOfInsertingPHI
Time for inserting phis.
Definition MemSSA.h:109
static double timeOfCreateMUCHI
Time for generating mu/chi for load/store/calls.
Definition MemSSA.h:108
static double timeOfSSARenaming
Time for SSA rename.
Definition MemSSA.h:110
NUMStatMap PTNumStatMap
Definition SVFStat.h:80
virtual void endClk()
Definition SVFStat.h:66
TIMEStatMap timeStatMap
Definition SVFStat.h:81
double endTime
Definition SVFStat.h:84
double startTime
Definition SVFStat.h:83
unsigned u32_t
Definition GeneralType.h:67

◆ printStat()

void MemSSAStat::printStat ( std::string str = "")
overridevirtual

Print statistics

Reimplemented from SVF::SVFStat.

Definition at line 128 of file SVFGStat.cpp.

129{
130 PTAStat::printStat("Memory SSA Statistics");
131}
virtual void printStat(std::string str="")
Definition SVFStat.cpp:71

Member Data Documentation

◆ mssa

MemSSA* SVF::MemSSAStat::mssa
private

Definition at line 88 of file SVFGStat.h.

◆ NumOfAveragePtsInRegion

const char * MemSSAStat::NumOfAveragePtsInRegion = "AverageRegSize"
static

Number of average points-to set in region.

Definition at line 59 of file SVFGStat.h.

◆ NumOfBBHasMSSAPhi

const char * MemSSAStat::NumOfBBHasMSSAPhi = "BBHasMSSAPhi"
static

Number of basic blocks which have mssa phi.

Definition at line 75 of file SVFGStat.h.

◆ NumOfCSChi

const char * MemSSAStat::NumOfCSChi = "CSChiNode"
static

Number of call site chi.

Definition at line 63 of file SVFGStat.h.

◆ NumOfCSHasChi

const char * MemSSAStat::NumOfCSHasChi = "CSHasChi"
static

Number of call sites which have chi.

Definition at line 71 of file SVFGStat.h.

◆ NumOfCSHasMu

const char * MemSSAStat::NumOfCSHasMu = "CSHasMu"
static

Number of call sites which have mu.

Definition at line 72 of file SVFGStat.h.

◆ NumOfCSMu

const char * MemSSAStat::NumOfCSMu = "CSMuNode"
static

Number of call site mu.

Definition at line 64 of file SVFGStat.h.

◆ NumOfEntryChi

const char * MemSSAStat::NumOfEntryChi = "FunEntryChi"
static

Number of function entry chi.

Definition at line 61 of file SVFGStat.h.

◆ NumOfFunHasEntryChi

const char * MemSSAStat::NumOfFunHasEntryChi = "FunHasEntryChi"
static

Number of functions which have entry chi.

Definition at line 69 of file SVFGStat.h.

◆ NumOfFunHasRetMu

const char * MemSSAStat::NumOfFunHasRetMu = "FunHasRetMu"
static

Number of functions which have return mu.

Definition at line 70 of file SVFGStat.h.

◆ NumOfLoadHasMu

const char * MemSSAStat::NumOfLoadHasMu = "LoadHasMu"
static

Number of loads which have mu.

Definition at line 73 of file SVFGStat.h.

◆ NumOfLoadMu

const char * MemSSAStat::NumOfLoadMu = "LoadMuNode"
static

Number of load mu.

Definition at line 65 of file SVFGStat.h.

◆ NumOfMaxRegion

const char * MemSSAStat::NumOfMaxRegion = "MaxRegSize"
static

Number of max points-to set in region.

Definition at line 58 of file SVFGStat.h.

◆ NumOfMemRegions

const char * MemSSAStat::NumOfMemRegions = "MemRegions"
static

Number of memory regions.

Definition at line 60 of file SVFGStat.h.

◆ NumOfMSSAPhi

const char * MemSSAStat::NumOfMSSAPhi = "MSSAPhi"
static

Number of mssa phi.

Number of non-top level ptr phi.

Definition at line 67 of file SVFGStat.h.

◆ NumOfRetMu

const char * MemSSAStat::NumOfRetMu = "FunRetMu"
static

Number of function return mu.

Definition at line 62 of file SVFGStat.h.

◆ NumOfStoreChi

const char * MemSSAStat::NumOfStoreChi = "StoreChiNode"
static

Number of store chi.

Definition at line 66 of file SVFGStat.h.

◆ NumOfStoreHasChi

const char * MemSSAStat::NumOfStoreHasChi = "StoreHasChi"
static

Number of stores which have chi.

Definition at line 74 of file SVFGStat.h.

◆ TimeOfCreateMUCHI

const char * MemSSAStat::TimeOfCreateMUCHI = "GenMUCHITime"
static

Time for generating mu/chi for load/store/calls.

Definition at line 54 of file SVFGStat.h.

◆ TimeOfGeneratingMemRegions

const char * MemSSAStat::TimeOfGeneratingMemRegions = "GenRegionTime"
static

Time for allocating regions.

Definition at line 53 of file SVFGStat.h.

◆ TimeOfInsertingPHI

const char * MemSSAStat::TimeOfInsertingPHI = "InsertPHITime"
static

Time for inserting phis.

Definition at line 55 of file SVFGStat.h.

◆ TimeOfSSARenaming

const char * MemSSAStat::TimeOfSSARenaming = "SSARenameTime"
static

Time for SSA rename.

Definition at line 56 of file SVFGStat.h.

◆ TotalTimeOfConstructMemSSA

const char * MemSSAStat::TotalTimeOfConstructMemSSA = "TotalMSSATime"
static

Total time for constructing memory SSA.

Definition at line 52 of file SVFGStat.h.


The documentation for this class was generated from the following files: