Patent Description:
Aliasing refers to the case where the data location in memory can be accessed through different symbolic names in the program. Thus, modifying the data through one name implicitly modifies the values associated with all aliased names. As a result, aliasing has various effects on performance of the compiler and correctness of the code generated by the compiler. Where a value for an alias of a pointer is not known at compile time, runtime alias checks are inserted into the compiled code.

<CIT> teaches pointer disambiguation by comparing lower and upper bounds of runtime code and loop parallelization if runtime check overhead is justified by the performance gain.

<CIT> describes a compiler using direct buffering for regular loop data, and performing runtime check at the boundary of direct buffer ranges. The compiler performs further loop optimizations.

<NPL>, describes techniques for pointer disambiguation at runtime.

The present invention defines a method of optimizing runtime alias checks according to independent claim <NUM> and an apparatus for optimizing runtime alias checks according to independent claim <NUM>. Further details are defined in the dependent claims.

According to the invention, a method of optimizing runtime alias checks includes identifying, by a compiler, a base pointer and a plurality of different memory accesses based on the base pointer in a code loop; generating, by the compiler, a first portion of runtime code to determine a minimum access and a maximum access of the plurality of different memory accesses; and generating, by the compiler, a second portion of runtime code including one or more runtime alias checks for the minimum access and one or more runtime alias checks for the maximum access.

The one or more runtime alias checks are based on one or more other base pointers in the code loop. The method includes identifying, by the compiler, in the code loop, a first memory access group based on the base pointer and a second memory access group based on another base pointer, wherein the first memory access group and the second memory access group share a common memory access pattern; wherein generating the first portion of runtime code to determine the minimum access and the maximum access of the plurality of different memory addresses includes generating, by the compiler, the first portion of runtime code to determine the minimum access and the maximum access based on the common memory access pattern. In some embodiments, generating the first portion of runtime code to determine the minimum access and the maximum access of the plurality of different memory addresses includes generating, by the compiler, the first portion of runtime code to determine another minimum access for the other base pointer and another maximum access for the other base pointer based on the common memory access pattern; and generating the second portion of runtime code includes generating, by the compiler, the second portion of runtime code including one or more runtime alias checks for the other minimum access and one or more runtime alias checks for the other maximum access. In some embodiments, the method includes generating, by the compiler, a third portion of runtime code to determine another minimum access for the second base pointer based on the minimum access for the base pointer and determine another maximum access for the second base pointer based on the maximum access for the base pointer; wherein generating the second portion of runtime code includes generating, by the compiler, the second portion of runtime code including one or more runtime alias checks for the other minimum access and one or more runtime alias checks for the other maximum access. In some embodiments, the method includes determining, by the compiler, an estimated cost of the one or more runtime checks; and determining, by the compiler, that the estimated cost falls below a threshold; wherein generating the first portion of runtime code and generating the second portion of runtime code are performed in response to the estimated cost falling below the threshold. In some embodiments, the method includes applying, by the compiler, one or more loop optimizations to the code loop.

According to the invention, an apparatus for optimizing runtime alias checks performs steps including: identifying, by a compiler, a base pointer and a plurality of different memory accesses based on the base pointer in a code loop; generating, by the compiler, a first portion of runtime code to determine a minimum access and a maximum access of the plurality of different memory accesses; and generating, by the compiler, a second portion of runtime code including one or more runtime alias checks for the minimum access and one or more runtime alias checks for the maximum access.

The one or more runtime alias checks are based on one or more other base pointers in the code loop. The steps include identifying, by the compiler, in the code loop, a first memory access group based on the base pointer and a second memory access group based on another base pointer, wherein the first memory access group and the second memory access group share a common memory access pattern; wherein generating the first portion of runtime code to determine the minimum access and the maximum access of the plurality of different memory addresses includes generating, by the compiler, the first portion of runtime code to determine the minimum access and the maximum access based on the common memory access pattern. In some embodiments, generating the first portion of runtime code to determine the minimum access and the maximum access of the plurality of different memory addresses includes generating, by the compiler, the first portion of runtime code to determine another minimum access for the other base pointer and another maximum access for the other base pointer based on the common memory access pattern; and generating the second portion of runtime code includes generating, by the compiler, the second portion of runtime code including one or more runtime alias checks for the other minimum access and one or more runtime alias checks for the other maximum access. In some embodiments, the steps include generating, by the compiler, a third portion of runtime code to determine another minimum access for the second base pointer based on the minimum access for the base pointer and determine another maximum access for the second base pointer based on the maximum access for the base pointer; wherein generating the second portion of runtime code includes generating, by the compiler, the second portion of runtime code including one or more runtime alias checks for the other minimum access and one or more runtime alias checks for the other maximum access. In some embodiments, the steps include determining, by the compiler, an estimated cost of the one or more runtime checks; and determining, by the compiler, that the estimated cost falls below a threshold; wherein generating the first portion of runtime code and generating the second portion of runtime code are performed in response to the estimated cost falling below the threshold. In some embodiments, the steps include applying, by the compiler, one or more loop optimizations to the code loop.

