Remix.run Logo
dzaima a day ago

The limiting thing isn't necessarily speculating, but more just the number of branches per cycle, i.e. number of non-contiguous locations the processor has to query from L1 / uop cache (and which the branch predictor has to determine the location of). You get that limit with unconditional branches too.

gpderetta 6 hours ago | parent [-]

Indeed, the limit is on taken branches, hence why making the most likely case fall through is often an optimization.