发明名称 System and Method for Mitigating the Impact of Branch Misprediction When Exiting Spin Loops
摘要 A computer system may recognize a busy-wait loop in program instructions at compile time and/or may recognize busy-wait looping behavior during execution of program instructions. The system may recognize that an exit condition for a busy-wait loop is specified by a conditional branch type instruction in the program instructions. In response to identifying the loop and the conditional branch type instruction that specifies its exit condition, the system may influence or override a prediction made by a dynamic branch predictor, resulting in a prediction that the exit condition will be met and that the loop will be exited regardless of any observed branch behavior for the conditional branch type instruction. The looping instructions may implement waiting for an inter-thread communication event to occur or for a lock to become available. When the exit condition is met, the loop may be exited without incurring a misprediction delay.
申请公布号 US2016216966(A1) 申请公布日期 2016.07.28
申请号 US201615090554 申请日期 2016.04.04
申请人 Oracle International Corporation 发明人 Dice David;Moir Mark S.
分类号 G06F9/30 主分类号 G06F9/30
代理机构 代理人
主权项 1. A method, comprising: performing by a computer: initiating execution of program instructions;determining that the program instructions comprise a busy-wait type loop and that a conditional branch type instruction specifies an exit condition for the busy-wait type loop, wherein if the exit condition is met, the path taken following the conditional branch type instruction is an exit path for the busy-wait type loop; andin response to said determining: predicting that the path taken following the conditional branch type instruction will be the exit path for the busy-wait type loop;while the specified exit condition is not met: executing the program instructions in the body of the busy-wait type loop; andcontinuing to predict that the path taken following the conditional branch type instruction will be the exit path for the busy-wait type loop; andin response to the exit condition being met, exiting the busy-wait type loop.
地址 Redwood City CA US