- 1、本文档共30页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
多核编译器 - 杨全胜
* Where IPO was a static analysis of your program, PGO is a dynamic analysis. The execution-time characteristics are recorded, and this information is fed into the other optimization phases. Basic block ordering – The compiler uses profile information to place frequently executed blocks in a function close together.? This leads to better I-cache utilization because frequently executed code paths are closer together address-wise. Better register allocation – When allocating registers to hold the values of variables and temporaries, register allocation will give priority to the most frequently executed basic blocks.? As a result, hopefully spills of variables and temporaries to memory (when the register allocator runs out of registers) will be more likely to occur in the infrequently executed basic blocks. Better decision of functions to inline – Inlining incurs code size costs.? By having execution counts of basic blocks (and routines), the compiler can decide to inline heavily executed functions.? There is little value in inlining a routine that is minimally executed (assuming that the profile is representative).? Function ordering – It is similar to basic block ordering; it places heavily executed functions closer together (address-wise).? This enables better paging performance as the utilization of instructions brought in with every page should be higher. Switch-statement optimization – The compiler can pull out high frequency cases and perform an explicit compare for these cases before either doing the tests for the lower frequency cases or performing the indirect jump (which is typically costly on an out-of-order machine with branch prediction). Better vectorization decisions – Vectorization can incur code size cost (extra cleanup loop). ?In addition, it does not make sense to vectorize loops with low trip counts.? Profile information can be used to provide the compiler with heavily executed loops that have high trip counts. * Each execution generates one dyn
文档评论(0)