In some embodiments, a computer program product for optimizing runtime alias checks is disposed upon a computer readable medium and includes computer program instructions that, when executed, cause a computer to perform steps including: identifying, by a compiler, a base pointer and a plurality of different memory accesses based on the base pointer in a code loop; generating, by the compiler, a first portion of runtime code to determine a minimum access and a maximum access of the plurality of different memory accesses; and generating, by the compiler, a second portion of runtime code including one or more runtime alias checks for the minimum access and one or more runtime alias checks for the maximum access.

In some embodiments, the one or more runtime alias checks are based on one or more other base pointers in the code loop. In some embodiments, the steps include identifying, by the compiler, in the code loop, a first memory access group based on the base pointer and a second memory access group based on another base pointer, wherein the first memory access group and the second memory access group share a common memory access pattern; wherein generating the first portion of runtime code to determine the minimum access and the maximum access of the plurality of different memory addresses includes generating, by the compiler, the first portion of runtime code to determine the minimum access and the maximum access based on the common memory access pattern. In some embodiments, generating the first portion of runtime code to determine the minimum access and the maximum access of the plurality of different memory addresses includes generating, by the compiler, the first portion of runtime code to determine another minimum access for the other base pointer and another maximum access for the other base pointer based on the common memory access pattern; and generating the second portion of runtime code includes generating, by the compiler, the second portion of runtime code including one or more runtime alias checks for the other minimum access and one or more runtime alias checks for the other maximum access. In some embodiments, the steps include identifying, by the compiler, in the code loop, a first memory access group based on the base pointer and a second memory access group based on another base pointer, wherein the first memory access group and the second memory access group share a common memory access pattern; generating, by the compiler, a third portion of runtime code to determine another minimum access based on the minimum access and determine another maximum access based on the maximum access; wherein generating the second portion of runtime code includes generating, by the compiler, the second portion of runtime code including one or more runtime alias checks for the other minimum access and one or more runtime alias checks for the other maximum access. In some embodiments, the steps include determining, by the compiler, an estimated cost of the one or more runtime checks; and determining, by the compiler, that the estimated cost falls below a threshold; wherein generating the first portion of runtime code and generating the second portion of runtime code are performed in response to the estimated cost falling below the threshold.

Optimizing runtime alias checks in accordance with the present disclosure is generally implemented with computers, that is, with automated computing machinery. For further explanation, therefore, <FIG> sets forth a block diagram of automated computing machinery including an exemplary computer <NUM> configured for optimizing runtime alias checks according to certain embodiments. The computer <NUM> of <FIG> includes at least one computer processor <NUM> or 'CPU' as well as random access memory <NUM> ('RAM') which is connected through a high speed memory bus <NUM> and bus adapter <NUM> to processor <NUM> and to other components of the computer <NUM>.

Stored in RAM <NUM> is an operating system <NUM>. Operating systems useful in computers configured for optimizing runtime alias checks include UNIX™, Linux™, Microsoft Windows™, and others as will occur to those of skill in the art. The operating system <NUM> in the example of <FIG> is shown in RAM <NUM>, but many components of such software typically are stored in non-volatile memory also, such as, for example, on data storage <NUM>, such as a disk drive. Also stored in RAM is the compiler <NUM> for optimizing runtime alias checks.

