The builder is based on a layout algorithm that tries to keep members of
small bit sets together. The new layout compresses Chromium's bit sets to
around 15% of their original size.
Details
Diff Detail
Event Timeline
Nice results :-)
I honestly have a bit of a hard time visualizing how the algorithm works. Do you think you could illustrate it a bit more clearly?
lib/Transforms/IPO/LowerBitSets.cpp | ||
---|---|---|
125 | Format. | |
553 | This won't be deterministic without a tie-breaker? | |
test/Transforms/LowerBitSets/layout.ll | ||
6 | Could you add an explanation of what the test does? |
I've added a long comment to the top of the GlobalLayoutBuilder class which should hopefully explain things a little better.
lib/Transforms/IPO/LowerBitSets.cpp | ||
---|---|---|
125 | Done | |
553 | Because I'm using stable_sort, it should be as deterministic as EquivalenceClasses is. I'm not certain, but it looks like the only non-determinism there relates to the order in which elements are visited (i.e. begin()..end()), not the order in which members of equivalence classes are visited (member_begin()..member_end()). That's a separate problem which we should fix somehow. | |
test/Transforms/LowerBitSets/layout.ll | ||
6 | Done |
lib/Transforms/IPO/LowerBitSets.cpp | ||
---|---|---|
553 | My main concern is that order of iteration of std::set isn't stable, am I understanding correctly? |
lib/Transforms/IPO/LowerBitSets.cpp | ||
---|---|---|
553 | I don't understand. We aren't iterating over std::set here. BitSetMembers is a std::vector. |
lib/Transforms/IPO/LowerBitSets.cpp | ||
---|---|---|
553 | Sorry, explaining myself badly: if the std::set are equal then we can't iterate through them to compare members? I guess your point was that using std::stable_sort keeps the same order as BitSetMembers already had, and that was already deterministic? |
lib/Transforms/IPO/LowerBitSets.cpp | ||
---|---|---|
553 | I still don't get it. We aren't iterating over any std::sets here, we are only taking their sizes. Anyway, std::sets are ordered, see http://en.cppreference.com/w/cpp/container/set |
lib/Transforms/IPO/LowerBitSets.cpp | ||
---|---|---|
553 | Oh, and BitSetMembers is deterministic within the equivalence class (I think). |
include/llvm/Transforms/IPO/LowerBitSets.h | ||
---|---|---|
120 | I'm not sure I understand how "Clients should use a nested pair of for loops to access the object indices." is helpful. Are you trying to illustrate the order of indices? | |
lib/Transforms/IPO/LowerBitSets.cpp | ||
534 | Could you clarify below what operands 0 and 1 are? It's not obvious from the surrounding code. | |
553 | Oh I get it now, I was indeed confused :-) |
I'm not sure I understand how "Clients should use a nested pair of for loops to access the object indices." is helpful. Are you trying to illustrate the order of indices?