[PATCH] LowerBitSets: Introduce global layout builder.

Peter Collingbourne peter at pcc.me.uk
Fri Feb 20 14:37:53 PST 2015


I've added a long comment to the top of the `GlobalLayoutBuilder` class which should hopefully explain things a little better.


================
Comment at: lib/Transforms/IPO/LowerBitSets.cpp:125
@@ +124,3 @@
+  std::vector<uint64_t> &Fragment = Fragments.back();
+  uint64_t FragmentIndex = Fragments.size()-1;
+
----------------
jfb wrote:
> Format.
Done

================
Comment at: lib/Transforms/IPO/LowerBitSets.cpp:552
@@ +551,3 @@
+        [](const std::set<uint64_t> &O1, const std::set<uint64_t> &O2) {
+          return O1.size() < O2.size();
+        });
----------------
jfb wrote:
> This won't be deterministic without a tie-breaker?
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.

================
Comment at: test/Transforms/LowerBitSets/layout.ll:5
@@ +4,3 @@
+
+; CHECK: private constant { i32, i32, i32, i32, i32 } { i32 1, i32 5, i32 2, i32 4, i32 3 }
+ at a = constant i32 1
----------------
jfb wrote:
> Could you add an explanation of what the test does?
Done

http://reviews.llvm.org/D7796

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list