The computer <NUM> of <FIG> includes disk drive adapter <NUM> coupled through expansion bus <NUM> and bus adapter <NUM> to processor <NUM> and other components of the computer <NUM>. Disk drive adapter <NUM> connects non-volatile data storage to the computer <NUM> in the form of data storage <NUM>. Disk drive adapters useful in computers configured for optimizing runtime alias checks include Integrated Drive Electronics ('IDE') adapters, Small computer System Interface ('SCSI') adapters, and others as will occur to those of skill in the art. In some embodiments, non-volatile computer memory is implemented for as an optical disk drive, electrically erasable programmable read-only memory (so-called 'EEPROM' or 'Flash' memory), RAM drives, and so on, as will occur to those of skill in the art.

The example computer <NUM> of <FIG> includes one or more input/output ('I/O') adapters <NUM>. I/O adapters implement user-oriented input/output through, for example, software drivers and computer hardware for controlling output to display devices such as computer display screens, as well as user input from user input devices <NUM> such as keyboards and mice. The example computer <NUM> of <FIG> includes a video adapter <NUM>, which is an example of an I/O adapter specially designed for graphic output to a display device <NUM> such as a display screen or computer monitor. Video adapter <NUM> is connected to processor <NUM> through a high speed video bus <NUM>, bus adapter <NUM>, and the front side bus <NUM>, which is also a high speed bus.

The exemplary computer <NUM> of <FIG> includes a communications adapter <NUM> for data communications with other computers and for data communications with a data communications network. Such data communications are carried out serially through RS-<NUM> connections, through external buses such as a Universal Serial Bus ('USB'), through data communications networks such as IP data communications networks, and in other ways as will occur to those of skill in the art. Communications adapters implement the hardware level of data communications through which one computer sends data communications to another computer, directly or through a data communications network. Examples of communications adapters useful in computers configured for optimizing runtime alias checks include modems for wired dial-up communications, Ethernet (IEEE <NUM>) adapters for wired data communications, and <NUM> adapters for wireless data communications.

For further explanation, <FIG> sets forth a flow chart illustrating an exemplary method, not according to the invention, for optimizing runtime alias checks that includes identifying <NUM>, by the compiler <NUM>, a base pointer and a plurality of different memory accesses based on the pointer in a code loop (e.g., a code loop in code <NUM> to be compiled by the compiler <NUM>). The code loop includes an iterating portion of code <NUM> (e.g., a "for" loop, a "while" loop, etc.). The base pointer is a symbolic reference to a pointer to a location in memory. For example, the base pointer corresponds to a declared variable in the code loop, or an attribute input to a function that includes the code loop.

The plurality of different memory accesses based on the base pointer are accesses to locations in memory using the base pointer or the base pointer and an offset. Where an offset is not used to access memory, and only the base pointer is used, the offset is considered to be NULL. Accordingly, where combinations of base pointers and offsets are discussed, it is assumed that such combinations include the base pointer itself (e.g., having a NULL offset). The subscript includes an loop induction variable and/or a combination of an loop induction variable and an offset. The loop induction variable includes a variable modified during iteration of the code loop. The offset includes a value to which the loop induction variable is added or subtracted to determine the particular memory location accessed during each iteration of the loop. A particular memory access is defined by its base pointer and its offset.

Example code <NUM> is presented below, hereinafter referred to as the "foo" example function:
<IMG>.

In the "foo" example function, "i" serves as the loop induction variable. The code loop includes base pointers "A," "X1," "X2," "X3," and "X4. " In the "foo" example function, the base pointer "A" serves as the basis for twelve different memory accesses during each iteration of the loop: A[P], A[Q], A[R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R]. Each memory access corresponds to a range of addresses accessed relative to the memory access during the loop. A range of a particular memory access is defined by its base pointer, its offset, and the range of memory accesses determined by the loop induction variable. For example, given a start value of "S" for "i" and an end value of "E" for "i," a range for memory access A[i + P] would start at A[S + P] and end at A[S + E].

The plurality of different memory accesses are read accesses and/or write accesses. The base pointer is identified as not being able to be determined at compile time. Thus, the specific memory addresses targeted by the plurality of different memory accesses are unable to be determined at compile time. Moreover, the base pointer is identified as one of a plurality of base pointers that are unable to be determined at compile time.

