Are there any performance test results for usage of likely/unlikely hints?

前端 未结 3 1321
旧时难觅i
旧时难觅i 2021-01-04 22:55

gcc features likely/unlikely hints that help the compiler to generate machine code with better branch prediction.

Is there any data on how proper usage or failure to

3条回答
  •  [愿得一人]
    2021-01-04 23:35

    The question differs, but Peter Cordes's answer on this question gives a clear hint ;) . Modern CPU's ignore static hints and use dynamic branch prediction.

提交回复
热议问题