3 ms·
Read https://en.algorithmica.org/hpc/pipelining/branching/ https://en.algorithmica.org/hpc/pipelining/branching/ and the following chapter. TL;DR: you can gene
by Pannoniae 3y ago
Read https://en.algorithmica.org/hpc/pipelining/branching/ https://en.algorithmica.org/hpc/pipelining/branching/ and the following chapter.
TL;DR: you can generate different, and more efficient code if you know how much it is going to be mispredicted.
- gpderetta 3y agoThe built-in doesn't provide misprediction information to the compiler.
- foldr 3y agoNothing in that link shows how a compiler could make use of a fine-grained probability estimate in a practical way to guide optimizations. I'm perfectly aware of the general concept of branch prediction and the annotations that certain architectures have in their instruction sets.