21.01.2013 Views

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

Lecture Notes in Computer Science 4917

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Aggressive Function Inl<strong>in</strong><strong>in</strong>g: Prevent<strong>in</strong>g Loop Block<strong>in</strong>gs 389<br />

5. Sort CG <strong>in</strong> topological order.<br />

6. Traverse the sorted graph from the root <strong>in</strong> descend<strong>in</strong>g order. For each function<br />

f:<br />

(a) Duplicate the code of function f for each of the call sites that have an<br />

outgo<strong>in</strong>g edge to f. All relevant <strong>in</strong>formation related to the copies of f<br />

(f1,f2,...), such as symbolic <strong>in</strong>formation, branch tables, traceback data,<br />

etc., are duplicated as well.<br />

(b) Update the selected call sites to f, tocallitscopies.<br />

(c) Update the weights of the edges <strong>in</strong> both the call graph and the control<br />

flow graphs of both f and its copies, to reflect the changes result<strong>in</strong>g from<br />

duplicat<strong>in</strong>g f. For example if a function f is called 100 times from g and<br />

200 times from h then the weights of the edges <strong>in</strong> each copy of f should<br />

be divided by this ratio as well.<br />

7. Traverse all the functions <strong>in</strong> CG start<strong>in</strong>g from the leaf functions <strong>in</strong> ascend<strong>in</strong>g<br />

order. For each function fi:<br />

Embed fi <strong>in</strong>to its call<strong>in</strong>g function g while elim<strong>in</strong>at<strong>in</strong>g the save, restore, call,<br />

and return <strong>in</strong>structions.<br />

8. Update CG and EG to reflect the changes result<strong>in</strong>g from <strong>in</strong>l<strong>in</strong><strong>in</strong>g f.<br />

2.1 ILB Experimental Results<br />

We implemented the various <strong>in</strong>l<strong>in</strong><strong>in</strong>g algorithms <strong>in</strong>to IBM FDPR-Pro - a postl<strong>in</strong>k<br />

optimization tool. Measurements were obta<strong>in</strong>ed on the SPEC CINT2000<br />

benchmark runn<strong>in</strong>g on platforms based on the follow<strong>in</strong>g processors:<br />

1. IBM Power4 that has a 64KB, direct mapped, L1 Instruction Cache with<br />

128-byte l<strong>in</strong>es.<br />

2. AMCC 440GX that has a 32KB, 64-way associative, L1 Instruction Cache<br />

with 32-byte l<strong>in</strong>es.<br />

In both measurements, FDPR-Pro was also used to collect the profil<strong>in</strong>g data by<br />

<strong>in</strong>strument<strong>in</strong>g the benchmarks and runn<strong>in</strong>g them on the tra<strong>in</strong> workload. Performance<br />

measurements were collected us<strong>in</strong>g the reference <strong>in</strong>put. The follow<strong>in</strong>g<br />

graphs compare ILB versus four <strong>in</strong>l<strong>in</strong><strong>in</strong>g methods:<br />

all - all executed functions that were somewhat hot.<br />

hot - all functions that are above the average heat.<br />

dom<strong>in</strong>ant - call sites that make more than 80% of the executed calls to the<br />

function.<br />

small - only small size functions.<br />

This was also repeated for the embedded CPU. The results <strong>in</strong> Figure 3 show<br />

that ILB improves the execution time by 10% compared to the other four methods.<br />

Note that the ILB almost never degraded the performance compared to<br />

the “base” case, while there are cases where small, hot and all reduced the performance.<br />

Note that dom<strong>in</strong>ant calls are a subset of ILB s<strong>in</strong>ce a hot call that is<br />

repeated <strong>in</strong> a hot cycle can not be dom<strong>in</strong>ant. This <strong>in</strong>dicates that ILB is safer than

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!