WHIRL

From Open64 Wiki

Jump to: navigation, search

Winning Hierarchical Intermediate Representation Language (WHIRL)

WHIRL is the intermediate language (IR) for the Open64 compiler and was originally developed for the SGI Pro64TM compiler. Using a common Intermediate Represenation Language enables a compiler to support multiple languages and multiple processor targets. The different frontends of the compiler translate the different languages into WHIRL which is then passed to the backend. The Open64 backend is composed of the following components:


WHIRL serves as the common interface between these components.

Five different levels of WHIRL are defined, and each optimization phase is defined to work at a specific level of WHIRL. The front-ends generate the highest level of WHIRL. Optimization proceeds together with the process of continuous lowering, in which a WHIRL 'lowerer' is called to translate WHIRL from the current level to the next lower level. At the end, the code generator translates the lowest level of WHIRL to its own internal representation that matches the target machine instructions.

The five levels of WHIRL are known as: Very high(VH), high(H), mid(M), low(L) and very low(VL) level WHIRL, respectively. Very High and High WHIRL preserve the high level control flow constructs, such as DO_LOOP, DO_WHILE, and IF. High WHIRL can be translated back to C and Fortran source code via whirl2c, whirl2f and whirl2f90 with only a minor loss of semantics. IPA, LNO and the PREOPT part of the global scalar optimizer operate in H WHIRL.

Personal tools