Processing instructions
Abstract
In general, in one aspect, the disclosure describes a computer program to access a set of source instructions and identify a variable within the source instructions to be accessed by different threads. The program determines a location within the execution flow specified by the set of source instructions, where the variable value, after the determined flow location, has an unchanging value. The program generates at least one set of target instructions for the source instructions. The target instructions copy the value of the variable from a first memory to a second memory based on the determined location. The generated target instructions access the copy of the value in the second memory for at least one source instruction that specifies access to at least one variable.
Claims
exact text as granted — not AI-modified1 . A computer program product, disposed on a computer readable medium, the program including program instructions for causing a processor to:
access a set of source instructions; identify at least one variable within the source instructions, the variable to be accessed by different threads; determine a location within the execution flow specified by the set of source instructions, wherein the at least one variable value, after the determined flow location, has an unchanging value; and generate at least one set of target instructions for the source instructions, wherein at least one of the sets of target instructions includes instructions to:
copy the value of the variable from a first memory to a second memory at a location within the execution flow of the target instructions based on the determined location; and
access the copy of the value in the second memory for at least one source instruction that specifies access to the at least one variable.
2 . The program of claim 1 , wherein the program instructions to generate at least one set of target instructions comprise program instructions to generate a first of the set of target instructions to notify a second of the set of target instructions to copy the variable.
3 . The program of claim 1 ,
wherein the first memory comprises a memory shared by different engines in a multi-engine system, the memory not uniquely associated with a particular one of the different engines; and wherein the second memory is the local memory of an engine.
4 . The program of claim 1 , wherein the first memory has a greater latency than the second memory with respect to a thread to execute a one of the set of the target instructions.
5 . The program of claim 1 , wherein the determining the location comprises performing data-flow analysis of the at least one variable value.
6 . The program of claim 1 , wherein at least one set of target instructions comprises target instructions of a packet engine of a network processor.
7 . The program of claim 6 , wherein the at least one set of target instructions comprises multiple sets of target instructions.
8 . The program of claim 1 ,
wherein the program comprises a compiler; and wherein the source instructions comprise instructions expressed in a higher level language than the target instructions.
9 . The program of claim 1 , wherein the unchanging value of the at least one variable is not determined during compilation.
10 . A method, comprising:
accessing a set of source instructions; identifying at least one variable within the source instructions, the variable to be accessed by different threads; determining a location within the execution flow specified by the set of source instructions, wherein the at least one variable value, after the determined flow location, has an unchanging value; and generating at least one set of target instructions for the source instructions, wherein at least one of the sets of target instructions includes instructions to:
copy the value of the variable from a first memory to a second memory at a location within the execution flow of the target instructions based on the determined location; and
access the copy of the value in the second memory for at least one source instruction that specifies access to the at least one variable.
11 . The method of claim 10 , wherein the program instructions to generate at least one set of target instructions comprise program instructions to generate a first of the set of target instructions to notify a second of the set of target instructions to copy the variable
12 . The method of claim 10 ,
wherein the first memory comprises a memory shared by different engines in a multi-engine system, the memory not uniquely associated with a particular one of the different engines; and wherein the second memory is the local memory of an engine.
13 . The method of claim 10 , wherein the first memory has a greater latency than the second memory with respect to a thread to execute one of the set of the target instructions.
14 . The method of claim 10 , wherein the determining the location comprises performing data-flow analysis of the at least one variable value.
15 . The method of claim 10 , wherein the at least one set of target instructions comprise target instructions of a packet engine of a network processor.
16 . The method of claim 15 , wherein the at least one set of target instructions comprises multiple sets of target instructions.
17 . The method of claim 10 , wherein the source instructions comprise instructions expressed in a higher-level language that the target instructions.
18 . A compiler, disposed on a computer readable medium, the program including program instructions for causing a processor to:
access a set of source instructions; identify at least one variable within the source instructions, the variable to be accessed by different network processor engine threads; determine a location within the execution flow specified by the set of source instructions, wherein the at least one variable value, after the determined flow location, has an unchanging value; and generate multiple sets of target instructions for the source instructions, wherein at least one of the sets of target instructions includes instructions to:
copy the value of the variable from a first memory to a second memory at a location with the execution flow of the target instructions based on the determined location; and
access the copy of the value in the second memory for at least one source instruction that specifies access to the at least one variable;
wherein the first memory comprises a memory shared by different engines in a multi-engine system, the memory not uniquely associated with a particular one of the different engines;
wherein the second memory is the local memory of an engine in the multi-engine system; and
wherein the source instructions comprise instructions expressed in a higher level language that the target instructions.
19 . The compiler of claim 18 , wherein the target instructions comprise instructions expressed in an instruction set of a packet engine.Join the waitlist — get patent alerts
Track US2005034108A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.