The method of <FIG> also includes generating <NUM> a first portion of runtime code <NUM> (e.g., machine-executable instructions) to determine a minimum access and a maximum access of the plurality of different memory accesses. Given that the plurality of different memory accesses are expressed as a base pointer, or a base pointer and an offset, the minimum access is a lowest memory access in a range of memory accesses and the maximum access is a highest memory access of the range of memory accesses.

In the "foo" example function, the base pointer "A" serves as the basis for twelve different memory accesses during each iteration of the loop: A[P], A[Q], A[R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R]. Accordingly, the minimum access "MIN_A" is determined as MIN(A[P], A[Q], A[R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R]) and the maximum access is determined as MAX(A[P], A[Q], A[R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R]). In other words, when executed, the first portion of runtime code <NUM> determines "MIN_A" and "MAX_A.

The method of <FIG> also includes generating <NUM> a second portion of runtime code <NUM> (e.g., machine-executable instructions) including one or more runtime alias checks for the minimum access and one or more runtime alias checks for the maximum access. Runtime alias checks are functions that determine whether a memory range for a given memory access (e.g., the range of memory accessed by the given memory access) conflicts with a memory range for another memory access. A conflict exists when a range for a write memory access overlaps with the range for another memory access (e.g., a read memory access or another write memory access). The runtime alias checks are included in executable code (e.g., the compiled code <NUM>) such that the runtime alias checks are performed when the executable code is executed.

In existing solutions, runtime alias checks are performed for each different memory access (e.g., each base pointer and offset combination) such that memory ranges for each write memory access are compared to memory access ranges every other memory access. In other words, assuming a grouping of memory accesses, ranges for each write access in the grouping of memory accesses are compared to ranges of every other memory access in the grouping. As the number of different memory access increases, the number of runtime alias checks also increases.

In contrast, the runtime code (e.g., the first portion of runtime code <NUM> and second portion of runtime code <NUM>) is generated such that, for a given base pointer associated with multiple memory accesses, only the minimum access and the maximum access are included in the grouping of memory accesses for the runtime alias checks. In other words, the runtime alias checks for the base pointer exclude memory access from the plurality of different memory accesses other than the minimum access and maximum access. Where the base pointer is a first base pointer and a second base pointer is included in the code loop and associated with multiple different memory accesses, the grouping from which runtime alias checks are generated would include the minimum and maximum accesses for the first base pointer and the minimum and maximum accesses for the second base pointer, etc..

Returning to the example of the "foo" function above, were runtime alias checks generated for each memory access as in existing solutions, the set of runtime alias checks would be as follows:.

In contrast, by excluding memory accesses based on the base pointer A other than the minimum and maximum access, the runtime alias checks are as follows:.

This provides for computational performance improvement by reducing the number of runtime alias checks required. In some embodiments, the compiler <NUM> applies loop optimizations (e.g., auto vectorization, loop versioning, loop distribution, loop load elimination, loop tiling, etc.) to the code loop which necessitate the runtime alias checks. In such an embodiment, the compiler <NUM> determines to apply the loop optimizations if the performance benefit provided by the loop optimization outweighs the performance cost of the runtime alias checks. By reducing the number of required runtime alias checks, loop optimizations are applied that would otherwise be rejected due to a greater number of required runtime alias checks.

In some embodiments, the first portion of runtime code <NUM> and second portion of runtime code <NUM> are included in a compiled version of the code <NUM> such that the generated runtime alias checks are executed when the compiled code is executed.

For further explanation, <FIG> sets forth a flow chart illustrating an exemplary method for optimizing runtime alias checks that includes identifying <NUM>, by a compiler <NUM>, a base pointer and a plurality of different memory accesses based on the pointer in a code loop; generating <NUM> a first portion of runtime code <NUM> to determine a minimum access and a maximum access of the plurality of different memory accesses; and generating <NUM> a second portion of runtime code <NUM> including one or more runtime alias checks for the minimum address and one or more runtime alias checks for the maximum address.

The method of <FIG> differs from <FIG> in that the method of <FIG> also includes identifying <NUM>, in the code loop, a first memory access group based on the first pointer and a second memory access group based on another base pointer, wherein the first memory access group and the second memory access group share a common memory access pattern. A memory access group for a given base pointer includes all memory accesses relative to that base pointer. A memory access pattern for a memory access group includes the set of subscripts (e.g., the offsets) for each of the memory accesses. Consider the following function, hereinafter referred to as the "foo2" example function:
<IMG>.

