Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wasn't aware of __builtin_unpredictable until yesterday. I was aware of __builtin_expect_with_probability. Unfortunately I've found both of them to be essentially useless with today's compilers.


Mmm, it looks like LLVM even has a pass to actively convert generated cmovs into branches if one of the operands touches memory [^1], and that only supported way to force things to be brancheless is inline assembly [^2].

[^1] https://reviews.llvm.org/D36858 [^2] See: - https://groups.google.com/g/llvm-dev/c/qwogIiwHCAc/m/lSP1jh2... - https://groups.google.com/g/llvm-dev/c/qwogIiwHCAc/m/EAt643e...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: