[PATCH] Introduce bitset metadata format and bitset lowering pass.

JF Bastien jfb at chromium.org
Thu Feb 19 10:26:11 PST 2015


================
Comment at: lib/Transforms/IPO/LowerBitSets.cpp:42
@@ +41,3 @@
+
+  if ((Offset - ByteOffset) % (1 << AlignLog2) != 0)
+    return false;
----------------
1 should technically be a `uint64_t` too, though if the current code triggered UB things would be awful in other ways!

================
Comment at: lib/Transforms/IPO/LowerBitSets.cpp:236
@@ +235,3 @@
+                                      Value *BitOffset) {
+  if (BSI.Bits.size() <= 8) {
+    // If the bit set is sufficiently small, we can avoid a load by bit testing
----------------
I'm mildly disappointed that the optimizer doesn't do this by taking into account ISA-specific sizes (and then removing the dead global because its address isn't taken).

http://reviews.llvm.org/D7288

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






More information about the llvm-commits mailing list