Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Flow in Static Profiling Cathal Boogerd, Delft University, The Netherlands Leon Moonen, Simula Research Lab, Norway ?

Similar presentations


Presentation on theme: "Data Flow in Static Profiling Cathal Boogerd, Delft University, The Netherlands Leon Moonen, Simula Research Lab, Norway ?"— Presentation transcript:

1 Data Flow in Static Profiling Cathal Boogerd, Delft University, The Netherlands Leon Moonen, Simula Research Lab, Norway ?

2 Why Static Profiling? Static Profiling: estimate a program’s execution profile by static program analysis – Frequency or likelihood? Applications include compiler optimization or WCET analysis – Previous work: prioritizing code inspection results Application domain: embedded systems – No hardware available for test during early development – Lack of complete test profile and infrastructure for dynamic measurements

3 Execution Likelihood and Frequency Both concepts are relevant for our application Consider difference between v1, guaranteed to be executed.... And v2, typically executed many times int main (int argc, char argv) { /* v1 */ int a = 1 ; foo(a) ; for (a = 0; a < argc; a++) { /* v2 */ } return 0; }

4 Data Flow in Static Profiling Previously: 65% of locations in test set predicted accurately with 5 percent point error margin – But: many locations had likelihood of either 1 or 0 – Improve others by improving branch prediction Estimating frequencies requires techniques to estimate loop frequencies – Use operations on loop variable to derive estimate  Use data flow information!

5 General Idea Use simplified version of existing branch prediction technique – Numeric range propagation, Patterson’s study indicated this leads to small but noticeable improvement – Computationally cheap variant: scalability is an issue, algorithms must cope with large software stacks (up to 5MLoC)

6 General Idea: More Specific Track potential value ranges of all integer variables – Value range propagation as generalization of constant propagation Use known ranges to improve estimates for conditions in which the corresponding variables occur Use ranges and operations on loop variables to estimate loop frequency

7 Application Loop variable a has ranges [6[0:5]] Variable b has ranges [3[1],3[3:5]] Point of interest has frequency 3 Of all conditions in the test set, 8% had complete variable value info a = 5 ; whi l e (a >= 0) { i f (a < 3) { b = 1 ; } else { b = a ; } i f (b > 2) { / * point of interest */ } a−−; }

8 Findings Simple data flow propagation algorithm only adds linear time overhead to previous solution However, simple data flow does not add significant information over type-based heuristics – Notably, the number of branches benefiting is limited Most likely culprits for differences with earlier study: – Numeric ranges instead of (simple) symbolic ones – Context-insensitivity instead of procedure cloning

9 Summary Does data flow analysis for profiling work? – Previous control flow based solution works just as well – It is scalable, but it does not add value  Can data flow analyses increase accuracy of static profiling and remain scalable?


Download ppt "Data Flow in Static Profiling Cathal Boogerd, Delft University, The Netherlands Leon Moonen, Simula Research Lab, Norway ?"

Similar presentations


Ads by Google