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.
198{
199 assert(pta !=
nullptr &&
"Clusterer::cluster: given null BVDataPTAImpl");
201
208
209
211
213
214
216
217
219 for (
const std::pair<NodeID, unsigned> &
keyOcc :
keys)
220 {
221 const PointsTo &
pts = pta->getPts(
keyOcc.first);
224
225
226
228 {
232 {
234 {
237 }
238 }
239 }
240 }
241
244
248 {
250 }
251 else
252 {
253
256 }
257
258
259
260
261
262
265
266
267
268
269
270
271
273
275
277 {
279
281 {
282
285 }
286
287
289
290
291
292
293
294
295 }
296
297
298
301 {
302 const PointsTo &pt =
ptocc.first;
304 if (pt.empty()) continue;
305
306
308
309
311 }
312
317
318 std::vector<hclust_fast_methods>
methods;
320 {
324 }
325 else
326 {
328 }
329
331 {
333
339 {
341
342
344 {
347 }
348
350
351
352
354 {
356 continue;
357 }
358
361
364
373
381 }
382
384
385
389 }
390
391
392 std::pair<hclust_fast_methods, std::vector<NodeID>>
bestMapping =
394
400
402 if (printStat)
403 {
405 }
406
408}
#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