▲ | _chris_ 2 days ago | |||||||
> A lot of the time this is a hint to the compiler on what the expected paths are so it can keep those paths linear. IIRC, this mainly helps instruction cache locality. The real value is that the easiest branch to predict is a never-taken branch. So if the compiler can turn a branch into a never-taken branch with the common path being straight line code, then you win big. And it takes no space or effort to predict never taken branches. | ||||||||
▲ | o11c 2 days ago | parent [-] | |||||||
> And it takes no space or effort to predict never taken branches. Is that actually true, given that branch history is stored lossily? What if other branches that have the same hash are all always taken? | ||||||||
|