CN104615473B - The optimization method and device of outline technology compiling - Google Patents
The optimization method and device of outline technology compiling Download PDFInfo
- Publication number
- CN104615473B CN104615473B CN201310539297.4A CN201310539297A CN104615473B CN 104615473 B CN104615473 B CN 104615473B CN 201310539297 A CN201310539297 A CN 201310539297A CN 104615473 B CN104615473 B CN 104615473B
- Authority
- CN
- China
- Prior art keywords
- program
- pitching pile
- region
- pile function
- dimensional array
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3404—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for parallel or distributed programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
- G06F11/3612—Software analysis for verifying properties of programs by runtime analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the present invention provides a kind of optimization method and device of outline technology compiling.The optimization method of outline technology compiling of the present invention, including:At least two regions are marked off on program control flowchart, regional is corresponded into the pitching pile function that program bag contains replaces with counting operation;The regional is corresponded into program on main thread to perform, when execution a to region corresponds to EP (end of program), start at least one micro-line journey and perform the region and correspond to the operation of pitching pile function that program bag contains in addition to counting operation, for recording the information when region corresponds to program execution;The main thread of micro-line journey program corresponding with performing next region performs parallel.The embodiment of the present invention improves execution efficiency during outline technology compiling, solves the problems, such as that execution efficiency is relatively low in the prior art.
Description
Technical field
The present embodiments relate to network technology, more particularly to a kind of optimization method and device of outline technology compiling.
Background technology
The common practices of modern optimization compiler is to use profile (Profiling) technology, and outline technology is that one kind is used for
The important method of collecting program runtime information, including edge profile technology (edge profiling), span outline technology
The diversified forms such as (stride profiling), value outline technology (value profiling), wherein with edge profiling
Be most widely used.
Existing Edge Profiling methods, it is that insertion can calculate every on the controlling stream graph generated in compiling
Side performs number but the minimum pitching pile function of number;The executable file so generated will call pitching pile for several times at run time
Function, information and preserved with document form during the operation of collection procedure.Fig. 1 is the division basic block in existing edge profile technology
Schematic diagram, as shown in figure 1, in compiler, source program can be first be converted into intermediate representation, and base is divided on intermediate representation
This block(Intermediate representation is still expressed as to the form of C language here), such as BB1, BB2.Fig. 2 is in existing edge profile technology
Controlling stream graph and pitching pile schematic diagram, as shown in Fig. 2 building controlling stream graph by basic block, and give each of which bar side label,
And to the main side pitching pile on controlling stream graph(Some compilers are all to do pitching pile to every a line), that is, insert function call to
Count the execution number on this side(Edge id represent the sequence number on side), pitching pile function such as INSTRU1, INSTRU2.
Existing Edge Profiling methods, due to adding substantial amounts of pitching pile function call, execution efficiency is very low
Under.
The content of the invention
The embodiment of the present invention provides a kind of optimization method and device of outline technology compiling, to overcome profile in the prior art
The problem of execution efficiency is relatively low when technology compiles.
In a first aspect, the embodiment of the present invention provides a kind of optimization method of outline technology compiling, including:
At least two regions are marked off on program control flowchart, regional is corresponded into the pitching pile function that program bag contains replaces
It is changed to counting operation;
The regional is corresponded into program on main thread to perform, perform to a region correspond to EP (end of program) when, open
Dynamic at least one micro-line journey performs the region and corresponds to the operation of pitching pile function that program bag contains in addition to counting operation, for recording
The region corresponds to information when program performs;The main thread of micro-line journey program corresponding with performing next region is held parallel
OK.
It is described regional is corresponded into program bag to contain with reference in a first aspect, in the first implementation of first aspect
Pitching pile function replace with counting operation, including:
The porch of program is corresponded in regional, opens up the two-dimensional array space that a size is N*2, the N is institute
State the maximum that regional corresponds to the pitching pile function number that program bag contains;
2 elements of the i-th * of the two-dimensional array are entered as the sequence number on side in described program controlling stream graph, the two dimension
I-th * 2+1 elements of array are used to count, and the i represents i-th of pitching pile function, and the i values are more than or equal to 0 and are less than
Equal to N.
With reference to the first implementation of first aspect, in second of implementation of first aspect, the execution is extremely
When one region corresponds to EP (end of program), start at least one micro-line journey execution region and correspond to the pitching pile function of program except counting
Operation outside operation, including:
If the value of the i-th * 2+1 elements of the two-dimensional array is not 0, the number for performing the pitching pile function is equal to institute
The value of the i-th * 2+1 elements is stated, the input parameter of the pitching pile function is 2 elements of the i-th * of the two-dimensional array.
With reference to the first and second of first aspect any one implementation, in the third implementation of first aspect, institute
When stating execution a to region and correspond to EP (end of program), start the pitching pile letter that at least one micro-line journey execution region corresponds to program
Operation of the number in addition to counting operation, including:
Perform the region correspond to program pitching pile function terminate after, discharge the two-dimensional array space.
Second aspect, the embodiment of the present invention provide a kind of optimization device of outline technology compiling, including:
Pretreatment module, for marking off at least two regions on program control flowchart, regional is corresponded into program
Comprising pitching pile function replace with counting operation;
Processing module, perform, perform corresponding to a region for the regional to be corresponded into program on main thread
During EP (end of program), start at least one micro-line journey and perform the region and correspond to pitching pile function that program bag contains in addition to counting operation
Operation, for recording the information when region corresponds to program execution;Micro-line journey program corresponding with performing next region
Main thread perform parallel.
With reference to second aspect, in the first implementation of second aspect, the pretreatment module is specifically used for:
The porch of program is corresponded in regional, opens up the two-dimensional array space that a size is N*2, the N is institute
State the maximum that regional corresponds to the pitching pile function number that program bag contains;
2 elements of the i-th * of the two-dimensional array are entered as the sequence number on side in described program controlling stream graph, the two dimension
I-th * 2+1 elements of array are used to count, and the i represents i-th of pitching pile function, and the i values are more than or equal to 0 and are less than
Equal to N.
With reference to the first implementation of second aspect, in second of implementation of second aspect, the processing mould
Block is specifically used for:
If the value of the i-th * 2+1 elements of the two-dimensional array is not 0, the number for performing the pitching pile function is equal to institute
The value of the i-th * 2+1 elements is stated, the input parameter of the pitching pile function is 2 elements of the i-th * of the two-dimensional array.
With reference to the first and second of second aspect any one implementation, in the third implementation of second aspect, institute
Processing module is stated to be additionally operable to:
Perform the region correspond to program pitching pile function terminate after, discharge the two-dimensional array space.
Outline technology of the embodiment of the present invention compiling optimization method and device, by marked off on program control flowchart to
Few two regions, regional is corresponded into the pitching pile function that program bag contains and replaces with counting operation;The regional is corresponding
Program performs on main thread, perform to a region correspond to EP (end of program) when, start at least one micro-line journey and perform the area
Domain corresponds to the operation of pitching pile function that program bag contains in addition to counting operation;Micro-line journey program corresponding with performing next region
Main thread perform parallel because by a part of transition of operation of the pitching pile function in program in each region to micro-line journey,
The main thread of this micro-line journey program corresponding with performing next region is performed parallel, and effect is performed when improving outline technology compiling
Rate, solve the problems, such as that execution efficiency is relatively low in the prior art.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs
Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the division basic block schematic diagram in existing edge profile technology;
Fig. 2 is the controlling stream graph and pitching pile schematic diagram in existing edge profile technology;
Fig. 3 is the flow chart of the optimization method embodiment one of outline technology of the present invention compiling;
Fig. 4 is the controlling stream graph schematic diagram in embodiment one;
Fig. 5 is to the schematic diagram behind controlling stream graph zoning in Fig. 4;
Fig. 6 is the schematic diagram after the pitching pile function processing to controlling stream graph in Fig. 5;
Fig. 7 A are the schematic diagram one performed to controlling stream graph in Fig. 6;
Fig. 7 B are the schematic diagram two performed to controlling stream graph in Fig. 6;
Fig. 8 is the structural representation of the optimization device embodiment of outline technology of the present invention compiling;
Fig. 9 is the structural representation of the optimization apparatus embodiments of outline technology of the present invention compiling.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 3 is the flow chart of the optimization method embodiment one of outline technology of the present invention compiling, and Fig. 4 is the control in embodiment one
Flow graph schematic diagram processed, Fig. 5 are to the schematic diagram behind controlling stream graph zoning in Fig. 4, and Fig. 6 is that controlling stream graph in Fig. 5 is inserted
Schematic diagram after pile function processing.Fig. 7 A are the schematic diagram one performed to controlling stream graph in Fig. 6.Fig. 7 B are to controlling stream in Fig. 6
Scheme the schematic diagram two performed.The executive agent of the present embodiment is the optimization device of outline technology compiling, and the device can be by soft
Part and/or hardware are realized.The scheme of the present embodiment is applied in outline technology compiling.As shown in figure 3, the method for the present embodiment can
With including:
Step 301, at least two regions are marked off on program control flowchart, inserted what regional corresponded to that program bag contains
Pile function replaces with counting operation.
Specifically, illustrate in the present embodiment by taking edge profile technology as an example, first divide controlling stream graph as shown in Figure 4
Region, region are a connected subregions on controlling stream graph, are made up of one or several basic blocks and their side of connection, can
To regard an Area Node as.Area Node can be nested.Area Node has following three types:1)Circulate domain node,
Include all basic blocks in a circulation and connected side (inside includes back edge);2)Abnormal domain node, it is an interconnection
Basic set of blocks, wherein comprising can not reduction controlling stream graph (inside comprising can not stipulations ring side);3)Save in multiple-input, multiple-output domain
Point, multiple entry/multiple exit (inside do not include ring side), including singly entering to have more the domain node of type.
Multiple Area Nodes and its connected side may be constructed Region control flow graph;There is no back edge on Region control flow graph;
Build Area Node and Region control flow graph and any change is not carried out to former controlling stream graph and basic block.
The process of zoning is as follows:Travel through controlling stream graph first, identify the side that can form ring, the construction range of a loop and
Abnormal domain.Ring side all in controlling stream graph is found out, and determines which ring side is back edge, back edge refers to that the destination node on side is
Set out node Dominator ring side, it is remaining be not back edge ring while be exactly can not reduction ring while.Find out it is all circulation with
Afterwards, these Natural Circulations form the range of a loop(Allow nesting to each other), to have in controlling stream graph can not the domain on reduction ring side make
With strong continune component lookup algorithm, find out maximum strong continune component, remaining strong continune component be exactly can not reduction part, they
Abnormal domain will be formed.The range of a loop and abnormal domain by abbreviation into after Area Node, along path by connection on controlling stream graph
Node(Basic block or Area Node)Several form region.
In the present embodiment different regions is divided according to the number of inter-node pitching pile function.The rule of division is mainly area
The quantity number of the pitching pile function included in domain, if the maximum of pitching pile function numbers is N, minimum value M, N, M value use
The mode of inspiration determines, i.e., is determined using empirical value, and the pitching pile function included in region is as far as possible average, it is impossible to too much can not be too
Few, the annexation between region is as far as possible simple.It is as shown in figure 4, above-mentioned comprising 20 basic blocks and connection in controlling stream graph
27 sides of basic block, insert 8 pitching pile functions, and pitching pile function is Instru(), N=3 is taken, M=2 will according to above-mentioned rule
Controlling stream graph in Fig. 4 is divided into 3 regions, and such as R1, R2 and R3, the controlling stream graph after zoning is as shown in Figure 5.
After zoning, each region (not including outlet basic block) pitching pile function that corresponding program bag contains is replaced with
Counting operation.
Alternatively, regional is corresponded into the pitching pile function that program bag contains and replaces with counting operation, including:
The porch of program is corresponded in regional, opens up the two-dimensional array space that a size is N*2, N is each area
Domain corresponds to the maximum for the pitching pile function number that program bag contains;
2 elements of the i-th * of two-dimensional array are entered as the sequence number on side in program control flowchart, the i-th * 2+1 of two-dimensional array
Individual element is used to count, and i represents i-th of pitching pile function, and i values are more than or equal to 0 and are less than or equal to N.
Specifically, as shown in fig. 6, corresponding to the porch of program in regional, the two-dimemsional number that a size is N*2 is opened up
Group space(It can be the opening space on heap), such as a_id (id represents region id) is named as, its size is N*2, and N is each
Region corresponds to the maximum for the pitching pile function number that program bag contains, such as areal is 3 in Fig. 6, N=3, by two-dimensional array
2 elements of the i-th * be entered as the sequence number on side in program control flowchart(edge_id), the i-th * 2+1 elements use of two-dimensional array
In counting, such as a_1 [0] [0]=2(2 be edge_id), for counting, a_1 [1] [0]=6, a_1 [1] [1] is used a_1 [0] [1]
In counting, a_1 [0] [1] and a_1 [1] [1] initial value are 0, due to there was only two pitching pile functions then a_1 [2] [0] in region 1
And a_1 [2] [1] is initial value, a_1 [2] [1] initial value is 0.
Implement replacement operation for each pitching pile function in regional, if current pitching pile function is i-th in the region
It is individual;The form of its original pitching pile function is Instru (edge_id);Operation a_id [i] [0]=edge_id is replaced with now;a_
id[i][1]++;Original pitching pile function pitching pile is replaced to the counting operation of array.Array manipulation performs effect than call function
Rate is higher.
Step 302, regional is corresponded into program performed on main thread, performed to a region and correspond to EP (end of program)
When, start at least one micro-line journey and perform region and correspond to the operation of pitching pile function that program bag contains in addition to counting operation, for remembering
Record region corresponds to information when program performs;The main thread of micro-line journey program corresponding with performing next region performs parallel.
Specifically, in Complied executing, regional is corresponded into program on main thread and performed, is performed to a region pair
When answering EP (end of program), start at least one micro-line journey and perform region and correspond to the behaviour of pitching pile function that program bag contains in addition to counting operation
Make, i.e., the pitching pile function in regional is concentrated, the operation in addition to counting operation is performed in micro-line journey, according to slotting
Micro- number of threads that the number selection of pile function enables;Under the micro-line journey and execution that perform the pitching pile function that one's respective area corresponds to program
The main thread that one region corresponds to program performs parallel.
Micro-line journey is a kind of new technology of cooperative work of software and hardware, and it is mainly characterized by:It is small that thread starts cost;Thread is grown
Degree can be shorter, and has the feature of " starting frequently, amount of calculation is small, one-way communication " during outline technology compiling, such as cincture
It may need to redirect carry out pitching pile to be each in wide technology, be adapted to start the small characteristic of cost using micro-line journey, pitching pile function
Basic function is to count, while with the work in terms of some data processings, but amount of calculation very little on the whole, it is adapted to utilize
The shorter characteristic of the thread length of micro-line journey;Outline technology is that program execution information is detected, it is therefore desirable to knows program
The state of execution, but normal execution of the result of these states not to program impacts, the outline technology of different phase
Between communication issue is also not present, be adapted to program being placed on that main thread is performed, outline technology is carried out point in multiple micro-line journeys, and
Explicit synchronization is not needed, so outline technology compiling is very suitable for solving using micro-line journey.
As shown in Figure 5, above-mentioned controlling stream graph, which corresponds to program, two kinds of running situations, and one kind is that R1 → R2 terminates, Yi Zhongshi
R1 → R2 → R3 terminates, and as shown in Fig. 7 A, 7B, corresponding have two kinds of executive modes, the first executive mode, as shown in Figure 7 A,
R1, R2, R3 are performed on main thread, and the pitching pile function of corresponding region is put together to be performed in one or more micro-line journeys, is held
The micro-line journey of the pitching pile function (InstruR1) in row R1 regions performs parallel with performing the main thread in R2 regions, performs R2 regions
The micro-line journey of pitching pile function (InstruR2) performs parallel with performing the main thread in R3 regions, and the main thread for performing R3 regions terminates
Start the pitching pile function (InstruR3) that micro-line journey performs R3 regions afterwards;Second of executive mode, as shown in Figure 7 B, R1, R2
Performed on main thread, the pitching pile function of corresponding region is put together to be performed in one or more micro-line journeys, performs R1 regions
Pitching pile function (InstruR1) micro-line journey and perform the main thread in R2 regions and perform parallel, perform the main thread knot in R2 regions
Start the pitching pile function (InstruR2) that micro-line journey performs R2 regions after beam.
Alternatively, perform to a region correspond to EP (end of program) when, start at least one micro-line journey and perform region and correspond to journey
Operation of the pitching pile function of sequence in addition to counting operation, including:
If the value of the i-th * 2+1 elements of two-dimensional array is not 0, the number for performing pitching pile function is equal to the i-th * 2+1
The value of element, the input parameter of pitching pile function are 2 elements of the i-th * of two-dimensional array.
Specifically, as shown in fig. 6, such as a_1 [i] [1] is not 0, then micro-line journey performs i-th of pitching pile function(Such as edge_
Pitching pile function on id=2, the operation in addition to counting)Number be equal to a_1 [i] [1] it is secondary, new pitching pile function is Instru_
new(a_1[i][0]), calling a_1 [i] [1] is secondary, and region R2 and region R3 are similar;If a_1 [i] [1] is equal to 0, do not exist
This pitching pile function is performed in micro-line journey.
Alternatively, perform to a region correspond to EP (end of program) when, start at least one micro-line journey and perform region and correspond to journey
Operation of the pitching pile function of sequence in addition to counting operation, including:
Perform region correspond to program pitching pile function terminate after, release two-dimensional array space.
Specifically, perform region correspond to program pitching pile function terminate after, such as region R1 pitching pile function terminate after,
As shown in Fig. 7 A, 7B, after InstruR1 terminates, the two-dimensional array space a_1 that size is N*2 is discharged(N=3).
The present embodiment, by marking off at least two regions on program control flowchart, regional is corresponded into program bag
The pitching pile function contained replaces with counting operation;The regional is corresponded into program on main thread to perform, performed to an area
When domain corresponds to EP (end of program), start at least one micro-line journey and perform the region and correspond to pitching pile function that program bag contains except counting behaviour
Operation outside work;The main thread of micro-line journey program corresponding with performing next region performs parallel, because will be every in program
A part of transition of operation of pitching pile function in individual region is in micro-line journey, this micro-line journey program corresponding with performing next region
Main thread perform parallel, and using array manipulation replace pitching pile function counting operation, the execution efficiency ratio of array manipulation
The execution efficiency that call function counts is higher, and after micro-line journey performs pitching pile function, the profit of resource is improved in release array space
With rate, execution efficiency during outline technology compiling is finally improved, solves the problems, such as that execution efficiency is relatively low in the prior art.
Fig. 8 is the structural representation of the optimization device embodiment of outline technology of the present invention compiling, as shown in figure 8, this implementation
The optimization device 80 of the outline technology compiling of example can include:Pretreatment module 801 and processing module 802, wherein, pre-process mould
Block 801, for marking off at least two regions on program control flowchart, regional is corresponded into the pitching pile function that program bag contains
Replace with counting operation;Processing module 802, perform, performed to one for the regional to be corresponded into program on main thread
When individual region corresponds to EP (end of program), start at least one micro-line journey and perform the region and correspond to pitching pile function that program bag contains except counting
Operation outside number operation, for recording the information when region corresponds to program execution;The micro-line journey is with performing next area
The main thread that domain corresponds to program performs parallel.
The device of the present embodiment, it can be used for the technical scheme for performing embodiment of the method shown in Fig. 3, its realization principle and skill
Art effect is similar, and here is omitted.
Alternatively, pretreatment module 801 is specifically used for:
The porch of program is corresponded in regional, opens up the two-dimensional array space that a size is N*2, the N is institute
State the maximum that regional corresponds to the pitching pile function number that program bag contains;
2 elements of the i-th * of the two-dimensional array are entered as the sequence number on side in described program controlling stream graph, the two dimension
I-th * 2+1 elements of array are used to count, and the i represents i-th of pitching pile function, and the i values are more than or equal to 0 and are less than
Equal to N.
Alternatively, processing module 802 is specifically used for:
If the value of the i-th * 2+1 elements of the two-dimensional array is not 0, the number for performing the pitching pile function is equal to institute
The value of the i-th * 2+1 elements is stated, the input parameter of the pitching pile function is 2 elements of the i-th * of the two-dimensional array.
Alternatively, processing module 802 is additionally operable to:
Perform the region correspond to program pitching pile function terminate after, discharge the two-dimensional array space.
Fig. 9 is the structural representation of the optimization apparatus embodiments of outline technology of the present invention compiling.As shown in figure 9, this implementation
The optimization equipment 90 for the outline technology compiling that example provides includes bus 901, processor 902 and memory 903.Wherein, bus 901
For connecting processor 902 and memory 903, and transmit information;Memory 903 stores execute instruction, when outline technology compiles
Optimization equipment 90 run when, communicate between processor 902 and memory 903, stored in the run memory 903 of processor 902
Code, perform following operation:
At least two regions are marked off on program control flowchart, regional is corresponded into the pitching pile function that program bag contains replaces
It is changed to counting operation;
The regional is corresponded into program on main thread to perform, perform to a region correspond to EP (end of program) when, open
Dynamic at least one micro-line journey performs the region and corresponds to the operation of pitching pile function that program bag contains in addition to counting operation, for recording
The region corresponds to information when program performs;The main thread of micro-line journey program corresponding with performing next region is held parallel
OK.
Alternatively, it is described regional is corresponded into the pitching pile function that program bag contains to replace with counting operation, including:
The porch of program is corresponded in regional, opens up the two-dimensional array space that a size is N*2, the N is institute
State the maximum that regional corresponds to the pitching pile function number that program bag contains;
2 elements of the i-th * of the two-dimensional array are entered as the sequence number on side in described program controlling stream graph, the two dimension
I-th * 2+1 elements of array are used to count, and the i represents i-th of pitching pile function, and the i values are more than or equal to 0 and are less than
Equal to N.
Alternatively, when the execution a to region corresponds to EP (end of program), start at least one micro-line journey and perform the area
Domain corresponds to operation of the pitching pile function of program in addition to counting operation, including:
If the value of the i-th * 2+1 elements of the two-dimensional array is not 0, the number for performing the pitching pile function is equal to institute
The value of the i-th * 2+1 elements is stated, the input parameter of the pitching pile function is 2 elements of the i-th * of the two-dimensional array.
Alternatively, when the execution a to region corresponds to EP (end of program), start at least one micro-line journey and perform the area
Domain corresponds to operation of the pitching pile function of program in addition to counting operation, including:
Perform the region correspond to program pitching pile function terminate after, discharge the two-dimensional array space.
In several embodiments provided by the present invention, it should be understood that disclosed apparatus and method, it can be passed through
Its mode is realized.For example, device embodiment described above is only schematical, for example, the division of the unit, only
Only a kind of division of logic function, there can be other dividing mode when actually realizing, such as multiple units or component can be tied
Another system is closed or is desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or discussed
Mutual coupling or direct-coupling or communication connection can be the INDIRECT COUPLINGs or logical by some interfaces, device or unit
Letter connection, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit
The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also
That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list
Member can both be realized in the form of hardware, can also be realized in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit realized in the form of SFU software functional unit, can be stored in one and computer-readable deposit
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are causing a computer
Equipment(Can be personal computer, server, or network equipment etc.)Or processor(processor)It is each to perform the present invention
The part steps of embodiment methods described.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage(Read-
Only Memory, ROM), random access memory(Random Access Memory, RAM), magnetic disc or CD etc. it is various
Can be with the medium of store program codes.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each functional module
Division progress for example, in practical application, can be complete by different functional modules by above-mentioned function distribution as needed
Into the internal structure of device being divided into different functional modules, to complete all or part of function described above.On
The specific work process of the device of description is stated, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, either which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.
Claims (8)
- A kind of 1. optimization method of outline technology compiling, it is characterised in that including:At least two regions are marked off on program control flowchart according to the quantity of the pitching pile function included in region, by each area Domain corresponds to the pitching pile function that program bag contains and replaces with counting operation;The regional is corresponded into program on main thread to perform, perform to a region correspond to EP (end of program) when, start extremely A few micro-line journey performs the region and correspond to the operation of pitching pile function that program bag contains in addition to counting operation, described in recording Region corresponds to information when program performs;The main thread of micro-line journey program corresponding with performing next region performs parallel.
- 2. according to the method for claim 1, it is characterised in that described that regional is corresponded to the pitching pile function that program bag contains Counting operation is replaced with, including:The porch of program is corresponded in regional, opens up the two-dimensional array space that a size is N*2, the N is described each Individual region corresponds to the maximum for the pitching pile function number that program bag contains;2 elements of the i-th * of the two-dimensional array are entered as the sequence number on side in described program controlling stream graph, the two-dimensional array The i-th * 2+1 elements be used to count, the i represents i-th of pitching pile function, and the i values are more than or equal to 0 and are less than or equal to N。
- 3. according to the method for claim 2, it is characterised in that when the execution a to region corresponds to EP (end of program), open Dynamic at least one micro-line journey performs the region and corresponds to the operation of pitching pile function that program bag contains in addition to counting operation, including:If the value of the i-th * 2+1 elements of the two-dimensional array is not 0, the number for performing the pitching pile function is equal to described the The value of i*2+1 element, the input parameter of the pitching pile function are 2 elements of the i-th * of the two-dimensional array.
- 4. the method according to any one of claim 2~3, it is characterised in that described perform to a region corresponds to journey At the end of sequence, start at least one micro-line journey and perform the region and correspond to the behaviour of pitching pile function that program bag contains in addition to counting operation Make, including:Perform the region to correspond to after the pitching pile function that program bag contains terminates, discharge the two-dimensional array space.
- A kind of 5. optimization device of outline technology compiling, it is characterised in that including:Pretreatment module, for marking off at least two on program control flowchart according to the quantity of the pitching pile function included in region Individual region, regional is corresponded into the pitching pile function that program bag contains and replaces with counting operation;Processing module, performed for the regional to be corresponded into program on main thread, perform to a region and correspond to program At the end of, start at least one micro-line journey and perform the region and correspond to the behaviour of pitching pile function that program bag contains in addition to counting operation Make, for recording the information when region corresponds to program execution;Micro-line journey program corresponding with performing next region Main thread performs parallel.
- 6. device according to claim 5, it is characterised in that the pretreatment module is specifically used for:The porch of program is corresponded in regional, opens up the two-dimensional array space that a size is N*2, the N is described each Individual region corresponds to the maximum for the pitching pile function number that program bag contains;2 elements of the i-th * of the two-dimensional array are entered as the sequence number on side in described program controlling stream graph, the two-dimensional array The i-th * 2+1 elements be used to count, the i represents i-th of pitching pile function, and the i values are more than or equal to 0 and are less than or equal to N。
- 7. device according to claim 6, it is characterised in that the processing module is specifically used for:If the value of the i-th * 2+1 elements of the two-dimensional array is not 0, the number for performing the pitching pile function is equal to described the The value of i*2+1 element, the input parameter of the pitching pile function are 2 elements of the i-th * of the two-dimensional array.
- 8. the device according to any one of claim 6~7, it is characterised in that the processing module is additionally operable to:Perform the region to correspond to after the pitching pile function that program bag contains terminates, discharge the two-dimensional array space.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310539297.4A CN104615473B (en) | 2013-11-04 | 2013-11-04 | The optimization method and device of outline technology compiling |
PCT/CN2014/086593 WO2015062369A1 (en) | 2013-11-04 | 2014-09-16 | Method and apparatus for optimizing compilation in profiling technology |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310539297.4A CN104615473B (en) | 2013-11-04 | 2013-11-04 | The optimization method and device of outline technology compiling |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104615473A CN104615473A (en) | 2015-05-13 |
CN104615473B true CN104615473B (en) | 2017-11-24 |
Family
ID=53003294
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310539297.4A Active CN104615473B (en) | 2013-11-04 | 2013-11-04 | The optimization method and device of outline technology compiling |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104615473B (en) |
WO (1) | WO2015062369A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112287357B (en) * | 2020-11-11 | 2022-08-12 | 中国科学院信息工程研究所 | Control flow verification method and system for embedded bare computer system |
CN116775127A (en) * | 2023-05-25 | 2023-09-19 | 哈尔滨工业大学 | Static symbol execution pile inserting method based on RetroWrite framework |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002077821A2 (en) * | 2001-03-26 | 2002-10-03 | Intel Corporation | Method and system for collaborative profiling for continuous detection of profile phase |
CN103051509A (en) * | 2012-08-03 | 2013-04-17 | 北京航空航天大学 | Tree-structure-based initialization method |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6795964B2 (en) * | 2001-06-18 | 2004-09-21 | Hewlett-Packard Development Company, L.P. | Edge profiling for executable program code having branches through stub code segments |
US8359587B2 (en) * | 2008-05-01 | 2013-01-22 | Oracle America, Inc. | Runtime profitability control for speculative automatic parallelization |
CN103019852B (en) * | 2012-11-14 | 2015-11-11 | 北京航空航天大学 | A kind of MPI concurrent program loading problem three-dimensional visualization analytical approach being applicable to large-scale cluster |
-
2013
- 2013-11-04 CN CN201310539297.4A patent/CN104615473B/en active Active
-
2014
- 2014-09-16 WO PCT/CN2014/086593 patent/WO2015062369A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002077821A2 (en) * | 2001-03-26 | 2002-10-03 | Intel Corporation | Method and system for collaborative profiling for continuous detection of profile phase |
CN103051509A (en) * | 2012-08-03 | 2013-04-17 | 北京航空航天大学 | Tree-structure-based initialization method |
Also Published As
Publication number | Publication date |
---|---|
CN104615473A (en) | 2015-05-13 |
WO2015062369A1 (en) | 2015-05-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103309738B (en) | User job dispatching method and device | |
JP6633053B2 (en) | Executing program specifications based on graphs | |
EP3189428B1 (en) | Compilation of graph-based program specifications with automated clustering of graph components based on the identification of particular data port connections | |
CN106687921A (en) | Specifying components in graph-based programs | |
US20180225016A1 (en) | Specifying control and data connections in graph-based programs | |
US8601458B2 (en) | Profile-driven data stream processing | |
CN104504143B (en) | A kind of flow graph optimization method and its device | |
CN106687919A (en) | Managing state for controlling tasks | |
CN107526645B (en) | A kind of communication optimization method and system | |
CN102158417A (en) | Method and device for optimizing multi-constraint quality of service (QoS) routing selection | |
US20060242633A1 (en) | Compiling computer programs to exploit parallelism without exceeding available processing resources | |
Wang et al. | Backbone guided tabu search for solving the UBQP problem | |
Angelelli et al. | Congestion avoiding heuristic path generation for the proactive route guidance | |
CN102831005A (en) | Compiling method for optimizing allocation of register based on C*core processor and compiler | |
Anderson et al. | Dynamic software update for message passing programs | |
CN104572260A (en) | Code versioning for enabling transactional memory promotion | |
CN104615473B (en) | The optimization method and device of outline technology compiling | |
CN110245190A (en) | A kind of block data fragmented storage method, terminal and medium | |
CN110262995A (en) | It executes body creation system and executes body creation method | |
CN104965762B (en) | A kind of scheduling system towards hybrid task | |
Lai et al. | Backtracking based iterated tabu search for equitable coloring | |
CN109800074A (en) | Task data concurrently executes method, apparatus and electronic equipment | |
CN110532091B (en) | Graph computation edge vector load balancing method and device based on graph processor | |
CN104932982B (en) | A kind of Compilation Method and relevant apparatus of message memory access | |
Asmaran et al. | Chemical reaction optimization algorithm to find maximum independent set in a graph |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |