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;
ConstraintGraph * getConstraintGraph()
Get constraint graph.
ConstraintEdge::ConstraintEdgeSetTy & getStoreCGEdges()
Get Store edges.
ConstraintEdge::ConstraintEdgeSetTy & getDirectCGEdges()
Get Copy/call/ret/gep edges.
ConstraintEdge::ConstraintEdgeSetTy & getAddrCGEdges()
Get SVFIR edge.
ConstraintEdge::ConstraintEdgeSetTy & getLoadCGEdges()
Get Load edges.