Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Compiler Optimization

a compiler and optimization technology, applied in computing, instruments, electric digital data processing, etc., can solve problems such as failure to effectively utilize instruction and program to be optimized

Inactive Publication Date: 2009-01-01
IBM CORP
View PDF6 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Benefits of technology

The present invention provides a solution to the problem of failing to effectively utilize instructions specific to an architecture by providing a compiler that detects and replaces patterns in a program to be optimized. The compiler includes a target partial program detecting unit, an instruction sequence transforming unit, and an instruction sequence replacing unit that allows for the efficient use of architecture-specific instructions. This results in improved performance and efficiency of the program being optimized.

Problems solved by technology

However, it is rare that a program to be optimized completely matches a predetermined pattern.
Therefore there has been a possibility of failure to effectively utilize an instruction such as a TRT instruction specific to an architecture.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Compiler Optimization
  • Compiler Optimization
  • Compiler Optimization

Examples

Experimental program
Comparison scheme
Effect test

first example

[0080]FIG. 5(a) shows the pattern 20 to be replaced in the first example.

[0081]The pattern 20 is a pattern to be replaced for detection of an instruction sequence shown in FIG. 16. In the instruction sequence shown in FIG. 16, the destination of branching from a switch instruction (2) is variable among numbers from 2 to 256. It is, therefore, thought that there is a need to generate 255 patterns 20 having the corresponding number of branching destinations 2 to 256 in order to suitably detect the switch instruction. However, it is inefficient to compare the large number of patterns 20 and partial programs because a long processing time is required for the comparison there between.

[0082]Then, the target partial program detecting unit 110 detects partial programs to be optimized by using the illustrated pattern 20. This pattern 20 has, with respect to a multiple-branch instruction (e.g., switch instruction (2)) to hand over control to an external instruction out of the pattern 20 in a ...

second example

[0096]FIG. 8 shows a second example of the partial program 40 by the compiler 10. The program shown in FIG. 8(a) is a source program representing details of processing in accordance with the partial program 40 is shown. FIG. 8(b) is a control flow graph of the partial program 40 is shown. According to the partial program 40, the computer scans in order a storage area determined by a variable “bytes”, with respect to the index indicated by a variable “offset”. Loop processing is terminated when a negative value is detected.

[0097]In the partial program 40, loop processing has two induction variables: the variable “offset” and a variable “count”. That is, the partial program 40 and the pattern 20 shown in FIG. 5(a) apparently differ in program structure from each other. Therefore, the conventional compiler cannot recognize the partial program 40 as a program to be optimized.

[0098]According to the compiler 10 in this embodiment, the target partial program detecting unit 110 can detect a...

third example

[0102]FIG. 10 shows a third example of the partial program 40 by the compiler 10. This figure shows a source program representing details of processing in accordance with the partial program 40. According to the partial program 40, the computer scans in order a storage area determined by a variable “bytes” with respect to the index indicated by a variable “offset”. Loop processing is terminated when a negative value is detected. In this loop processing, a storage area determined by a variable “a” is initialized in order from the top.

[0103]In the partial program 40, loop processing has two induction variables: the variable “offset” and a variable “count”. That is, the partial program 40 and the pattern 20 shown in FIG. 5(a) apparently differ in program structure from each other. In this case, the conventional compiler cannot recognize the partial program 40 as a program to be optimized.

[0104]According to the compiler 10 in this embodiment, the target partial program detecting unit 11...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

Provides effective use of architecture-specific instructions. There is provided a compiler including: a target partial program detecting unit for detecting, from among a partial programs of the program to be optimized, a partial program including instructions corresponding to all instructions included in the pattern to be replaced as a partial program to be optimized; an instruction sequence transforming unit for transforming, in the partial program to be optimized, instructions other than those instructions corresponding to instructions included in the pattern to be replaced and those instructions having execution dependencies different from the pattern to be replaced, so that dependencies between instructions included in the partial program to be optimized match the pattern to be replaced; an instruction sequence replacing unit for replacing the partial program to be optimized transformed by the instruction sequence transforming unit with a target instruction sequence determined in accordance with the pattern to be replaced.

Description

FIELD OF THE INVENTION[0001]The present invention relates to a compiler, an optimization method, a compiler program, and a recording medium. In particular, the present invention relates to a compiler, an optimization method, a compiler program, and a recording medium that replace an instruction arrangement pattern that is known to be optimizable with a target instruction sequence corresponding to the arrangement pattern.BACKGROUND[0002]There has been proposed a technique of detecting an instruction sequence matching a predetermined pattern from a program to be optimized and replacing the instruction sequence with another instruction sequence determined in advance in accordance with the pattern. This technique can optimize a program, for example, by replacing a sequence of instructions for performing a certain kind of processing with a single instruction producing the same processing result as the processing performed by the sequence of instructions. The instruction which replaces th...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(United States)
IPC IPC(8): G06F9/45
CPCG06F8/4434
Inventor KAWAHITO, MOTOHIROKOMATSU, HIDEAKI
Owner IBM CORP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products