[PATCH] D17408: Add support for merging string with alignment larger than one char
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 13:27:54 PST 2016
ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: lib/MC/StringTableBuilder.cpp:130
@@ +129,3 @@
+ size_t Pos = StringTable.size() - S.size() - (K != RAW);
+ if (Pos % Alignment == 0) {
+ P->second = Pos;
----------------
If we can assume that Alignment is always a power of two, then
if (Pos & (Alignment - 1))
would be faster.
================
Comment at: lib/MC/StringTableBuilder.cpp:189-190
@@ -181,1 +188,4 @@
+ if (P.second) {
+ Size = Start;
Size += S.size() + (K != RAW);
+ }
----------------
Size = Start + S.size() + (K != RAW);
http://reviews.llvm.org/D17408
More information about the llvm-commits
mailing list