In the "foo2" example function, the memory access group for the base pointer A is (A[P], A[Q], A[R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R], A[<NUM>*P], A[<NUM>*Q], A[<NUM>*R]). The memory access pattern for the base pointer A is ([P], [Q], [R], [<NUM>*P], [<NUM>*Q], [<NUM>*R], [<NUM>*P], [<NUM>*Q], [<NUM>*R], [<NUM>*P], [<NUM>*Q], [<NUM>*R]). The "foo2" example function also includes a base pointer B sharing a same memory access pattern as A.

The method of <FIG> further differs from <FIG> in that generating <NUM> the first portion of runtime code <NUM> to determine the minimum access and the maximum access of the plurality of different memory addresses includes generating <NUM> the first portion of runtime code to determine the minimum access and the maximum access based on the common memory access pattem. For example, the first portion of runtime code <NUM> is generated to include instructions to identify, at runtime, a minimum and maximum value from the common memory access pattern. Continuing with the "foo2" example, such instructions are expressed as "MIN_Common = MIN(P, Q, R, <NUM>*P, <NUM>*Q, <NUM>*R, <NUM>*P, <NUM>*Q, <NUM>*R, <NUM>*P, <NUM>*Q, <NUM>*R), MAX_Common = MAX(P, Q, R, <NUM>*P, <NUM>*Q, <NUM>*R, <NUM>*P, <NUM>*Q, <NUM>*R, <NUM>*P, <NUM>*Q, <NUM>*R)" where MIN_Common is a minimum value in the common memory access pattern and MAX_Common is a maximum value in the common memory access pattern.

The minimum access value is then determined by incrementing the base pointer by the minimum value in the common memory access pattern, and the maximum access is determined by incrementing the base pointer by the maximum value in the common memory access pattern. Accordingly, the first portion of runtime code <NUM> is generated to include instructions to determine the minimum access at runtime by incrementing the base pointer by the minimum value in the common memory access pattern, and instructions to determine the maximum access by incrementing the base pointer by the maximum value in the common memory access pattern.

For further explanation, <FIG> sets forth a flow chart illustrating an exemplary method for optimizing runtime alias checks that includes identifying <NUM>, by a compiler <NUM>, a base pointer and a plurality of different memory accesses based on the pointer in a code loop; identifying <NUM>, in the code loop, a first memory access group based on the first pointer and a second memory access group based on another base pointer, wherein the first memory access group and the second memory access group share a common memory access pattern; generating <NUM> a first portion of runtime code <NUM> to determine a minimum access and a maximum access of the plurality of different memory accesses by generating <NUM> the first portion of runtime code to determine the minimum access and the second minimum access based on the common memory access pattern; and generating <NUM> a second portion of runtime code <NUM> including one or more runtime alias checks for the minimum address and one or more runtime alias checks for the maximum address.

The method of <FIG> differs from <FIG> in that generating <NUM> a first portion of runtime code <NUM> to determine a minimum access and a maximum access of the plurality of different memory accesses also includes generating <NUM> the first portion of runtime code <NUM> to determine the another minimum access and another maximum access for the other base pointer based on the common memory access pattern. For example, the first portion of runtime code <NUM> is generated to include instructions to find the minimum value of the common memory access pattern and the maximum value of the common memory access pattern. The first portion of runtime code <NUM> is then generated to determine minimum and maximum accesses for any base pointer sharing the common memory access pattern using the determined minimum value of the common memory access pattern and the maximum value of the common memory access pattern. Continuing with the "foo2" example function, the minimum access for the B base pointer is determined (e.g., by executing the first portion of runtime code <NUM>) by incrementing the B base pointer by the minimum value of the common memory access pattern and the maximum access is determined by incrementing the B base pointer by the maximum value of the common memory access pattern.

The method of <FIG> differs from <FIG> in that generating <NUM> a second portion of runtime code <NUM> including one or more runtime alias checks for the minimum access and one or more runtime alias checks for the maximum access includes generating <NUM> the second portion of runtime code <NUM> including one or more runtime alias checks for the other minimum access and one or more runtime alias checks for the other maximum access. Thus, the second portion of runtime code <NUM> includes runtime alias checks for the minimum and maximum accesses for the first base pointer and minimum and maximum accesses for the second base pointer.

