5 #include "graphstructs.h"
9 NodeValuePair(EncodingNode *n, uint64_t val) : node(n), value(val) {}
16 typedef Hashset<EncodingValue *, uintptr_t, PTRSHIFT> HashsetEncodingValue;
17 typedef SetIterator<EncodingValue *, uintptr_t, PTRSHIFT> SetIteratorEncodingValue;
21 EncodingValue(uint64_t _val) : value(_val), encoding(0), inComparison(false), assigned(false) {}
22 void merge(EncodingValue *value);
27 HashsetEncodingNode nodes;
28 HashsetEncodingValue larger;
29 HashsetEncodingValue notequals;
32 uint hashNodeValuePair(NodeValuePair *nvp);
33 bool equalsNodeValuePair(NodeValuePair *nvp1, NodeValuePair *nvp2);
35 typedef Hashtable<NodeValuePair *, EncodingValue *, uintptr_t, 0, hashNodeValuePair, equalsNodeValuePair> NVPMap;
37 class EncodingSubGraph {
41 void addNode(EncodingNode *n);
42 SetIteratorEncodingNode *nodeIterator();
44 uint getEncoding(EncodingNode *n, uint64_t val);
45 uint getEncodingMaxVal(EncodingNode *n) { return maxEncodingVal;}
49 uint estimateNewSize(EncodingNode *n);
50 uint estimateNewSize(EncodingSubGraph *sg);
51 void traverseValue(EncodingNode *node, uint64_t value);
52 void computeEncodingValue();
53 void computeComparisons();
54 void computeEqualities();
55 void solveComparisons();
57 void generateComparison(EncodingNode *left, EncodingNode *right);
58 void generateEquals(EncodingNode *left, EncodingNode *right);
59 void orderEV(EncodingValue *smaller, EncodingValue *larger);
61 HashsetEncodingValue values;
62 HashsetEncodingNode nodes;
68 friend class EncodingGraph;