Readme
For
Open Research Compiler Release
2.1
Contents
How to download and prepare for the installation
How to install the pre-built cross compiler
How to install the pre-built native compiler
How
to build compilers from source
Known problems and limitations
Appendix A Problems and work arounds
ORC 2.1 is another significant milestone to ORC after the 2.0 release. The major focus of ORC 2.1 has been to improve its performance on Itanium-2 systems. As a result, the performance of ORC is comparable to that of the best Linux-based product compilers on both Itanium and Itanium 2 systems. The optimization levels we have compared include -O2, -O3, -IPA, combinations of the above and also with feedback information.
Major ORC 2.1 performance enhancements and features:
Cache optimizations: on Itanium-2, cache line/bank conflicts lead to non-trivial penalties. To reduce such cache conflicts, the compiler analyzes memory references w.r.t. their locations in cache lines and uses the analysis results to model the load latency and to avoid line/bank conflicts. We also adjust the cache modeling in several other optimizations, such as stride prefetching and LNO.
Loop-invariable code motion(LICM) in CG: in the 2.1 release, we add an LICM phase in CG in addition to the similar functionality existed in WOPT/PRE. This extra LICM phase can effectively move the loop-invariant computation introduced during or after the CG lowering phase out of loops.
Switch optimization: this optimization peels off the frequent cases in switch constructs and converts them to simple constructs with efficient comparisons.
De-vitualization of indirect calls: this feature is enhanced by a refined mechanism to match mangled function names in C++. Additional de-virtualizations for profitable cases are enabled.
Tuning of optimizations based on machine models: the machine models for both Itanium and Itanium 2 have existed in ORC 2.0. A number of optimizations have been further enhanced to take full advantage of machine models. More branches are scheduled into the same cycles to better utilize multi-way branch synthesis. Dispersal rules are better integrated into modulo scheduling to avoid split cycles. Include better heuristics to perform renaming during scheduling. We also obtained contributions from TsingHua University in Beijing to improve SWP and unrolling.
Inter-procedural RSE model: based on the work published by the ORC team at ICS03, ORC 2.1 includes an inter-procedural framework to balance RSE traffic and explicit spills. This feature currently requires a special option to turn on.
Pin: a tool for user-defined dynamic instrumentation. Pin, which is compiler independent, instruments an Itanium/Linux program while it is running. Pin provides an excellent mechanism to characterize program behaviors and to enable many post-link time optimizations. Contributed by our partners at Intel, the link of Pin will be available soon.
While we don't have a full repertoire of test suites at our disposal, we have done extensive testing to the best of timing and resources at our disposal. We also permute options when testing the test suites to increase our coverage. All critical bugs and issues have been fixed. Other less critical known problems and limitations are listed at the end of this note.
The latest
information and update for the ORC compilers can be found in http://sourceforge.net/projects/ipf-orc.
The packages included in this distribution represent a work in
progress.
Please send problem reports to http://sourceforge.net/projects/ipf-orc web site.
How to download and prepare for the installation
This release consists of two tar balls as listed bellow. You can download them from this URL:
http://sourceforge.net/projects/ipf-orc
Package Description orc-2.1-bin.tar.gz This tar ball contains both cross and native binary components.
The cross compiler works on IA-32 RedHat 7.2 and 7.3
The native compiler works on IA-64 Redhat 7.2orc-2.1-src.tar.gz Source tree diff. from pro64-0.01.0-13.
You may also need to download the following software:
Condition Action o. If you install cross ORC, or
o. if you want to build cross ORC from source codeYou need to install NUE first (NUE can be downloaded from http://www.software.hp.com/ia64linux)
ORC suite relies on the native header file and C pre-processor distributed with NUEo. if you install native ORC from orc-2.1-bin.tar.gz NONE
After installing NUE (in case you need to use the cross built ORC), make sure that the following 2 directories are linked properly (so that cross ORC also works outside NUE).
Condition Actionif /nue/usr/include/asm is a symbolic link change this link to /nue/usr/src/linux/include/asm, by:
cd /nue/usr/include
rm /nue/usr/include/asm
ln -sf /nue/usr/src/linux/include/asm asmif /nue/usr/include/linux is a symbolic link change this link to /nue/usr/src/linux/include/linux, by:
cd /nue/usr/include
rm /nue/usr/include/asm
ln -sf /nue/usr/src/linux/include/linux linux
Before installing the compiler, you should make sure that the following 3 environment variables are set properly, so that ORC v.2.1 is used by default:
Variable Name Purpose TOOLROOT Specify the root for ORC binaries hierarchy, e.g., $HOME/orc-2.1 COMP_TARGET_ROOT For cross compiler:
Specify the root for native archive hierarchy, so that cross ORC binaries will pick up native archives from $COMP_TARGET_ROOT/usr/ia64-orc-linux/lib,
For native compiler:
Native ORC binaries will pick up archives from $COMP_TARGET_ROOT/usr/lib. Normally, you need *NOT* set this variables for native ORC, so that ORC will use the archives in /usr/lib.PATH For native compiler:
Add $TOOLROOT/usr/bin to $PATH.
For cross compiler:
You should add $TOOLROOT/usr/ia64-orc-linux/bin to $PATH,
and make sure your $PATH satisfy the following 2 conditions (outside NUE)
1. Each time when you invoke orcc, $TOOLROOT/usr/ia64-orc-linux/bin/orcc is picked up
2. Each time you invoke as (or ld) from console, your original as (or ld) rather than $TOOLROOT/usr/ia64-orc-linux/bin/as(or ld) is used
How to install the pre-built cross compiler on IA32 machine
To install the cross ORC compiler (This binary release is prepared for RedHat 7.2 or higher version):
Download NUE and install it, you may need to reset the two symbolic links as described above
- Set environment variables properly as described above
- Download orc-2.1-bin.tar.gz from http://prdownloads.sourceforge.net/ipf-orc/orc-2.1-bin.tar.gz
- Expand it by "tar zxvf orc-2.1-bin.tar.gz"
Do "cd orc-2.1-bin; ./install.sh -c"
Here is an installation example:
Assume the account name is joesmith and the IA-32 RedHat 7.2 host name is rose, the login shell of joesmith is GNU BASH.
Pay attention to the HIGHLIGHTED part that should not be set for native compiler[joesmith@rose joesmith]$vi $HOME/.bashrc # set $TOOLROOT $COMP_TARGET_ROOT and $PATH
[joesmith@rose joesmith]$cat $HOME/.bashrc | grep "TOOLROOT\|PATH"
export TOOLROOT=$HOME/music
export COMP_TARGET_ROOT=$HOME/photo
export PATH=$PATH:$TOOLROOT/usr/ia64-orc-linux/bin[joesmith@rose joesmith]$source $HOME/.bashrc
[joesmith@rose joesmith]$tar zxvf orc-2.1-bin.tar.gz
[joesmith@rose joesmith]$cd orc-2.1-bin; ./install.sh -c
Note that the nue command will put you under your home directory inside NUE, which may not be your regular home directory. If you want to do cross compile inside NUE, you need to make sure that the ORC binaries are under a directory that is accessible under NUE.
ORC 2.1 release allows the users to produce IA64 binary on IA32 machines directly. Simply follow the install instructions to set the environment variables and install the pre-built native archives properly.
How to install the pre-built native compiler on IA64 machine
On an IA64 machine (This binary release is prepared for RedHat 7.2):
Set the environment variables properly as described above, NOTE: You need not set COMP_TARGET_ROOT
- Download orc-2.1-bin.tar.gz from http://prdownloads.sourceforge.net/ipf-orc/orc-2.1-bin.tar.gz
- Expand it by "tar zxvf orc-2.1-bin.tar.gz"
- do "cd orc-2.1-bin; ./install.sh -n"
Here is an installation example:
Assume the account name is joesmith and the IA-64 Redhat 7.2 host name is uranus, the login shell of joesmith is GNU BASH. [joesmith@uranus joesmith]$vi $HOME/.bashrc # set $TOOLROOT and $PATH
[joesmith@uranus joesmith]$cat $HOME/.bashrc | grep "TOOLROOT\|PATH"
export TOOLROOT=$HOME/music
export PATH=$PATH:$TOOLROOT/usr/bin[joesmith@uranus joesmith]$source $HOME/.bashrc
[joesmith@uranus joesmith]$tar zxvf orc-2.1-bin.tar.gz
[joesmith@uranus joesmith]$cd orc-2.1-bin; ./install.sh -n
You can verify your installation by doing a simple "hello world"
$cat hello.c
#include <stdio.h>
main()
{
printf("hello world\n");
}
1. First you
need to download the following software:
orc-2.1-src.tar.gz |
Source tree diff. from pro64-0.01.0-13, download from http://prdownloads.sourceforge.net/ipf-orc/orc-2.1-src.tar.gz |
NUE suite (either
1.0 or 1.1 or 2.0) NOTE: Only needed if you want to build the cross compiler. |
Can be downloaded
from http://www.software.hp.com/ia64linux |
pro64-0.01.0-13-sources.tar.gz |
Pro64 source tar
ball which can be downloaded from http://prdownloads.sourceforge.net/ipf-orc/pro64-0.01.0-13-sources.tar.gz |
2. If you want to build the cross compiler, download and install NUE.You may need to reset the two symbolic links as described above
3. Expand the orc-2.1-src.tar.gz, by "tar zxvf orc-2.1-src.tar.gz"
4. Do
"cd orc-2.1-src; ./install.sh"
5. Follow the instructions.
6.
Suppose you choose /home/somebody/somewhere as the root of the source
tree hierarchy .
To build the compiler, do "make -C /home/somebody/somewhere -f Make.cross (or Make.native for native compiler)".
ORC is -O2 built by default.
To build a debuggable version, do "make
BUILD_OPTIMIZE=DEBUG -C /home/somebody/somewhere -f Make.cross (or
Make.native)"
7. Normally, you need NOT to build the native archives, since
pre-built native archives are shipped with ORC v2.1 suite.
However, if you want to build those native archives, you can do the following
either inside NUE or IA-64 native environment:
make -C
/home/somebody/somewhere -f Make.NUE.lib
Some known problems are described in details below.
8. Invoke
home/somebody/somewhere/INSTALL.cross(.native) to install cross(native)
ORC
Known Problems
and limitations
We have tested the compilers to the best of our efforts. The following are known problems or areas that we have not done extensive testing:
1. __bzero problem: When using cross compiler and run on redhat7.2 or readhatAS2.1(or higher version ), it will report relocation error "symbol __bzero: version GLIBC_2.2 not defined in file libc.so.6.1 with link time reference". It is because ORC use old version gcc as frontend. When gcc version is smaller than 2.96, it will use __bzero instead of __memset. But __bzero can not be supported by redhat7.2 and RHAS2.1. You can solve the problem by adding "-D __GNUC_MINOR__=96" to compilation option. It can force to use __memset instead of __bzero.
2. Building native archives: If you want to rebuild the native archives, pay attention to the compatibility problem of libgcc.a and libstdc++.a. We recommend the users do the following if there is problem in using the version built from ORC source by default:
-- For cross ORC, use a working Gcc version on your IA32 machine to cross build the two libraries for IA64 target architecture.
-- For native ORC, use the version installed on your IA64 machine (normally in /usr/lib/gcc-lib/ia64-redhat-linux/<version_num>/").
If you have problems building other archives, you may try to modify the macro BUILD_COMPILER defined in the Makefile to GNU to see if it works on your system.
3. Building native compilers: With native O2-built wopt.so and be.so, some FP benchmarks may have compilation failures. Therefore, in native environment, the two .so are built with "-O0 -UIs_True_On" by default. While in cross environment, they are built in the same way as that of other components.
4. The "bfd assertion" warning: When compiling some programs with IPA turned on, the compiler may generate the following warning message: "bfd assertion fail ../../cygnus_20000828/bfd/elflink.h:1786". This is caused by the linkage to some libraries with incompatible format. Nevertheless, it will not affect the correctness of the compiled program.
A full description of other known compilation problem is listed in Appendix A.
For issues with
installation and usage of the compiler, we request that users first go through
the mail alias ipf-orc-support@lists.sourceforge.net.
This will help us respond to the issues in a more timely fashion without
dropping anyone. We also strongly suggest you to sign onto the ipf-orc-support@lists.sourceforge.
For issues related to the Pro64 compiler, please go to
mailing list mailto:open64-dev@lists.sourceforge.net.
1. Name of program: galgel
Option that cause failure: -O2/-O0
Description of problem: runtime mis-compare error. It can be avoided by compiling the .B files created by mfef90 with O3.
2. Name of program: gcc, eon
Option that cause failure: -O2 -fb_opt fb.mid -ipa
Description of problem: IPA-link fail (out of memery). If using gcc-2.91 and gcc-2.95.2 to build ORC, the problem does not exist. The problem only exists on gcc-2.96-build ORC.
We have benefited from postings, advices and fixes by many individuals. They have contributed to the success of this release. There are many to list and we are sure to have missed some. The friends of ORC list is an attempt to list those who have helped and is by no means exhaustive. We will continue to update this list, let us know if we missed you.
Copyright and Legal Information
Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.