Supercharge Your Innovation With Domain-Expert AI Agents!

Method and apparatus for performing versioning for loop, method and apparatus for collecting array range check information in basic blocks, method for modifying array range check information, method for optimizing array range checks, method for generating codes for array range checks, method and apparatus for eliminating redundant array range checks, method for selecting array range checks, method for modifying array range checks, method for collecting array range checks, and method for determing handling of array range checks

a versioning loop and loop technology, applied in the field of compilers, can solve the problems of not being able to the method cannot apply to a language, and cannot apply in the case of an ending condition of a loop

Inactive Publication Date: 2003-10-30
IBM CORP
View PDF11 Cites 12 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Benefits of technology

[0026] To achieve the above-mentioned objects, this invention may be categorized into the following three parts. Namely, (A) a part to eliminate redundant array range checks by performing a versioning for a loop, (B) a part to optimize array range checks by performing data-flow analysis in reverse order of the program execution, and (C) a part to obtain information about array ranges already checked by performing data-flow analysis in program execution order and eliminate redundant array range checks from this information.

Problems solved by technology

Namely, this method can only apply to a language whose specification defines that it is an error to exceed a range.
Moreover, it can only apply when an array index in a loop changes monotonously.
In addition, it cannot apply in the case that an ending condition of a loop cannot be put out of the loop, for instance, when end is a global variable, etc. in the above instance and end is changed by itself in the loop or by another thread.
However, it can only apply when an array index in a loop changes monotonously.
In addition, it cannot apply in the case that an ending condition of a loop cannot be put out of the loop, for instance, when end is a global variable, etc. in the above instance and end is changed by itself in the loop or by another thread.
However, it has a disadvantage that the range to be determined as already checked is small.
However, in reality there are many cases in which a range of a variable cannot be narrowed down.
However, it has its disadvantages, namely, the range in which it can eliminate array range checks is narrow and it can only apply to a language whose specification defines that it is an error to exceed a range.
As this occurrence of an exception may be used to write a program, a program will not run correctly without performing array range checks.
It is because, in the case of (B), it is not possible to handle it if there is an instruction which causes a side effect.

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
  • Method and apparatus for performing versioning for loop, method and apparatus for collecting array range check information in basic blocks, method for modifying array range check information, method for optimizing array range checks, method for generating codes for array range checks, method and apparatus for eliminating redundant array range checks, method for selecting array range checks, method for modifying array range checks, method for collecting array range checks, and method for determing handling of array range checks
  • Method and apparatus for performing versioning for loop, method and apparatus for collecting array range check information in basic blocks, method for modifying array range check information, method for optimizing array range checks, method for generating codes for array range checks, method and apparatus for eliminating redundant array range checks, method for selecting array range checks, method for modifying array range checks, method for collecting array range checks, and method for determing handling of array range checks
  • Method and apparatus for performing versioning for loop, method and apparatus for collecting array range check information in basic blocks, method for modifying array range check information, method for optimizing array range checks, method for generating codes for array range checks, method and apparatus for eliminating redundant array range checks, method for selecting array range checks, method for modifying array range checks, method for collecting array range checks, and method for determing handling of array range checks

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0066] Device configuration of the present invention in an environment using Java is described by using FIG. 1. Server computer 1 and client computer 5 are connected via network 3. Client computer 5 includes Java VM (Virtual Machine) 52 and OS (Operating System) 53 and hardware (including a CPU and memory) 55. In addition, Java VM 52 includes Java interpreter 54 or Java JIT compiler 56. It may have both interpreter 54 and JIT compiler 56. Client computer 5 may be, other than an ordinary computer, a so-called network computer or a home information appliance which has smaller size of memory or does not include any sub-storage such as a hard disk.

[0067] On server computer 1, Java source code 10 is compiled by Java compiler 12. The result of this compilation is bytecode 14. This bytecode 14 is sent to client computer 5 via network 3. Bytecode 14 is a native code for Java Virtual Machine (Java VM) 52 installed on a WWW browser (World Wide Web Browser) in client computer 5, etc., and Java...

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

Java language is, as its specification, capable of detecting an access exceeding an array range, and when there is no user-defined exception handler, moving control to an invoked method after getting out of a method in which an exception occurred, or when there is a user-defined exception handler, moving the process to the exception handler. Accordingly, an array range check is essential since occurrence of an exception may be described as a correct operation. However, an array range check slows execution speed compared with a language which does not require it. In an actual program, there is an array access to ensure that there is no access exceeding a range, and thus elimination of such redundant range checks greatly contributes to improved performance, and in addition, brings about an effect of expanding the range of optimization from the viewpoint of ensuring order of execution between occurrence of an exception and a process with a side effect such as an assignment of a value to an array.

Description

[0001] 1. Technical Field[0002] The present invention relates to a compiler, more particularly to a method for eliminating or optimizing an array range check in a compiler. An array range check is a check on whether an array access in a program is exceeding its array range.[0003] 2. Prior Art[0004] Several methods exist for eliminating an array range check based on the background art.[0005] One such method is for checking the possibility of a range exceeding before a loop. (See "Elimination of Redundant Array Subscript Range Checks", Priyadarshan Kolte and Michael Wolfe, In proceedings of the ACM SIGPLAN '95 Conference on Programming Language Design and Implementation, pp. 270 to 278, June 1995, etc.)[0006] Table 1 in which 0 is the lower bound of an array and N is its size is modified to Table 2 as follows.1TABLE 1 for (i = start; i <= end; i++) a[i] = 0;[0007]2 TABLE 2 if ((start <= end) && (start < 0 .vertline..vertline. end > N-1)) { exception; / * exceed an array ran...

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
IPC IPC(8): G06F9/44G06F9/45
CPCG06F8/4441G06F8/437
Inventor KAWAHITO, MOTOHIROYASUE, TOSHIAKIKOMATSU, HIDEAKI
Owner IBM CORP
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More