14#ifndef PERSISTENT_POINTS_TO_H_
15#define PERSISTENT_POINTS_TO_H_
31template <
typename Data>
48 idToPts.push_back(std::make_unique<Data>());
72 idToPts.push_back(std::make_unique<Data>());
82 for (
auto &
d :
idToPts)
d->checkAndRemap();
99 idToPts.push_back(std::make_unique<Data>(
pts));
109 assert(
idToPts.size() >
id &&
"PPTC::getActualPts: points-to set not stored!");
124 std::pair<PointsToID, PointsToID>
operands = std::minmax(
lhs,
rhs);
246 std::pair<PointsToID, PointsToID>
operands = std::minmax(
lhs,
rhs);
368 std::pair<PointsToID, PointsToID>
operands;
u64_t lookupIntersections
PointsToID unionPts(PointsToID lhs, PointsToID rhs)
Unions lhs and rhs and returns their union's ID.
PointsToID intersectPts(PointsToID lhs, PointsToID rhs)
Intersects lhs and rhs (lhs AND rhs) and returns the intersection's ID.
std::vector< std::unique_ptr< Data > > idToPts
u64_t uniqueIntersections
u64_t propertyIntersections
OpCache intersectionCache
Maps two IDs to their intersection. Keys must be sorted.
PointsToID newPointsToId(void)
std::function< Data(const Data &, const Data &)> DataOp
PTSToIDMap ptsToId
Maps points-to sets to their corresponding ID.
OpCache unionCache
Maps two IDs to their union. Keys must be sorted.
u64_t propertyComplements
Map< Data, unsigned > getAllPts(void)
const Data & getActualPts(PointsToID id) const
Returns the points-to set which id represents. id must be stored in the cache.
void printStats(const std::string subtitle) const
Print statistics on operations and points-to set numbers.
PointsToID complementPts(PointsToID lhs, PointsToID rhs)
Relatively complements lhs and rhs (lhs \ rhs) and returns it's ID.
Map< std::pair< PointsToID, PointsToID >, PointsToID > OpCache
void remapAllPts(void)
Remaps all points-to sets stored in the cache to the current mapping.
static PointsToID emptyPointsToId(void)
PointsToID emplacePts(const Data &pts)
Map< Data, PointsToID > PTSToIDMap
void initStats(void)
Initialises statistics variables to 0.
PointsToID opPts(PointsToID lhs, PointsToID rhs, const DataOp &dataOp, OpCache &opCache, bool commutative, bool &opPerformed)
PersistentPointsToCache(void)
PointsToID idCounter
Used to generate new PointsToIDs. Any non-zero is valid.
u64_t preemptiveComplements
OpCache complementCache
Maps two IDs to their relative complement.
u64_t preemptiveIntersections
void clear()
Clear the cache.
void reset(void)
Resets the cache removing everything except the emptyData it was initialised with.
std::ostream & outs()
Overwrite llvm::outs()
llvm::IRBuilder IRBuilder