Skip to content

Commit 47c8a74

Browse files
sdunsterfacebook-github-bot
authored andcommitted
remove unnecessary compiler hint to unbreak GenAI on aarch64
Summary: We've run into a super curious issue where the folly JSON encoder appeared to be producing corrupted integers when built with gcc for aarch64. We believe removing these compiler hints works around that issue while we attempt to fix gcc with no perf impact because the branch predictor should do the right thing even without these hints. Reviewed By: anobra, Gownta Differential Revision: D76633143 fbshipit-source-id: cd0bca04552ffb916ee21dec3beac2c12aa86f55
1 parent 04c2e79 commit 47c8a74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

third-party/folly/src/folly/lang/ToAscii.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ FOLLY_ALWAYS_INLINE void to_ascii_with_table(
276276
char* out, size_t size, uint64_t v) {
277277
using table = to_ascii_table<Base, Alphabet>;
278278
auto pos = size;
279-
while (FOLLY_UNLIKELY(pos > 2)) {
279+
while (pos > 2) {
280280
pos -= 2;
281281
// keep /, % together so a peephole optimization computes them together
282282
auto const q = v / (Base * Base);
@@ -287,7 +287,7 @@ FOLLY_ALWAYS_INLINE void to_ascii_with_table(
287287
}
288288

289289
auto const val = table::data.data[size_t(v)];
290-
if (FOLLY_UNLIKELY(pos == 2)) {
290+
if (pos == 2) {
291291
std::memcpy(out, &val, 2);
292292
} else {
293293
*out = val >> (kIsLittleEndian ? 8 : 0);

0 commit comments

Comments
 (0)