The method of <FIG> differs from <FIG> in that the method of <FIG> also includes identifying <NUM>, in the code loop, a first memory access group based on the first pointer and a second memory access group based on another base pointer, wherein the first memory access group and the second memory access group share a common memory access pattern. The method of <FIG> further differs from <FIG> in that the method of <FIG> also includes generating <NUM> a third portion of runtime code to determine another minimum access (e.g., for the other base pointer) based on the minimum access (e.g., for the base pointer) and determine another maximum access (e.g., for the other base pointer) based on the maximum access (e.g., for the base pointer).

When the third portion of the runtime code <NUM> is executed, the minimum access and maximum access for the base pointer have been determined. As the other base pointer shares a minimum access pattern with the base pointer, the other minimum access for the other base pointer is determined (e.g., by executing the third portion of the runtime code <NUM>) by incrementing the other base pointer by the minimum access decremented by the base pointer. The other maximum access for the other base pointer is determined (e.g., by executing the third portion of the runtime code <NUM>) by incrementing the other base pointer by the maximum access decremented by the base pointer. Continuing with the "foo2" example function where base pointers A and B share a common memory access pattern, the minimum access for B "MIN_B" is determined as "MIN_B = B + MIN_A - A. " The maximum access for B "MAX_B" is determined as "MAX_B = B + MAX_A - A.

The method of <FIG> differs from <FIG> in that the method of <FIG> also includes determining <NUM> an estimated cost of the one or more runtime checks. For example, the estimated cost is expressed as a number of runtime checks or a number of instructions required to perform the runtime checks. The number of runtime checks or instructions required to perform the runtime checks is determined based on a number of memory accesses in the plurality of different memory accesses.

The method of <FIG> further differs from <FIG> in that the method of <FIG> also includes determining <NUM> that the estimated cost falls below a threshold. As an example, the threshold corresponds to an expected performance for applying one or more loop operations. Thus, the first portion of runtime code <NUM> and second portion of runtime code <NUM> are only generated when the cost falls below the threshold. Where the first portion of runtime code <NUM> and second portion of runtime code <NUM> are to be generated in response to applying one or more loop optimizations, the loop optimizations are only performed when the estimated cost falls below the threshold.

In view of the explanations set forth above, readers will recognize that the benefits of optimizing runtime alias checks according to embodiments of the present disclosure include:.

Exemplary embodiments of the present disclosure are described largely in the context of a fully functional computer system for optimizing runtime alias checks. Readers of skill in the art will recognize, however, that the present disclosure also can be embodied in a computer program product disposed upon computer readable storage media for use with any suitable data processing system. Such computer readable storage media can be any storage medium for machine-readable information, including magnetic media, optical media, or other suitable media. Examples of such media include magnetic disks in hard drives or diskettes, compact disks for optical drives, magnetic tape, and others as will occur to those of skill in the art. Persons skilled in the art will immediately recognize that any computer system having suitable programming means will be capable of executing the steps of the method of the disclosure as embodied in a computer program product. Persons skilled in the art will recognize also that, although some of the exemplary embodiments described in this specification are oriented to software installed and executing on computer hardware, nevertheless, alternative embodiments implemented as firmware or as hardware are well within the scope of the present disclosure.

The present disclosure can be a system, a method, and/or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure.

The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.

The network can include copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers.

Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein includes an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.

The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.

In this regard, each block in the flowchart or block diagrams can represent a module, segment, or portion of instructions, which includes one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block can occur out of the order noted in the figures.

Claim 1:
A method of optimizing runtime alias checks, the method comprising:
identifying (<NUM>), by a compiler (<NUM>), a plurality of different accesses to memory based on a base pointer in a code loop;
identifying (<NUM>), by the compiler in the code loop, a first memory access group based on the base pointer and a second memory access group based on a second base pointer, wherein the first memory access group and the second memory access group share a common memory access pattern;
generating (<NUM>), by the compiler, a first portion of runtime code (<NUM>) to determine a minimum access and a maximum access of the plurality of different accesses to the memory for the base pointer based on the common memory access pattern of the base pointer and the second base pointer in the code loop; and
generating (<NUM>), by the compiler, a second portion of the runtime code (<NUM>) including one or more runtime alias checks for the minimum and maximum accesses for the base pointer.