首页> 外国专利> COMPILER OPTIMISATION LIKE IDIOM RECOGNITION THROUGH PATTERN MATCHING USING VALUE NUMBERING

COMPILER OPTIMISATION LIKE IDIOM RECOGNITION THROUGH PATTERN MATCHING USING VALUE NUMBERING

机译:通过值匹配通过模式匹配实现对偶像识别的编译器优化

摘要

A compiler (10) and method for compiling source code comprising: a library (20) of code patterns and control flow information for each code pattern, wherein each code pattern comprises one or more variable; and a processor (30) arranged to: evaluate the control flow of an expression (120) in the source code, wherein the expression (120) comprises one or more variable, match the expression (120) to one of the code patterns in the library (20) based on the evaluated control flow information, assign value numbers to the one or more variable within the expression (120), determine if the expression (120) and the matched code pattern are equivalent based on the assigned value numbers, and replace the expression (120) in the source code with a replacement expression if the expression and the matched code pattern are equivalent.
机译:一种用于编译源代码的编译器(10)和方法,包括:代码模式库和每个代码模式的控制流信息的库(20),其中,每个代码模式包括一个或多个变量;处理器(30),其用于:在源代码中评估表达式(120)的控制流,其中,表达式(120)包括一个或多个变量,使表达式(120)与代码中的代码模式之一匹配。库(20)基于所评估的控制流信息,将值编号分配给表达式(120)内的一个或多个变量,基于分配的值编号确定表达式(120)和匹配的代码模式是否等效,以及如果该表达式和匹配的代码模式等效,则用替换表达式替换源代码中的表达式(120)。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号