US7904893B2 - Power and/or energy optimized compile/execution - Google Patents

Power and/or energy optimized compile/execution Download PDF

Info

Publication number
US7904893B2
US7904893B2 US10/802,586 US80258604A US7904893B2 US 7904893 B2 US7904893 B2 US 7904893B2 US 80258604 A US80258604 A US 80258604A US 7904893 B2 US7904893 B2 US 7904893B2
Authority
US
United States
Prior art keywords
native instructions
execution
object code
initial number
instructions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active, expires
Application number
US10/802,586
Other versions
US20050229149A1 (en
Inventor
Joel D. Munter
Murthi Nanja
Jin J. Xu
Zhiguo Gao
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Marvell Asia Pte Ltd
Original Assignee
Marvell International Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Marvell International Ltd filed Critical Marvell International Ltd
Priority to US10/802,586 priority Critical patent/US7904893B2/en
Assigned to INTEL CORPORATION reassignment INTEL CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: GAO, ZHIGUO, NANJA, MURTHI, XU, JIN J., MUNTER, JOEL D.
Publication of US20050229149A1 publication Critical patent/US20050229149A1/en
Assigned to MARVELL INTERNATIONAL LTD. reassignment MARVELL INTERNATIONAL LTD. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: INTEL CORPORATION
Application granted granted Critical
Publication of US7904893B2 publication Critical patent/US7904893B2/en
Assigned to CAVIUM INTERNATIONAL reassignment CAVIUM INTERNATIONAL ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: MARVELL INTERNATIONAL LTD.
Assigned to MARVELL ASIA PTE, LTD. reassignment MARVELL ASIA PTE, LTD. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: CAVIUM INTERNATIONAL
Active legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation

Definitions

  • the present invention relates generally to the fields of data processing and data communication.
  • Programming language compilers often include optimizers to improve the execution performance of the generated object code (also referred to as executable code or executables).
  • the optimizations performed may include, for examples, removal of not executed codes (“dead code”) to reduce the overall code size, loop unrolling for parallel execution to improve execution speed, and so forth.
  • the current state of just-in-time compilation has at least two disadvantages. First of all, it does not optimize for power level nor energy requirement of the wireless mobile devices. Secondly, the unconditional compilation of all received codes may be power and/or energy inefficient.
  • FIG. 1 illustrates a block diagram view of a computing environment, in accordance with an embodiment of the present invention
  • FIG. 2 illustrates a flow chart view of portions of the operational flow of the compiler of FIG. 1 in accordance with one embodiment
  • FIG. 3 illustrates a block diagram view of another computing environment, in accordance with another embodiment of the present invention.
  • FIG. 4 illustrates a flow chart view of portions of the operational flow of the runtime manager of FIG. 3 in accordance with one embodiment.
  • Illustrative embodiments of the present invention include but are not limited to a compiler with power and/or energy optimization, a complementary runtime manager, and a wireless mobile device having the compiler and/or the runtime manager.
  • example computing environment 100 includes processor 102 and memory 104 coupled to each other via bus 106 as shown.
  • Memory 104 includes compiler 112 , which includes an optimizer equipped to optimize the object code 124 generated for an application module 122 to improve at least the power level requirement or the energy requirement for executing the object code 124 in a target execution environment.
  • the target execution environment may be computing environment 100 itself or another computing environment.
  • application modules 122 may be provided to compiler 112 in a source form, e.g., Java, C#, or other languages of the like. In other embodiments, application modules 122 may be provided to compiler 112 in an intermediate form, e.g., a byte code form. In yet other embodiments, application modules 122 may be provided to compiler 112 in either form. Whether in source form or intermediate form, instructions of application modules 122 are “high level” instructions. In other words, they are non-native instructions of the target execution environment. The compilation generates object codes 124 comprised of native instructions of the target execution environment.
  • native instructions refers to instructions of the instruction set supported by the processor of the target execution environment.
  • the compilation includes optimization for the power level requirement and/or energy requirement for executing generated object codes 124 in the target execution environment.
  • the term “power level requirement” refers to the highest power level required to execute a sequence of native instructions, which is typically the highest power level required by certain hardware circuitry to execute one or more of the native instructions of the code sequence.
  • the power level required to execute a sequence of instructions affects the thermal dissipation of the target execution environment, as well as the life of the battery power source of the target execution environment (if it is powered by a battery power source).
  • the term “energy requirement” refers to the amount of energy consumed to execute the sequence of native instructions in the target execution environment. Similarly, the energy required to execute a sequence of instructions also affects the life of the battery power source of the target execution environment (if it is powered by a battery power source).
  • compiler 112 optimizes generated object code 124 to improve at least the power level required to execute the generated object code 124 . In other embodiments, compiler 112 optimizes generated object code 124 to improve at least the energy required to execute the generated object code 124 . In yet other embodiments, compiler 112 optimizes generated object code 124 to improve at least the power level required as well as the energy required to execute the generated object code 124 .
  • compiler 112 optimizes object code 124 in accordance with power and/or energy profiles 114 .
  • power and/or energy profiles 114 comprise power and/or energy profiles of the native instructions of the target execution environment.
  • the native instructions of the target execution environment includes an ADD instruction, a SUBTRACT instruction, a MUTIPLY instruction, and so forth
  • power and/or energy profiles 114 include the power level required and/or the energy required to execute the ADD instruction, the SUBTRACT instruction, the MUTIPLY instruction, and so forth, respectively.
  • Profiles 114 for a target execution environment may be empirically determined, and then provided to computing environment 100 .
  • compiler 112 may be any one of a number of compilers known in the art or to be designed, including but are not limited to Java compiler, C# compiler, or a just-in-time (JIT) compiler.
  • Application modules 122 may implement applications of any kind.
  • processor 102 , memory 104 , and bus 106 perform their conventional functions, and may be any one of a wide range of these elements known in the art or to be designed.
  • the present invention may also be practiced in other computing environments with more or less hardware elements.
  • FIG. 2 illustrates a flow chart view of portions of the optimization operational flow of compiler 112 .
  • the optimizer portion of compiler 112 retrieves a sequence of instructions (also referred to as a code segment) for analysis, block 202 .
  • the manner in which compiler 112 selects a code segment for analysis is language and application dependent. That is, for a language that supports certain language syntax for programming loops, on encounter of the start of a loop, compiler 112 may look for the end of the loop, and analyze the loop as a code segment.
  • compiler 112 may look ahead for a predetermined number of instructions, and analyze them as a code segment to determine if some of the instructions can be combined and replaced with other instructions that improve on one or more performance factors (e.g., size, execution speed, and so forth), and yet provide the same functional result(s).
  • performance factors e.g., size, execution speed, and so forth
  • the optimizer of compiler 112 analyzes the code segment for execution power level requirement, block 204 . As described earlier, in various embodiments, the analysis is performed in view of power profile 114 . In the course of analysis, the optimizer of compiler 112 determines if an alternative code segment with lower execution power level requirement is available, block 206 . If the determination is affirmative, the optimizer of compiler 112 replaces the code segment with the alternative code segment with lower execution power level requirement, block 208 .
  • the optimizer of compiler 112 proceeds to analyze the code segment of execution energy requirement, block 210 . As described earlier, in various embodiments, the analysis is performed in view of energy profile 114 . In the course of analysis, the optimizer of compiler 112 determines if an alternative code segment with lower execution energy requirement is available, block 212 . If the determination is affirmative, the optimizer of compiler 112 replaces the code segment with the alternative code segment with lower execution energy requirement, block 214 .
  • the optimizer of compiler 112 proceeds to analyze the code segment for other optimization opportunities, block 216 .
  • FIG. 3 illustrates a block diagram view of another example computing environment, in accordance with another embodiment of the present invention.
  • computing environment 300 includes processor 302 , memory 304 coupled to each other via bus 306 .
  • computing environment 300 also includes communication interface 308 coupled to the earlier described elements as shown.
  • Memory 304 in addition to compiler 312 , power and/or energy profiles 314 , application module 322 and object codes 324 (which are corresponding to compiler 112 , power and/or energy profiles 114 , application module 122 , and object codes 124 ), also includes interpreter 316 and runtime manager 318 , coupled to earlier described elements as shown.
  • Interpreter 316 is employed to interpretively execute application modules 322 . In various embodiments, interpreter 316 is equipped to interpretively execute application modules 322 in an intermediate form. In other embodiments, interpreter 316 is equipped to interpretively execute application modules 322 in source form. In yet other embodiments, interpreter 316 is equipped to interpretively execute application modules 322 in either source or an intermediate form.
  • runtime manager 318 is used to immediately invoke interpreter 316 to interpretively execute a received application module 322 for at least an initial number of times, before invoking compiler 312 to compile application modules 322 , including optimizing generated code 324 to improve execution power level requirement and/or execution energy requirement in computing environment 300 .
  • the practice provides the advantage of increasing the likelihood in achieving a net saving in power level and/or energy, notwithstanding the power level and/or energy investments required to perform the compilation.
  • computing environment 100 may further include sensors for sensing power level and/or energy consumption, and system services for reporting the sensing data collected.
  • runtime manager 318 may be further equipped to conditionally monitor the execution of object code 324 for the power level and/or energy requirements of the various native instructions, and update profiles 314 with the observed power level and/or energy requirement. The conditional monitoring and updating may be performed based at least in part on whether a hardware/software switch is set or not. Provision of the hardware/software switch, and its setting may be provided and facilitated in any one of a number of known or to be designed manners.
  • the initial number of times a received application module is to be executed before compilation is statically configured for runtime manager 318 .
  • runtime manager 318 may be further equipped to dynamically determine the initial number of times a received application is to be executed before compiling the application.
  • Runtime manager 318 may be equipped to make the determination based at least in part on the power level required and/or energy required to perform an “average” compile. Typically (though not necessarily), the higher power level or the more energy required to perform an “average” compile, the more times a received application module will be interpretively executed before being compiled. Runtime manager 318 may also make the decision further based on the size of the received application module 322 . Similarly (though not necessarily), the larger the received application module (implying more energy is required to perform a compile), the more times a received application module will be interpretively executed before being compiled.
  • runtime manager 318 may be further equipped to conditionally monitor the compilation of application modules 322 for the power level and/or energy required to perform an “average” compile, and update the number of initial executions to be performed before compilation accordingly, based at least in part on the results of the monitoring. Similarly, the conditional monitoring and updating may be performed based at least in part on whether a hardware/software switch is set or not. Again, provision of the hardware/software switch, and its setting may be provided and facilitated in any one of a number of known or to be designed manners.
  • communication interface 308 is a wireless communication interface
  • computing environment 300 is a wireless mobile device, such as a wireless mobile phone or a wireless personal digital assistant.
  • FIG. 4 illustrates a flow chart view of portions of the operational flow of runtime manager 318 , in accordance with one embodiment.
  • the embodiment assumes the computing environment is equipped with the proper sensor hardware and sensed data reporting services.
  • runtime manager 318 on receipt of an application module 322 , runtime manager 318 first determines a number of times (N) interpreter 316 should be used to interpretively execute the received application module 322 before compilation, block 402 . On determination (and assuming N is non-zero), runtime manger 318 invokes interpreter 316 to interpretively execute the received application module 322 for up to N times, block 404 .
  • N number of times
  • runtime manager 318 monitors the execution. If indeed the received application module 322 has been executed up to N times, runtime manager 318 invokes compiler 312 to compile the received application module 322 into object code 324 , including optimizing object code 324 to improve at least execution power level requirement or execution energy requirement, block 406 . In various embodiments, as described earlier, on invocation of compiler 312 , runtime manager 318 may monitor the compilation for the power level and/or energy required to perform an “average” compile, and update the profile accordingly, if a hardware/software switch is set.
  • runtime manager 318 allows object code 324 to be executed for as long as it is needed, block 408 .
  • runtime manager 318 conditionally monitors the execution of the object code 318 for at least part of the time, and updates the profiles accordingly, blocks 410 - 412 , if a hardware/software switch is set.

Abstract

A compiler with power and/or energy optimization, a complementary runtime manager, and system having the compiler and/or the runtime manager are described herein.

Description

FIELD OF THE INVENTION
The present invention relates generally to the fields of data processing and data communication.
BACKGROUND OF THE INVENTION
Programming language compilers often include optimizers to improve the execution performance of the generated object code (also referred to as executable code or executables). The optimizations performed may include, for examples, removal of not executed codes (“dead code”) to reduce the overall code size, loop unrolling for parallel execution to improve execution speed, and so forth.
In recent years, advances in microprocessor and related technologies have led to the development and availability of a wide range of wireless mobile devices, such as wireless mobile phones, personal digital assistants, and so forth. Concurrently, various software technologies, such as just-in-time compilation, and so forth, have been developed to facilitate cross platform application development.
The current state of just-in-time compilation has at least two disadvantages. First of all, it does not optimize for power level nor energy requirement of the wireless mobile devices. Secondly, the unconditional compilation of all received codes may be power and/or energy inefficient.
BRIEF DESCRIPTION OF THE DRAWINGS
The present invention will be described by way of exemplary embodiments, but not limitations, illustrated in the accompanying drawings in which like references denote similar elements, and in which:
FIG. 1 illustrates a block diagram view of a computing environment, in accordance with an embodiment of the present invention;
FIG. 2 illustrates a flow chart view of portions of the operational flow of the compiler of FIG. 1 in accordance with one embodiment;
FIG. 3 illustrates a block diagram view of another computing environment, in accordance with another embodiment of the present invention; and
FIG. 4 illustrates a flow chart view of portions of the operational flow of the runtime manager of FIG. 3 in accordance with one embodiment.
DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS
Illustrative embodiments of the present invention include but are not limited to a compiler with power and/or energy optimization, a complementary runtime manager, and a wireless mobile device having the compiler and/or the runtime manager.
Various aspects of the illustrative embodiments will be described using terms commonly employed by those skilled in the art to convey the substance of their work to others skilled in the art. However, it will be apparent to those skilled in the art that the present invention may be practiced with only some of the described aspects. For purposes of explanation, specific numbers, materials, and configurations are set forth in order to provide a thorough understanding of the illustrative embodiments. However, it will be apparent to one skilled in the art that the present invention may be practiced without the specific details. In other instances, well-known features are omitted or simplified in order not to obscure the illustrative embodiments.
Further, various operations will be described as multiple discrete operations, in turn, in a manner that is most helpful in understanding the present invention; however, the order of description should not be construed as to imply that these operations are necessarily order dependent. In particular, these operations need not be performed in the order of presentation.
The phrase “in one embodiment” is used repeatedly. The phrase generally does not refer to the same embodiment; however, it may. The terms “comprising”, “having”, and “including” are synonymous, unless the context dictates otherwise.
Referring now to FIG. 1, wherein a block diagram view of an example computing environment, in accordance with one embodiment, is shown. As illustrated, example computing environment 100 includes processor 102 and memory 104 coupled to each other via bus 106 as shown. Memory 104 includes compiler 112, which includes an optimizer equipped to optimize the object code 124 generated for an application module 122 to improve at least the power level requirement or the energy requirement for executing the object code 124 in a target execution environment. The target execution environment may be computing environment 100 itself or another computing environment.
In various embodiments, application modules 122 may be provided to compiler 112 in a source form, e.g., Java, C#, or other languages of the like. In other embodiments, application modules 122 may be provided to compiler 112 in an intermediate form, e.g., a byte code form. In yet other embodiments, application modules 122 may be provided to compiler 112 in either form. Whether in source form or intermediate form, instructions of application modules 122 are “high level” instructions. In other words, they are non-native instructions of the target execution environment. The compilation generates object codes 124 comprised of native instructions of the target execution environment. The term “native instructions” as used herein refers to instructions of the instruction set supported by the processor of the target execution environment.
As described earlier, the compilation includes optimization for the power level requirement and/or energy requirement for executing generated object codes 124 in the target execution environment. For the purpose of this application, the term “power level requirement” refers to the highest power level required to execute a sequence of native instructions, which is typically the highest power level required by certain hardware circuitry to execute one or more of the native instructions of the code sequence. The power level required to execute a sequence of instructions affects the thermal dissipation of the target execution environment, as well as the life of the battery power source of the target execution environment (if it is powered by a battery power source). The term “energy requirement” refers to the amount of energy consumed to execute the sequence of native instructions in the target execution environment. Similarly, the energy required to execute a sequence of instructions also affects the life of the battery power source of the target execution environment (if it is powered by a battery power source).
In various embodiments, compiler 112 optimizes generated object code 124 to improve at least the power level required to execute the generated object code 124. In other embodiments, compiler 112 optimizes generated object code 124 to improve at least the energy required to execute the generated object code 124. In yet other embodiments, compiler 112 optimizes generated object code 124 to improve at least the power level required as well as the energy required to execute the generated object code 124.
In various embodiments, compiler 112 optimizes object code 124 in accordance with power and/or energy profiles 114. More specifically, in various embodiments, power and/or energy profiles 114 comprise power and/or energy profiles of the native instructions of the target execution environment. For example, in one embodiment, if the native instructions of the target execution environment includes an ADD instruction, a SUBTRACT instruction, a MUTIPLY instruction, and so forth, power and/or energy profiles 114 include the power level required and/or the energy required to execute the ADD instruction, the SUBTRACT instruction, the MUTIPLY instruction, and so forth, respectively. Profiles 114 for a target execution environment may be empirically determined, and then provided to computing environment 100.
Except for the teachings of the present invention, compiler 112 may be any one of a number of compilers known in the art or to be designed, including but are not limited to Java compiler, C# compiler, or a just-in-time (JIT) compiler. Application modules 122 may implement applications of any kind. Similarly, processor 102, memory 104, and bus 106 perform their conventional functions, and may be any one of a wide range of these elements known in the art or to be designed. The present invention may also be practiced in other computing environments with more or less hardware elements.
FIG. 2 illustrates a flow chart view of portions of the optimization operational flow of compiler 112. As illustrated, upon given execution control, the optimizer portion of compiler 112 retrieves a sequence of instructions (also referred to as a code segment) for analysis, block 202. The manner in which compiler 112 selects a code segment for analysis is language and application dependent. That is, for a language that supports certain language syntax for programming loops, on encounter of the start of a loop, compiler 112 may look for the end of the loop, and analyze the loop as a code segment. For a language that supports ADD and ACCUMULATE, on encounter of an ADD instruction, compiler 112 may look ahead for a predetermined number of instructions, and analyze them as a code segment to determine if some of the instructions can be combined and replaced with other instructions that improve on one or more performance factors (e.g., size, execution speed, and so forth), and yet provide the same functional result(s).
Still referring to FIG. 2, on retrieval of a code segment, for the embodiment, the optimizer of compiler 112 analyzes the code segment for execution power level requirement, block 204. As described earlier, in various embodiments, the analysis is performed in view of power profile 114. In the course of analysis, the optimizer of compiler 112 determines if an alternative code segment with lower execution power level requirement is available, block 206. If the determination is affirmative, the optimizer of compiler 112 replaces the code segment with the alternative code segment with lower execution power level requirement, block 208.
On determination that no replacement code segment is available, block 206, or on replacement, block 208, for the embodiment, the optimizer of compiler 112 proceeds to analyze the code segment of execution energy requirement, block 210. As described earlier, in various embodiments, the analysis is performed in view of energy profile 114. In the course of analysis, the optimizer of compiler 112 determines if an alternative code segment with lower execution energy requirement is available, block 212. If the determination is affirmative, the optimizer of compiler 112 replaces the code segment with the alternative code segment with lower execution energy requirement, block 214.
On determination that no replacement code segment is available, block 212, or on replacement, block 214, the optimizer of compiler 112 proceeds to analyze the code segment for other optimization opportunities, block 216.
While for ease of understanding, the sequence of optimizations has been orderly described with power level optimization first, followed by energy optimization, and other conventional optimizations, in alternate embodiments, other optimization orders may be practiced. For examples, energy optimization and/or other conventional optimization may be performed before power level optimization.
FIG. 3 illustrates a block diagram view of another example computing environment, in accordance with another embodiment of the present invention. As illustrated, similar to computing environment 100, computing environment 300 includes processor 302, memory 304 coupled to each other via bus 306. Further, computing environment 300 also includes communication interface 308 coupled to the earlier described elements as shown. Memory 304, in addition to compiler 312, power and/or energy profiles 314, application module 322 and object codes 324 (which are corresponding to compiler 112, power and/or energy profiles 114, application module 122, and object codes 124), also includes interpreter 316 and runtime manager 318, coupled to earlier described elements as shown.
Interpreter 316 is employed to interpretively execute application modules 322. In various embodiments, interpreter 316 is equipped to interpretively execute application modules 322 in an intermediate form. In other embodiments, interpreter 316 is equipped to interpretively execute application modules 322 in source form. In yet other embodiments, interpreter 316 is equipped to interpretively execute application modules 322 in either source or an intermediate form.
In any event, to further optimize power usage and energy consumption in computing environment 300, runtime manager 318 is used to immediately invoke interpreter 316 to interpretively execute a received application module 322 for at least an initial number of times, before invoking compiler 312 to compile application modules 322, including optimizing generated code 324 to improve execution power level requirement and/or execution energy requirement in computing environment 300.
The practice provides the advantage of increasing the likelihood in achieving a net saving in power level and/or energy, notwithstanding the power level and/or energy investments required to perform the compilation.
In various embodiments, computing environment 100 may further include sensors for sensing power level and/or energy consumption, and system services for reporting the sensing data collected. For these embodiments, runtime manager 318 may be further equipped to conditionally monitor the execution of object code 324 for the power level and/or energy requirements of the various native instructions, and update profiles 314 with the observed power level and/or energy requirement. The conditional monitoring and updating may be performed based at least in part on whether a hardware/software switch is set or not. Provision of the hardware/software switch, and its setting may be provided and facilitated in any one of a number of known or to be designed manners.
In various embodiments, the initial number of times a received application module is to be executed before compilation is statically configured for runtime manager 318. In other embodiments, runtime manager 318 may be further equipped to dynamically determine the initial number of times a received application is to be executed before compiling the application. Runtime manager 318 may be equipped to make the determination based at least in part on the power level required and/or energy required to perform an “average” compile. Typically (though not necessarily), the higher power level or the more energy required to perform an “average” compile, the more times a received application module will be interpretively executed before being compiled. Runtime manager 318 may also make the decision further based on the size of the received application module 322. Similarly (though not necessarily), the larger the received application module (implying more energy is required to perform a compile), the more times a received application module will be interpretively executed before being compiled.
In some of these embodiments, runtime manager 318 may be further equipped to conditionally monitor the compilation of application modules 322 for the power level and/or energy required to perform an “average” compile, and update the number of initial executions to be performed before compilation accordingly, based at least in part on the results of the monitoring. Similarly, the conditional monitoring and updating may be performed based at least in part on whether a hardware/software switch is set or not. Again, provision of the hardware/software switch, and its setting may be provided and facilitated in any one of a number of known or to be designed manners.
In various embodiments, communication interface 308 is a wireless communication interface, and computing environment 300 is a wireless mobile device, such as a wireless mobile phone or a wireless personal digital assistant.
FIG. 4 illustrates a flow chart view of portions of the operational flow of runtime manager 318, in accordance with one embodiment. The embodiment assumes the computing environment is equipped with the proper sensor hardware and sensed data reporting services. As illustrated, for the embodiment, on receipt of an application module 322, runtime manager 318 first determines a number of times (N) interpreter 316 should be used to interpretively execute the received application module 322 before compilation, block 402. On determination (and assuming N is non-zero), runtime manger 318 invokes interpreter 316 to interpretively execute the received application module 322 for up to N times, block 404.
During this period, runtime manager 318 monitors the execution. If indeed the received application module 322 has been executed up to N times, runtime manager 318 invokes compiler 312 to compile the received application module 322 into object code 324, including optimizing object code 324 to improve at least execution power level requirement or execution energy requirement, block 406. In various embodiments, as described earlier, on invocation of compiler 312, runtime manager 318 may monitor the compilation for the power level and/or energy required to perform an “average” compile, and update the profile accordingly, if a hardware/software switch is set.
Thereafter, runtime manager 318 allows object code 324 to be executed for as long as it is needed, block 408. For the embodiment, at the same time, runtime manager 318 conditionally monitors the execution of the object code 318 for at least part of the time, and updates the profiles accordingly, blocks 410-412, if a hardware/software switch is set.
Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that a wide variety of alternate and/or equivalent implementations may be substituted for the specific embodiments shown and described, without departing from the scope of the present invention. This application is intended to cover any adaptations or variations of the embodiments discussed herein. Therefore, it is manifestly intended that this invention be limited only by the claims and the equivalents thereof.

Claims (28)

1. A method comprising:
receiving a plurality of non-native instructions in a selected one of a source form and an intermediate form;
determining an initial number of times to interpretively execute the plurality of non-native instructions;
interpretively executing the plurality of non-native instructions the initial number of times;
monitoring execution of the plurality of non-native instructions to determine when the plurality of non-native instructions have been interpretively executed the initial number of times;
compiling the plurality of non-native instructions to generate object code for the non-native instructions only after interpretively executing the plurality of non-native instructions the initial number of times, wherein compiling the plurality of non-native instructions includes replacing an object code segment from the generated object code with an alternative object code segment if the alternative object code segment improves at least a selected one of an execution power level required and an execution energy level required to execute the generated object code in a target execution environment.
2. The method of claim 1, wherein said receiving comprises receiving the non-native instructions in a byte code form.
3. The method of claim 1, wherein said compiling comprises analyzing the object code segment for execution power level requirement, and determining whether an alternative object code segment with lower execution power level requirement is available.
4. The method of claim 1, wherein said compiling comprises analyzing the object code segment for execution energy consumption, and determining whether an alternative object code segment with lower execution energy consumption is available.
5. The method of claim 1, wherein the method further comprises
monitoring said compiling for power level required to perform compilation;
updating a current understanding of power level required for compilation; and
updating the initial number of times the plurality of non-native instructions are to be interpretively executed before compiling the received non-native instructions, if said monitoring observes a power level required for compilation to be different from the current understanding.
6. The method of claim 1, wherein the method further comprises
monitoring said compiling for amount of energy required to perform an average compilation;
updating a current understanding of amount of energy required for an average compilation; and
updating the initial number of times the plurality of non-native instructions are to be interpretively executed before compiling the received non-native instructions, if said monitoring observes an amount of energy required for compilation to be different from the current understanding.
7. The method of claim 1, wherein the generated object code comprises a plurality of native instructions, and the method further comprises
monitoring execution of the generated object code for power level required to execute the native instructions; and
updating power level requirements of selected ones of the native instructions if said monitoring observes power level requirements for the selected ones of the native instructions to be different from current understandings of the power level requirements of the selected ones of the native instructions.
8. The method of claim 1, wherein the generated object code comprises a plurality of native instructions, and the method further comprises
monitoring execution of the generated object code for amount of energy required to execute the native instructions; and
updating energy requirements of selected ones of the native instructions if said monitoring observes energy requirements for the selected ones of the native instructions to be different from current understandings of the energy requirements of the selected ones of the native instructions.
9. In an electronic device, a method of operation, comprising:
receiving a plurality of non-native instructions;
determining an initial number of times to interpretively execute the non-native instructions based at least in part on one or more of an expected power level required to perform a compile or an expected energy required to perform the compile;
executing the non-native instructions for the initial number of times using an interpreter;
monitoring execution of the non-native instructions to determine when the non-native instructions have been executed the initial number of times using the interpreter; and
compiling the non-native instructions into object code only after executing the received non-native instructions for said initial number of times using the interpreter.
10. The method of claim 9, wherein the method further comprises monitoring said compiling for a compilation requirement employed in determining the initial number of times the received non-native instructions are to be executed using the interpreter before compiling; and
updating a current understanding of the compilation requirement if said monitoring observes the compilation requirement to be different from the current understanding.
11. The method of claim 9, wherein the generated object code comprises a plurality of native instructions, and the method further comprises monitoring execution of the generated object code for execution requirements of the native instructions; and
updating execution requirements of selected ones of the native instructions if said monitoring observes execution requirements for the selected ones of the native instructions to be different from current understandings of the execution requirements of the selected ones of the native instructions.
12. The method of claim 9, wherein determining the initial number of times to interpretively execute the non-native instructions is based at least in part on a size of the non-native instructions.
13. An article of manufacture comprising:
a computer readable medium; and
a plurality of instructions designed to implement a compiler to:
determine an initial number of times to interpretively execute a plurality of non-native instructions;
interpretively execute the plurality of non-native instructions the initial number of times;
monitor execution of the non-native instructions to determine when the non-native instructions have been interpretively executed the initial number of times;
compile the non-native instructions to generate object code for the non-native instructions only after interpretively executing the plurality of non-native instructions the initial number of times, and
replace a segment of the generated object code with an alternative object code segment if the alternative object code segment improves at least a selected one of an execution power level required and an execution energy required to execute the generated object code in a target execution environment.
14. The article of claim 13, wherein said compiler analyzes the object code segment for execution power level requirement, and determines whether the alternative object code segment with lower execution power level requirement is available.
15. The article of claim 13, wherein said compiler analyzes the object code segment for execution energy consumption, and determines whether the alternative object code segment with lower execution energy consumption is available.
16. An article of manufacture comprising:
a computer readable medium; and
a plurality of instructions designed to implement a runtime manager equipped to:
receive a plurality of non-native instructions,
determine an initial number of times to interpretively execute the non-native instructions, the initial number of times based at least in pat on one or more of an expected power level required to perform an average compile or an expected energy required to perform the average compile,
execute the non-native instructions for said initial number of times using an interpreter,
monitor execution of the non-native instructions to determine when the non-native instructions have been interpretively executed the initial number of times, and
invoke a compiler to compile the non-native instructions into object code only after executing the received non-native instructions for said initial number of times using the interpreter.
17. The article of claim 16, wherein the runtime manager is further equipped to monitor said compiling for a compilation requirement employed in determining the initial number of times received non-native instructions are to be executed before compiling; and
update a current understanding of the compilation requirement if said monitoring observes the compilation requirement to be different from the current understanding.
18. The article of claim 16, wherein the generated object code comprises a plurality of native instructions, and the runtime manager is further equipped to monitor execution of the generated object code for execution requirements of the native instructions; and
update execution requirements of selected ones of the native instructions if said monitoring observes execution requirements for the selected ones of the native instructions to be different from current understandings of the execution requirements of the selected ones of the native instructions.
19. The article of claim 16, wherein the runtime manager is further equipped to determine the initial number of times to interpretively execute the non-native instructions based at least in part on a size of the non-native instructions.
20. A system, comprising:
a storage medium having stored therein a plurality of instructions implementing a compiler to:
receive a plurality of non-native instructions in a selected one of a source form and an intermediate form,
determine an initial number of times to interpretively execute the plurality of non-native instructions;
interpretively execute the plurality of non-native instructions the initial number of times,
monitor execution of the non-native instructions to determine when the non-native instructions have been interpretively executed the initial number of times,
compile the non-native instructions to generate object code for the non-native instructions only after interpretively executing the plurality of non-native instructions the initial number of times, and
replace a segment of the generated object code with an alternative object code segment if the alternative object code segment improves at least a selected one of an execution power level required and an execution energy required to execute the generated object code in a target execution environment; and
a processor coupled to the storage medium to execute the instructions implementing the compiler.
21. The system of claim 20, wherein said compiler analyzes the object code segment for execution power level requirement, and determines whether an alternative object code segment with lower execution power level requirement is available.
22. The system of claim 20, wherein said compiler analyzes the object code segment for execution energy consumption, and determines whether an alternative object code segment with lower execution energy consumption is available.
23. The system of claim 20, wherein the apparatus further comprises a wireless communication interface to receive the non-native instructions.
24. A system, comprising:
a communication interface to receive a plurality of non-native instructions;
a storage medium coupled to the communication interface, and having stored therein a plurality of instructions designed to implement a runtime manager equipped to:
determine an initial number of times to interpretively execute the non-native instructions, the initial number of times based at least in part on one or more of an expected power level required to perform an average compile or an expected energy required to perform the average compile,
execute the received non-native instructions for the initial number of times using an interpreter,
monitor execution of the non-native instructions to determine when the non-native instructions have been interpretively executed the initial number of times, and
invoke a compiler to compile the non-native instructions into object code only after executing the received non-native instructions for said initial number of times using the interpreter; and
a processor coupled to the storage medium to execute the instructions implementing the runtime manager.
25. The system of claim 24, wherein the runtime manager is further equipped to monitor said compiling for a compilation requirement employed in determining the initial number of times received non-native instructions are to be executed using the interpreter before compiling; and
update a current understanding of the compilation requirement if said monitoring observes the compilation requirement to be different from the current understanding.
26. The system of claim 24, wherein the generated object code comprises a plurality of native instructions, and the runtime manager is further equipped to
monitor execution of the generated object code for execution requirements of the native instructions; and
update execution requirements of selected ones of the native instructions if said monitoring observes execution requirements for the selected ones of the native instructions to be different from current understandings of the execution requirements of the selected ones of the native instructions.
27. The system of claim 24, wherein the communication interface is a wireless communication interface.
28. The system of claim 24, wherein the runtime manager is further equipped to determine the initial number of times to interpretively execute the non-native instructions based at least in part on a size of the non-native instructions.
US10/802,586 2004-03-17 2004-03-17 Power and/or energy optimized compile/execution Active 2029-07-08 US7904893B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US10/802,586 US7904893B2 (en) 2004-03-17 2004-03-17 Power and/or energy optimized compile/execution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US10/802,586 US7904893B2 (en) 2004-03-17 2004-03-17 Power and/or energy optimized compile/execution

Publications (2)

Publication Number Publication Date
US20050229149A1 US20050229149A1 (en) 2005-10-13
US7904893B2 true US7904893B2 (en) 2011-03-08

Family

ID=35061998

Family Applications (1)

Application Number Title Priority Date Filing Date
US10/802,586 Active 2029-07-08 US7904893B2 (en) 2004-03-17 2004-03-17 Power and/or energy optimized compile/execution

Country Status (1)

Country Link
US (1) US7904893B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100205591A1 (en) * 2009-02-10 2010-08-12 International Business Machines Corporation Presenting energy consumption information in an integrated development environment tool
US20100235611A1 (en) * 2007-09-21 2010-09-16 Fujitsu Limited Compiler, compile method, and processor core control method and processor
US20110154309A1 (en) * 2009-12-22 2011-06-23 Apple Inc. Compiler with energy consumption profiling
US20130073883A1 (en) * 2011-09-20 2013-03-21 Qualcomm Incorporated Dynamic Power Optimization For Computing Devices
US8893088B2 (en) 2013-04-02 2014-11-18 Apple Inc. Dynamic program evaluation for system adaptation
US9098309B2 (en) 2011-09-23 2015-08-04 Qualcomm Incorporated Power consumption optimized translation of object code partitioned for hardware component based on identified operations
US9813297B2 (en) 2014-03-27 2017-11-07 Huawei Technologies Co., Ltd. Application scenario identification method, power consumption management method, apparatus, and terminal device

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7770034B2 (en) * 2003-12-16 2010-08-03 Intel Corporation Performance monitoring based dynamic voltage and frequency scaling
US8495605B2 (en) * 2008-06-16 2013-07-23 International Business Machines Corporation Policy-based program optimization to minimize environmental impact of software execution
KR101035257B1 (en) 2009-02-25 2011-05-18 충북대학교 산학협력단 A Method to Predict Power Consumption Of Embedded Software Using Unified Modeling LanguageUML Design Model
US8397186B2 (en) * 2009-07-16 2013-03-12 Synopsys, Inc. Technique for replaying operations using replay look-ahead instructions
US20110078655A1 (en) * 2009-09-30 2011-03-31 International Business Machines Corporation Creating functional equivalent code segments of a computer software program with lower energy footprints
JP5505522B2 (en) * 2011-02-01 2014-05-28 富士通株式会社 Program execution method
CN102662713B (en) * 2012-04-12 2014-04-16 腾讯科技(深圳)有限公司 Method, device and terminal for increasing running speed of application programs
JP2013254303A (en) * 2012-06-06 2013-12-19 Sony Corp Information processing apparatus, information processing method, and program
US9542179B2 (en) * 2013-09-06 2017-01-10 Texas Instruments Incorporated System and method for energy aware program development

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5566364A (en) 1994-01-31 1996-10-15 Nec Corporation Power saving portable radio communication device with diversity reception
US5682417A (en) 1994-05-31 1997-10-28 Nec Corporation Power saving mobile data communication system using adaptors
US20020112227A1 (en) * 1998-11-16 2002-08-15 Insignia Solutions, Plc. Dynamic compiler and method of compiling code to generate dominant path and to handle exceptions
US20030014742A1 (en) * 2001-07-09 2003-01-16 Sasken Communication Technologies Limited Technique for compiling computer code to reduce energy consumption while executing the code
US20030079213A1 (en) * 2000-11-29 2003-04-24 Gilbert Cabillic Data processing apparatus, system and method
US20040010785A1 (en) * 2002-01-29 2004-01-15 Gerard Chauvel Application execution profiling in conjunction with a virtual machine
US20040015914A1 (en) * 1999-09-14 2004-01-22 Timothy Renouf Loading object-oriented computer programs
US20050114850A1 (en) * 2003-10-29 2005-05-26 Saurabh Chheda Energy-focused re-compilation of executables and hardware mechanisms based on compiler-architecture interaction and compiler-inserted control
US7111177B1 (en) * 1999-10-25 2006-09-19 Texas Instruments Incorporated System and method for executing tasks according to a selected scenario in response to probabilistic power consumption information of each scenario
US7146613B2 (en) * 2001-11-15 2006-12-05 Texas Instruments Incorporated JAVA DSP acceleration by byte-code optimization

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5566364A (en) 1994-01-31 1996-10-15 Nec Corporation Power saving portable radio communication device with diversity reception
US5682417A (en) 1994-05-31 1997-10-28 Nec Corporation Power saving mobile data communication system using adaptors
US20020112227A1 (en) * 1998-11-16 2002-08-15 Insignia Solutions, Plc. Dynamic compiler and method of compiling code to generate dominant path and to handle exceptions
US20040015914A1 (en) * 1999-09-14 2004-01-22 Timothy Renouf Loading object-oriented computer programs
US7111177B1 (en) * 1999-10-25 2006-09-19 Texas Instruments Incorporated System and method for executing tasks according to a selected scenario in response to probabilistic power consumption information of each scenario
US20030079213A1 (en) * 2000-11-29 2003-04-24 Gilbert Cabillic Data processing apparatus, system and method
US20030014742A1 (en) * 2001-07-09 2003-01-16 Sasken Communication Technologies Limited Technique for compiling computer code to reduce energy consumption while executing the code
US7146613B2 (en) * 2001-11-15 2006-12-05 Texas Instruments Incorporated JAVA DSP acceleration by byte-code optimization
US20040010785A1 (en) * 2002-01-29 2004-01-15 Gerard Chauvel Application execution profiling in conjunction with a virtual machine
US20050114850A1 (en) * 2003-10-29 2005-05-26 Saurabh Chheda Energy-focused re-compilation of executables and hardware mechanisms based on compiler-architecture interaction and compiler-inserted control

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Chen et al., "Energy-Aware Compilation and Execution in Java-Enabled Mobile Devices", 2003 IEEE, pp. 1-8. *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235611A1 (en) * 2007-09-21 2010-09-16 Fujitsu Limited Compiler, compile method, and processor core control method and processor
US8543993B2 (en) * 2007-09-21 2013-09-24 Fujitsu Limited Compiler, compile method, and processor core control method and processor
US20100205591A1 (en) * 2009-02-10 2010-08-12 International Business Machines Corporation Presenting energy consumption information in an integrated development environment tool
US8312441B2 (en) * 2009-02-10 2012-11-13 International Business Machines Corporation Presenting energy consumption information in an integrated development environment tool
US20110154309A1 (en) * 2009-12-22 2011-06-23 Apple Inc. Compiler with energy consumption profiling
US20130073883A1 (en) * 2011-09-20 2013-03-21 Qualcomm Incorporated Dynamic Power Optimization For Computing Devices
US8799693B2 (en) * 2011-09-20 2014-08-05 Qualcomm Incorporated Dynamic power optimization for computing devices
US9098309B2 (en) 2011-09-23 2015-08-04 Qualcomm Incorporated Power consumption optimized translation of object code partitioned for hardware component based on identified operations
US8893088B2 (en) 2013-04-02 2014-11-18 Apple Inc. Dynamic program evaluation for system adaptation
US9122526B2 (en) 2013-04-02 2015-09-01 Apple Inc. Dynamic program evaluation for system adaptation
US9335817B2 (en) 2013-04-02 2016-05-10 Apple Inc. Dynamic program evaluation for system adaptation
US9813297B2 (en) 2014-03-27 2017-11-07 Huawei Technologies Co., Ltd. Application scenario identification method, power consumption management method, apparatus, and terminal device

Also Published As

Publication number Publication date
US20050229149A1 (en) 2005-10-13

Similar Documents

Publication Publication Date Title
US7904893B2 (en) Power and/or energy optimized compile/execution
US20160062878A1 (en) Speeding up dynamic language execution on a virtual machine with type speculation
EP0997816B1 (en) Method and apparatus for selecting ways to compile at runtime
US7975134B2 (en) Macroscalar processor architecture
US7954094B2 (en) Method for improving performance of executable code
Driesen et al. The direct cost of virtual function calls in C++
US8412914B2 (en) Macroscalar processor architecture
US6332216B1 (en) Hybrid just-in-time compiler that consumes minimal resource
US7788657B2 (en) Targeted runtime compilation
EP0908815B1 (en) Inline database for receiver types in object-oriented systems
US7543285B2 (en) Method and system of adaptive dynamic compiler resolution
US6966057B2 (en) Static compilation of instrumentation code for debugging support
US5995754A (en) Method and apparatus for dynamically optimizing byte-coded programs
US10114745B2 (en) Assisted garbage collection in a virtual machine
US20070079298A1 (en) Thread-data affinity optimization using compiler
US9239706B2 (en) Selective speculative class-based optimization
US20060123397A1 (en) Apparatus and method for optimization of virtual machine operation
US7143402B2 (en) Method and apparatus for precision optimization in compiled programs
US20050028132A1 (en) Application specific optimization of interpreters for embedded systems
US11204767B2 (en) Context switching locations for compiler-assisted context switching
US20100037214A1 (en) Method and system for mpi_wait sinking for better computation-communication overlap in mpi applications
Torgerson Automatic thread stack management for resource-constrained sensor operating systems
Lee et al. Correcting the dynamic call graph using control-flow constraints
Fu et al. Value speculation mechanisms for EPIC architectures
Ogasawara et al. Optimizing precision overhead for x86 processors

Legal Events

Date Code Title Description
AS Assignment

Owner name: INTEL CORPORATION, CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:MUNTER, JOEL D.;NANJA, MURTHI;GAO, ZHIGUO;AND OTHERS;REEL/FRAME:015114/0345;SIGNING DATES FROM 20040314 TO 20040316

Owner name: INTEL CORPORATION, CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:MUNTER, JOEL D.;NANJA, MURTHI;GAO, ZHIGUO;AND OTHERS;SIGNING DATES FROM 20040314 TO 20040316;REEL/FRAME:015114/0345

AS Assignment

Owner name: MARVELL INTERNATIONAL LTD.,BERMUDA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:INTEL CORPORATION;REEL/FRAME:018515/0817

Effective date: 20061108

Owner name: MARVELL INTERNATIONAL LTD., BERMUDA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:INTEL CORPORATION;REEL/FRAME:018515/0817

Effective date: 20061108

STCF Information on status: patent grant

Free format text: PATENTED CASE

FPAY Fee payment

Year of fee payment: 4

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 8TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1552); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Year of fee payment: 8

AS Assignment

Owner name: CAVIUM INTERNATIONAL, CAYMAN ISLANDS

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:MARVELL INTERNATIONAL LTD.;REEL/FRAME:052918/0001

Effective date: 20191231

AS Assignment

Owner name: MARVELL ASIA PTE, LTD., SINGAPORE

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:CAVIUM INTERNATIONAL;REEL/FRAME:053475/0001

Effective date: 20191231

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 12TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1553); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Year of fee payment: 12