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.
188{
189 assert(pta !=
nullptr &&
"Clusterer::cluster: given null BVDataPTAImpl");
191
198
199
201
203
204
206
207
209 for (
const std::pair<NodeID, unsigned> &
keyOcc :
keys)
210 {
211 const PointsTo &
pts = pta->getPts(
keyOcc.first);
214
215
216
218 {
222 {
224 {
227 }
228 }
229 }
230 }
231
234
238 {
240 }
241 else
242 {
243
246 }
247
248
249
250
251
252
255
256
257
258
259
260
261
263
265
267 {
269
271 {
272
275 }
276
277
279
280
281
282
283
284
285 }
286
287
288
291 {
292 const PointsTo &pt =
ptocc.first;
294 if (pt.empty()) continue;
295
296
298
299
301 }
302
307
308 std::vector<hclust_fast_methods>
methods;
310 {
314 }
315 else
316 {
318 }
319
321 {
323
329 {
331
332
334 {
337 }
338
340
341
342
344 {
346 continue;
347 }
348
351
354
363
371 }
372
374
375
379 }
380
381
384
390
393
395}
#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 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)
static const std::string BestCandidate
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< enum hclust_fast_methods > 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