35 using namespace SVFUtil;
87 if(repNodes.insert(repNode).second)
106 u32_t numOfCopys = 0;
109 for(ConstraintEdge::ConstraintEdgeSetTy::iterator it = consCG->
getDirectCGEdges().begin(),
112 if(SVFUtil::isa<CopyCGEdge>(*it))
114 else if(SVFUtil::isa<GepCGEdge>(*it))
117 assert(
false &&
"what else!!");
120 u32_t totalNodeNumber = 0;
121 u32_t cgNodeNumber = 0;
122 u32_t objNodeNumber = 0;
123 u32_t addrtotalIn = 0;
125 u32_t addrmaxOut = 0;
126 u32_t copytotalIn = 0;
128 u32_t copymaxOut = 0;
129 u32_t loadtotalIn = 0;
131 u32_t loadmaxOut = 0;
132 u32_t storetotalIn = 0;
133 u32_t storemaxIn = 0;
134 u32_t storemaxOut = 0;
137 for (ConstraintGraph::ConstraintNodeIDToNodeMapTy::iterator nodeIt = consCG->
begin(), nodeEit = consCG->
end();
138 nodeIt != nodeEit; nodeIt++)
141 if(nodeIt->second->getInEdges().empty() && nodeIt->second->getOutEdges().empty())
147 u32_t nCopyIn = nodeIt->second->getDirectInEdges().size();
148 if(nCopyIn > copymaxIn)
150 copytotalIn +=nCopyIn;
151 u32_t nCopyOut = nodeIt->second->getDirectOutEdges().size();
152 if(nCopyOut > copymaxOut)
153 copymaxOut = nCopyOut;
154 u32_t nLoadIn = nodeIt->second->getLoadInEdges().size();
155 if(nLoadIn > loadmaxIn)
157 loadtotalIn +=nLoadIn;
158 u32_t nLoadOut = nodeIt->second->getLoadOutEdges().size();
159 if(nLoadOut > loadmaxOut)
160 loadmaxOut = nLoadOut;
161 u32_t nStoreIn = nodeIt->second->getStoreInEdges().size();
162 if(nStoreIn > storemaxIn)
163 storemaxIn = nStoreIn;
164 storetotalIn +=nStoreIn;
165 u32_t nStoreOut = nodeIt->second->getStoreOutEdges().size();
166 if(nStoreOut > storemaxOut)
167 storemaxOut = nStoreOut;
168 u32_t nAddrIn = nodeIt->second->getAddrInEdges().size();
169 if(nAddrIn > addrmaxIn)
171 addrtotalIn +=nAddrIn;
172 u32_t nAddrOut = nodeIt->second->getAddrOutEdges().size();
173 if(nAddrOut > addrmaxOut)
174 addrmaxOut = nAddrOut;
176 double storeavgIn = (double)storetotalIn/cgNodeNumber;
177 double loadavgIn = (double)loadtotalIn/cgNodeNumber;
178 double copyavgIn = (double)copytotalIn/cgNodeNumber;
179 double addravgIn = (double)addrtotalIn/cgNodeNumber;
180 double avgIn = (double)(addrtotalIn + copytotalIn + loadtotalIn + storetotalIn)/cgNodeNumber;
187 + numOfCopys + numOfGeps;
215 iter != eiter; ++iter)
217 NodeID pagNodeId = iter->first;
218 PAGNode* pagNode = iter->second;
219 if (SVFUtil::isa<ValVar>(pagNode) ==
false)
223 if (inComingStore.empty()==
false || outGoingLoad.empty()==
false)
236 std::stringstream rawstr(str);
237 if (!SVFUtil::isa<DummyValVar>(pagNode) && !SVFUtil::isa<DummyObjVar>(pagNode) )
243 rawstr <<
"##Null Pointer : (NodeID " << pagNode->
getId()
252 rawstr <<
"##Null Pointer : (NodeID " << pagNode->
getId() <<
")";
267 assert(SVFUtil::isa<AndersenBase>(
pta) &&
"not an andersen pta pass!! what else??");
279 u32_t totalPointers = 0;
280 u32_t totalTopLevPointers = 0;
281 u32_t totalPtsSize = 0;
282 u32_t totalTopLevPtsSize = 0;
284 iter != eiter; ++iter)
286 NodeID node = iter->first;
294 totalTopLevPointers++;
295 totalTopLevPtsSize+=size;
334 timeStatMap[
"AvgPtsSetSize"] = (double)totalPtsSize/totalPointers;;
335 timeStatMap[
"AvgTopLvlPtsSize"] = (double)totalTopLevPtsSize/totalTopLevPointers;;
static double timeOfSCCMerges
static u32_t numOfProcessedCopy
Number of processed Addr edge.
static u32_t numOfSCCDetection
static u32_t numOfSfrs
Number of processed Store edge.
static double timeOfUpdateCallGraph
static u32_t numOfProcessedStore
Number of processed Load edge.
static u32_t numOfProcessedAddr
Statistics.
static u32_t numOfProcessedLoad
Number of processed Gep edge.
static double timeOfSCCDetection
static u32_t numOfFieldExpand
static double timeOfProcessLoadStore
static u32_t numOfProcessedGep
Number of processed Copy edge.
static double timeOfProcessCopyGep
ConstraintGraph * getConstraintGraph()
Get constraint graph.
static double timeOfCollapse
AndersenStat(AndersenBase *p)
static const char * CollapseTime
void constraintGraphStat()
virtual void performStat()
static u32_t _NumOfCycles
static u32_t _NumOfNodesInCycles
static u32_t _MaxNumOfNodesInSCC
void collectCycleInfo(ConstraintGraph *consCG)
static u32_t _NumOfPWCCycles
const PointsTo & getPts(NodeID id) override
NodeID sccRepNode(NodeID id) const
SCC rep/sub nodes methods.
const SVFIR::CallSiteToFunPtrMap & getIndirectCallsites() const
Wrappers for invoking SVFIR methods.
ConstraintEdge::ConstraintEdgeSetTy & getStoreCGEdges()
Get Store edges.
NodeID getBaseObjVar(NodeID id)
bool isPWCNode(NodeID nodeId)
Check/Set PWC (positive weight cycle) flag.
ConstraintEdge::ConstraintEdgeSetTy & getDirectCGEdges()
Get Copy/call/ret/gep edges.
ConstraintEdge::ConstraintEdgeSetTy & getAddrCGEdges()
Get SVFIR edge.
NodeBS & sccSubNodes(NodeID id)
ConstraintEdge::ConstraintEdgeSetTy & getLoadCGEdges()
Get Load edges.
iterator begin()
Iterators.
NodeType * getGNode(NodeID id) const
Get a node.
IDToNodeMapTy::iterator iterator
Node Iterators.
u32_t getValueNodeNum() const
u32_t getObjectNodeNum() const
void performStat() override
bool isFieldInsensitive(NodeID id) const
bool containBlackHoleNode(const PointsTo &pts)
Determine whether a points-to contains a black hole or constant node.
u32_t getNumOfResolvedIndCallEdge() const
Return number of resolved indirect call edges.
bool containConstantNode(const PointsTo &pts)
bool empty() const
Returns true if set is empty.
u32_t count() const
Returns number of elements.
NodeID getId() const
Get ID.
u32_t getFieldObjNodeNum() const
bool isValidTopLevelPtr(const SVFVar *node)
u32_t getFieldValNodeNum() const
Node and edge statistics.
virtual void printStat(std::string str="")
GenericNode< SVFVar, SVFStmt >::GEdgeSetTy SVFStmtSetTy
const std::string & getName() const
bool ptrInUncalledFunction() const
SVFStmt::SVFStmtSetTy & getIncomingEdges(SVFStmt::PEDGEK kind)
Get incoming SVFIR statements (edges)
SVFStmt::SVFStmtSetTy & getOutgoingEdges(SVFStmt::PEDGEK kind)
Get outgoing SVFIR statements (edges)
const SVFValue * getValue() const
Get/has methods of the components.
u32_t numOfIteration
num of iterations during constraint solving
void writeWrnMsg(const std::string &msg)
Writes a message run through wrnMsg.