首页> 外国专利> METHOD OF CONSTRUCTING A CONSTANT-FOLDING MECHANISM IN A MULTILANGUAGE OPTIMIZING COMPILER

METHOD OF CONSTRUCTING A CONSTANT-FOLDING MECHANISM IN A MULTILANGUAGE OPTIMIZING COMPILER

机译:在多语言优化编译器中构造恒定折叠机制的方法

摘要

Shoold not appear in this sectionA compiler framework uses a generic "shell" or control and sequencing mechanism, and a generic back end (where thecode generator is target-specific). The generic back end includes the functions of optimization, register and memory allocation,and code generation. The shell may be executed on various host computers, and the code generation function of the back end maybe targeted for any of a number of computer architectures. A front end is tailored for each different source language, such asCobol, Fortran, Pascal, C, C + +, Ada, etc. The front end scans and parses the source code modules, and generates from them anintermediate language ("IL") representation of the programs expressed in the source code. This IL is constructed to represent anyof the source code languages in a universal manner, so the interface between the front end and back end is of a standard format,and need not be rewritten for each language-specific front end. The IL representation by the front end is based upon atuple as the elemental unit, where each tuple represents a single operation to be performed, such as a load, a store, an add, alabel, a branch, etc. A data structure is created by the front end for each tuple, with fields for various necessary information. Onefeature of the invention is a mechanism for representing effects and dependencies in the interface between front end and backend; a tuple has an effect if it writes to memory, and has a dependency if it reads from a location which some other node maywrite to. A mechanism independent of source language is provided for describing the effects of program execution. Anotherfeature is the use in the optimization part of the compiler of a method for analyzing induction variables, where the improvement is touse the side effects sets used to construct IDEF sets. Another feature is a mechanism for "folding constants" (referred to asK-folding or a KFQLD routine), included as one of the optimizations. A further feature is the type definition mechanism, referredto as the TD module, which provides mechanisms used by the front end and the compiler of the back end in constructingprogram type information to be incorporated in an object module for use by a linker or debugger. Another feature is a method fordoing code generation using code templates in a multipass manner.
机译:未在本节中出现编译器框架使用通用的“外壳”或控制和排序机制以及通用后端(其中代码生成器是特定于目标的)。通用后端包括优化,寄存器和内存分配的功能,和代码生成。该外壳程序可以在各种主机上执行,并且后端的代码生成功能可以针对许多计算机体系结构中的任何一种。为每种不同的源语言量身定制了一个前端,例如Cobol,Fortran,Pascal,C,C ++,Ada等。前端扫描并解析源代码模块,并从中生成一个用源代码表示的程序的中间语言(“ IL”)表示。此IL构造为代表任何源代码语言是通用的,因此前端和后端之间的接口是标准格式,并且无需针对每种特定于语言的前端进行重写。前端的IL表示基于元组作为基本单位,其中每个元组表示要执行的单个操作,例如加载,存储,添加,标签,分支等。前端为每个元组创建一个数据结构,其中包含用于各种必要信息的字段。一本发明的特征是在前端和后端之间的接口中表示效果和依赖性的机制。结束;如果元组写入内存,则有作用;如果从其他节点可能读取的位置进行读取,则有依赖关系写给。提供了一种独立于源语言的机制,用于描述程序执行的效果。另一个功能是在编译器的优化部分中使用一种方法来分析归纳变量,其中改进之处在于:使用用于构造IDEF集的副作用集。另一个功能是“折叠常量”的机制(称为K折或KFQLD例程),作为优化之一。另一个特征是类型定义机制,称为以TD模块的形式提供,它提供了前端和后端的编译器在构造时使用的机制要包含在对象模块中的程序类型信息,以供链接器或调试器使用。另一个功能是使用代码模板以多遍方式进行代码生成。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号