发明名称 Compiling strong and weak branching behavior instruction blocks to separate caches for dynamic and static prediction
摘要 A method and apparatus varies branch prediction strategy associated with branch instructions in a trace of program code. The present invention first profiles branch instructions within a trace to record branching behavior. Next, the present invention partitions branch instructions into groups of branch instructions that can be statically predicted and groups of branch instructions that can be dynamically predicted. Branch instructions that are profiled to have "strong" branching behavior (e.g., the same branch direction is taken 80% of the time) are placed in the group of branch instruction that are statically predicted. Branch instructions that are profiled to have "weak" branching behavior (e.g., the same branch direction is taken 60% of the time) are placed in the group of branch instruction that are dynamically predicted. Finally, branch instructions are adjusted by associating an indication of prediction strategy with each profiled branch instruction. In an embodiment of the present invention, dynamic and static code caches are defined in physical memory by allocating pools of memory pages that have prediction flags set to dynamic and static, respectively. In this embodiment, the trace is translated into the dynamic and static caches by moving branch instruction and basic blocks of code associated with branch instructions into the appropriate code cache based on the groups into which the branch instructions were partitioned. The present invention may be used when a program is originally compiled or when a program is recompiled after a profile-based optimization run. Additionally, the present invention may be used as part of a run-time optimization strategy.
申请公布号 US6115809(A) 申请公布日期 2000.09.05
申请号 US19980070442 申请日期 1998.04.30
申请人 HEWLETT-PACKARD COMPANY 发明人 MATTSON, JR., JAMES S.;SHAH, LACKY V.;BUZBEE, WILLIAM B.
分类号 G06F9/45;(IPC1-7):G06F15/00 主分类号 G06F9/45
代理机构 代理人
主权项
地址