发明名称 Loop branch reduction
摘要 A method for reducing loop branches comprises analyzing an intermediate code to identify a candidate loop; analyzing the candidate loop to identify a candidate conditional statement containing at least one mutable operand; and determining if the computation in the candidate conditional statement is monotonic. The method further comprises calculating initial and final values of the mutable operand and generating a first version of the candidate loop which does not contain the candidate conditional statement and which is configured to be executed if the initial and final values of the mutable operand satisfy a range check. The method also comprises generating a second version of the candidate loop which contains the candidate conditional statement and which is configured to be executed if at least one of the initial and final values of the mutable operand does not satisfy the range check.
申请公布号 US9600254(B1) 申请公布日期 2017.03.21
申请号 US201514953688 申请日期 2015.11.30
申请人 International Business Machines Corporation 发明人 Gao Yaoqing;Ravindar Archana
分类号 G06F9/44;G06F9/45;G06F9/30 主分类号 G06F9/44
代理机构 代理人 Nordstrom Gregory M.
主权项 1. A computer-implemented method of reducing loop branches comprising: analyzing an intermediate code corresponding to source code to be compiled to identify a candidate loop based at least in part on the loop including, within the loop, at least one candidate conditional statement, wherein the candidate conditional statement contains at least one mutable operand; analyzing a portion of the intermediate code to determine if a computation, which computes respective values of the mutable operand in the candidate conditional statement in iterations of the loop, is monotonic; in response to determining that the computation in the candidate conditional statement is monotonic, calculating an initial value of the mutable operand and a final value of the mutable operand; generating a first version of the candidate loop which does not contain the candidate conditional statement and which is configured to be executed if the initial value of the mutable operand and the final value of the mutable operand satisfy a range check; and generating a second version of the candidate loop which contains the candidate conditional statement and which is configured to be executed if at least one of the initial value of the mutable operand or the final value of the mutable operand does not satisfy the range check.
地址 Armonk NY US