HPCwire

Leading HPC
Solution Providers




















HPCwire >> Features

Compilers and More: Industrial Strength Interprocedural Analysis


Page:  1  of  2
1 | 2   All  »  

Standard compiler optimization is no longer sufficient for competitive high performance computing. Here we discuss interprocedural analysis (IPA) or whole program analysis, its costs and benefits, and how it affects programmers.

Performance-sensitive programmers are accustomed to building their applications with compiler optimizations enabled. In the past, this might have been as simple as setting the -O option on the command line. Decades of research and experience on compiler analysis and code improvement have produced mature, reliable techniques, the vast majority of which focus on optimizing a single procedure at a time, using redundancy elimination, loop restructuring, register allocation, instruction scheduling, and so on. But it is not enough.

Current highly optimizing compilers all use some form of interprocedural or whole program analysis for best performance. At compile time, the compiler summarizes each procedure in the program; when all procedures are available, the compiler invokes an interprocedural analysis module to collect all the procedure summaries and propagates information from caller to callee and back. While this seems to break the advantages of separate compilation, it is done at link time. The procedures are then optimized using the new interprocedural information. Early implementations used programming environments or special build programs to manage the procedure summaries, which made it hard to migrate from traditional tools, such as make. Current methods are almost invisible, except for the extra time spent at the link step to generate better code using the extra information.

The importance of interprocedural analysis is demonstrated by looking at the SPEC CPU results page (http://www.spec.org/); the base flags for the various compilers all include IPA:

    IBM -O5 (implies -qipa)
    Intel -fast (implies -ipo)
    Pathscale -Ofast (implies -ipa)
    PGI -fast -Mipa=fast,inline
    SGI -Ofast=ip35 (implies -IPA)
    Sun -fast -xcrossfile

We ran the SPEC CPU2000 test suite using the PGI compiler with and without IPA. The performance improvements ranged up to 130 percent speedup, with a 7 percent speedup in the overall geometric mean, demonstrating that IPA is useful and critical to the performance of some applications.

One of the most useful and common benefits of IPA is automatic inlining of procedures, even across source files. Since the compiler has the whole program at link time, it can take a procedure from one object and inline it at a call site in another procedure. This typically reduces the cost of the procedure call, and allows the code for the inlined procedure to be better optimized since the calling context is explicit.

This can also be used to inline or generate special code for calls to system or math libraries. Until link time, it isn't always known what library a particular procedure will come from. Once it is known that fmax is resolved from libm.a, for instance, the compiler can replace the procedure call by fast inline code.

A less common technique is to create two or more versions of a procedure, each version optimized for a particular calling context. For instance, IPA may generate one version or clone to be optimized for the case when two C pointer arguments are known to be distinct, allowing more vectorization (for instance), and another version for the more general case. The compiler can be directed to replace some calls to the more optimized version where appropriate.

IPA can help optimize around procedure calls even when the call isn't inlined. IPA may be able to determine that the function is "pure," meaning that it does no I/O and doesn't read or write global variables. Code around calls to such functions can be moved above or below the call, since the call won't interfere with any other code in the caller. This gives the compiler more freedom when scheduling instructions or allocating registers.

Page:  1  of  2
1 | 2   All  »  

Article Tools

  • Print This Page
  • Bookmark This Article

Share Options

(Digg, Technorati, more)


Subscribe

Discussion

There are 0 discussion items posted.  

Sponsored Links

New Paper: Parallel Computing Without Parallel Programming
Learn how domain experts can run VHLL programs like MATLAB® on a variety of high-performance platforms without low-level reprogramming and how to work with the largest datasets and complex algorithms without sacrificing ease of use or reducing productivity.



Top Headlines

3D Seismic Data: Taking a Smarter Approach to Interpretation

Jul 09 | Engineer Live | The demand for computational tools to underpin the 3D seismic interpretation process has never been more apparent. Read more...

Engineering Unemployment Soared in 2Q to 8.6%

Jul 08 | EE Times | Unemployment for U.S. engineers has reached record levels, according to government figures. Read more...

Gartner Adjusts 2009 IT Spend Downward Again

Jul 08 | Network World | Global spending for 2009 projected to drop 6 percent, for a total of $3.2 trillion. Read more...

Concurrent and Parallel Are Not The Same

Jul 08 | Linux Magazine | Portability or efficiency? Neither is guaranteed when writing explicit parallel code. Read more...

800 TFLOP Real-Time Ray Tracing GPU Unveiled, Not for Gamers

Jul 07 | Ars Technica | Japanese company builds custom ASIC to accelerate real-time ray traced rendering for the auto industry. Read more...

Featured Whitepapers

Parallel Computing Without Parallel Programming

Jul 10 | | Engineers, scientists, and other domain experts depend on the productivity enabled by very high-level language (VHLL) tools like MATLAB® and Python. However, as datasets grow larger and programs get more sophisticated, ordinary desktop computers can no longer keep up. The paper explores how to run VHLL programs on high-performance platforms without low-level reprogramming. Work with large datasets and complex algorithms without sacrificing ease of use or reducing productivity.

Building High Performance Computing in a Green and Modular Solution Building Block

Apr 14 | | Many HPC IT departments are feeling the rising pressure to deliver more capacity computing and performance while trying to reduce the total cost of ownership. This white paper discusses how an environmentally-friendly and open-standards HPC building block based computing system using flexible interconnect options helps address capacity computing needs.

Multimedia

Webcast: Dell Expands HPC Access and Adoption with Intel Cluster Ready Program


Source: Addison Snell, GM/VP, Tabor Research; sponsored by Dell

Many organizations that could benefit from the use of HPC clusters find that it is complicated to get the systems up and running because of limited IT resources or the complexities of the clusters themselves. Learn how the Intel Cluster Ready program, for which Dell was an original partner, seeks to address this challenge for entry level and mid-range HPC users.

Video White Paper: Architecting a Better Network Storage Solution

BlueArc's Titan architecture represents an evolutionary step in file servers by creating a hardware-based file system that can scale bandwidth, IOPS, and overall data capacity well beyond conventional software-based devices. With its ability to virtualize a massive storage pool of up to four usable petabytes of tiered storage, Titan can scale with growing data requirements, offering a competitive advantage for businesses, researchers, or other enterprises seeking to better manage data growth while still ensuring optimal performance.

Webcast: HPC Development Solutions: Sun Studio & Sun HPC ClusterTools


Sun Studio Compilers and Tools and Sun HPC ClusterTools allow you to create high performance parallel applications for OpenSolaris, Solaris and Linux. Sun Studio Express 11/08 includes MPI performance analysis capabilities and full OpenMP 3.0 compiler support. Learn about all this and the latest in Sun HPC ClusterTools 8.1.

Special Feature: ISC'09

Newsletters

Stay informed! Subscribe to HPCwire email Newsletters.






HPC Job Bank


Featured Events

WORLDCOMP 2009
Data Mining Courses