5 #include "graphstructs.h"
9 NodeValuePair(EncodingNode *n, uint64_t val) : node(n), value(val) {}
17 typedef Hashset<EncodingValue *, uintptr_t, PTRSHIFT> HashsetEncodingValue;
18 typedef SetIterator<EncodingValue *, uintptr_t, PTRSHIFT> SetIteratorEncodingValue;
22 EncodingValue(uint64_t _val) : value(_val), encoding(0), inComparison(false), assigned(false) {}
23 void merge(EncodingValue *value);
28 HashsetEncodingNode nodes;
29 HashsetEncodingValue larger;
30 HashsetEncodingValue notequals;
34 uint hashNodeValuePair(NodeValuePair *nvp);
35 bool equalsNodeValuePair(NodeValuePair *nvp1, NodeValuePair *nvp2);
37 typedef Hashtable<NodeValuePair *, EncodingValue *, uintptr_t, 0, hashNodeValuePair, equalsNodeValuePair> NVPMap;
39 class EncodingSubGraph {
43 void addNode(EncodingNode *n);
44 SetIteratorEncodingNode *nodeIterator();
46 uint getEncoding(EncodingNode *n, uint64_t val);
47 uint getEncodingMaxVal(EncodingNode *n) { return maxEncodingVal;}
51 uint estimateNewSize(EncodingNode *n);
52 uint estimateNewSize(EncodingSubGraph *sg);
53 void traverseValue(EncodingNode *node, uint64_t value);
54 void computeEncodingValue();
55 void computeComparisons();
56 void computeEqualities();
57 void solveComparisons();
59 void generateComparison(EncodingNode *left, EncodingNode *right);
60 void generateEquals(EncodingNode *left, EncodingNode *right);
61 void orderEV(EncodingValue *smaller, EncodingValue *larger);
63 HashsetEncodingValue values;
64 HashsetEncodingNode nodes;
70 friend class EncodingGraph;