3 ms·
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 essenti
by orlp 3y ago
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.
- xoranth 3y agoMmm, 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 https://reviews.llvm.org/D36858 [^2] See: - https://groups.google.com/g/llvm-dev/c/qwogIiwHCAc/m/lSP1jh2WBAAJ https://groups.google.com/g/llvm-dev/c/qwogIiwHCAc/m/lSP1jh2... - https://groups.google.com/g/llvm-dev/c/qwogIiwHCAc/m/EAt643eYBAAJ https://groups.google.com/g/llvm-dev/c/qwogIiwHCAc/m/EAt643e...