Comment by pyler

5 years ago

about jne issue, LLVM does it intentionally.

Check line 1521

https://llvm.org/doxygen/BranchFolding_8cpp_source.html

Wow thanks for the pointer! That seems unfortunate, I wonder if there is a way to evaluate whether the extra jump is actually worth it, and whether this optimization could be allowed.

Why is that a problem? I'd figure that a short jump is basically free since the target is likely to be in the instruction cache? Is it an issue of readahead/speculation through multiple jumps?