Returns vector mapping previously allocated node IDs to a smarter allocation based on the points-to sets in pta accessed through keys. The second part of the keys pairs are the number of (potential) occurrences of that points-to set or a subset, depending on the client's wish. TODO: interfaces are getting unwieldy, an initialised object may be better. TODO: kind of sucks pta can't be const here because getPts isn't.
200{
201 assert(pta !=
nullptr &&
"Clusterer::cluster: given null BVDataPTAImpl");
203
210
211
213
215
216
218
219
221 for (
const std::pair<NodeID, unsigned> &
keyOcc :
keys)
222 {
223 const PointsTo &
pts = pta->getPts(
keyOcc.first);
226
227
228
230 {
234 {
236 {
239 }
240 }
241 }
242 }
243
246
250 {
252 }
253 else
254 {
255
258 }
259
260
261
262
263
264
267
268
269
270
271
272
273
275
277
279 {
281
283 {
284
287 }
288
289
291
292
293
294
295
296
297 }
298
299
300
303 {
304 const PointsTo &pt =
ptocc.first;
306 if (pt.empty()) continue;
307
308
310
311
313 }
314
319
320 std::vector<hclust_fast_methods>
methods;
322 {
326 }
327 else
328 {
330 }
331
333 {
335
341 {
343
344
346 {
349 }
350
352
353
354
356 {
358 continue;
359 }
360
363
366
375
383 }
384
386
387
391 }
392
393
394 std::pair<hclust_fast_methods, std::vector<NodeID>>
bestMapping =
396
402
404 if (printStat)
405 {
407 }
408
410}
#define NATIVE_INT_SIZE
Size of native integer that we'll use for bit vectors, in bits.
static const std::string DistanceMatrixTime
static const std::string LargestRegion
static const std::string NumNonTrivialRegionObjects
static const std::string EvalTime
static std::vector< unsigned > regionObjects(const Map< NodeID, Set< NodeID > > &graph, size_t numObjects, size_t &numLabels)
static const std::string BestCandidate
static std::pair< hclust_fast_methods, std::vector< NodeID > > determineBestMapping(const std::vector< std::pair< hclust_fast_methods, std::vector< NodeID > > > &candidates, Map< PointsTo, unsigned > pointsToSets, const std::string &evalSubtitle, double &evalTime, bool printStat)
static const std::string DendrogramTraversalTime
static double * getDistanceMatrix(const std::vector< std::pair< const PointsTo *, unsigned > > pointsToSets, const size_t numObjects, const Map< NodeID, unsigned > &nodeMap, double &distanceMatrixTime)
static void traverseDendrogram(std::vector< NodeID > &nodeMap, const int *dendrogram, const size_t numObjects, unsigned &allocCounter, Set< int > &visited, const int index, const std::vector< NodeID > ®ionNodeMap)
static void printStats(std::string title, Map< std::string, std::string > &stats)
static const std::string NumRegions
static const std::string RegioningTime
static const std::string NumGtIntRegions
static const std::string FastClusterTime
static const std::string NumObjects
static const std::string TotalTime
static NodeIDAllocator * get(void)
Return (singleton) allocator.
static const OptionMap< SVF::NodeIDAllocator::Strategy > NodeAllocStrat
static const Option< bool > RegionAlign
Align identifiers in each region to a word.
static const Option< bool > RegionedClustering
Cluster partitions separately.
static const OptionMap< u32_t > ClusterMethod
static double getClk(bool mark=false)
int hclust_fast(int n, double *distmat, int method, int *merge, double *height)
std::string hclustMethodToString(hclust_fast_methods method)
Returns a string representation of a hclust method.
llvm::IRBuilder IRBuilder