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.
194{
195 assert(pta !=
nullptr &&
"Clusterer::cluster: given null BVDataPTAImpl");
197
204
205
207
209
210
212
213
215 for (
const std::pair<NodeID, unsigned> &
keyOcc :
keys)
216 {
217 const PointsTo &
pts = pta->getPts(
keyOcc.first);
220
221
222
224 {
228 {
230 {
233 }
234 }
235 }
236 }
237
240
244 {
246 }
247 else
248 {
249
252 }
253
254
255
256
257
258
261
262
263
264
265
266
267
269
271
273 {
275
277 {
278
281 }
282
283
285
286
287
288
289
290
291 }
292
293
294
297 {
298 const PointsTo &pt =
ptocc.first;
300 if (pt.empty()) continue;
301
302
304
305
307 }
308
313
314 std::vector<hclust_fast_methods>
methods;
316 {
320 }
321 else
322 {
324 }
325
327 {
329
335 {
337
338
340 {
343 }
344
346
347
348
350 {
352 continue;
353 }
354
357
360
369
377 }
378
380
381
385 }
386
387
390
396
399
401}
#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< 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