Caching run-time variables in optimized code
AssigneeMarvell International Ltd.
InventorsCheng-Hsueh A. Hsieh, Lei Jin, Liping Gao
Life of this patent
Estimating the term…
Abstract
In one embodiment, the present invention includes a method for emitting a live range statement into a program for a memory variable to be cached during run-time that has at least one simulation state variable if the memory variable is dynamically mapped, and defining the simulation state variable at a first execution path of the program. In such manner, the program may be optimized using the live range statement and the simulation state variable. Also, a debugger may use the simulation state variables in obtaining and displaying the memory variable from a cache.
Claims20
A computer-implemented compiler optimization method for generating an optimized program, the method comprising:
- generating an optimized code segment from a source code segment that accesses a variable having a variable-memory off-set, the optimized code segment allocating a virtual memory address to the variable, the virtual memory address mapping a memory address to a cache, the mapping linking the virtual memory address to execution dependent memory information that remains uncertain until program execution;
- inserting a live range statement corresponding to the variable into the optimized code segment, the live range statement including at least one simulation state variable for the execution dependent memory information;
- emitting one or more predicated expressions, accessible by a debugger, into the optimized code segment, each predicated expression including one or more simulation state variables;
- and
- generating an interface that allows the debugger to evaluate and use the simulation state variables to access the execution dependent memory information.
A computer-implemented compiler optimization method comprising:
- generating an optimized code segment from a source code segment that accesses a variable having a variable-memory off-set, the optimized code segment allocating a virtual memory address to the variable, the virtual memory address mapping a memory address to a cache, the mapping linking the virtual memory address to execution dependent memory information that remains uncertain until program execution;
- caching the variable based on the virtual memory address mapping;
- maintaining a live range table for the cached variable the live range table including at least a value for a simulation state variable corresponding to the cached variable, the simulation state variable being defined to certain values with regard to execution of the program;
- updating the simulation state variable corresponding to the cached variable at a preselected execution location of the program;
- and
- updating the live range table at the preselected location.
A computer-readable storage medium containing instructions that if executed enable a system to:
- generate an optimized code segment from a source code segment that accesses a variable having a variable-memory off-set, the optimized code segment allocating a virtual memory address to the variable, the virtual memory address mapping a memory address to a cache, the mapping linking the virtual memory address to execution dependent memory information that remains uncertain until program execution;
- insert a live range statement corresponding to the variable into the optimized code segment, the live range statement including at least one simulation state variable for the execution dependent memory information;
- emit one or more predicated expressions, accessible by a debugger, into the optimized code segment, each predicated expression including one or more simulation state variables;
- and
- generate an interface that allows the debugger to evaluate and use the simulation state variables to access the execution dependent memory information.
A system comprising:
- a processor;
- and
- a dynamic random access memory coupled to the processor including instructions that if executed enable the system to:
- generate an optimized code segment from a source code segment that accesses a variable having a variable-memory off-set, the optimized code segment allocating a virtual memory address to the variable, the virtual memory address mapping a memory address to a cache, the mapping linking the virtual memory address to execution dependent memory information that remains uncertain until program execution,
- insert a live range statement corresponding to the variable into the optimized code segment, the live range statement including at least one simulation state variable for the execution dependent memory information,
- emit one or more predicated expressions, accessible by a debugger, into the optimized code segment, each predicated expression including one or more simulation state variables, and
- generate an interface that allows the debugger to evaluate and use the simulation state variables to access the execution dependent memory information.
Dependencies are inferred from the claim text.