首页> 外国专利> A method for performing global common subexpression elimination and code motion in an optimizing compiler

A method for performing global common subexpression elimination and code motion in an optimizing compiler

机译:在优化编译器中执行全局通用子表达式消除和代码运动的方法

摘要

A method for use during the optimization phase of an optimizing compiler for performing global common subexpression elimination and code motion which comprises: Determining the code basis for the object program which includes examining each basic block of code and determining the basis items on which each computation depends wherein basis items are defined as operands which are referenced in a basic block before being computed. The method next determines the "kill set" for each basis item. A kill set for one basis item is defined as the set of items comprising all non basis items which depends on the one basis item for its value. Following this UEX, DEX, and THRU are determined for each basic bloc using the previously determined basis and "kill set" information. A UEX is defined as a set of upward exposed computations, the set of computations which if executed at the beginning of a basic block give the same result as when executed in the original place in the block, wherein DEX is defined as a similar set of downward expressions and wherein THRU is defined as a set of computations which if computed at the beginning or end of the basic block give the same result. AVAIL, the set of computations whose results are valid when the basic block is entered, and INSERT, the set of computations which will be inserted at the end of the basic block, are computed from UEX, DEX, and THRU, and appropriate code insertions are made at those locations indicated by the preceding step, and finally redundant code is removed using the AVAIL set.
机译:一种在优化编译器的优化阶段用于执行全局公共子表达式消除和代码运动的方法,该方法包括:确定目标程序的代码基础,包括检查每个基本代码块并确定每个计算所依赖的基础项目其中,基项定义为在计算之前在基本块中引用的操作数。接下来,该方法为每个基础项目确定“杀死集”。一个基本项目的杀死集定义为包括所有非基本项目的一组项目,所有非基本项目的价值取决于一个基本项目的价值。在此之后,使用先前确定的基础和“技能集”信息为每个基本组确定UEX,DEX和THRU。 UEX被定义为一组向上暴露的计算,如果在基本块的开头执行该计算,则其结果与在该块的原始位置执行时的结果相同,其中DEX被定义为一组类似的计算。向下的表达式,其中THRU被定义为一组计算,如果在基本块的开头或结尾进行计算,则会得出相同的结果。从UEX,DEX和THRU以及相应的代码插入中计算出AVAIL(当输入基本块时其结果有效的一组计算结果)和INSERT(将在基本块的末尾插入的一组计算结果)在上一步指示的那些位置进行操作,最后使用AVAIL集删除冗余代码。

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号