RELEASE ------- Cetus 1.2.1 (September 10, 2010) Cetus is a source-to-source compiler infrastructure for C written in Java. http://cetus.ecn.purdue.edu. This release is a minor one that includes updates for bug fixes since version 1.2. If you are interested in the OpenMP-to-CUDA package, check readme.omp2gpu for more details. FEATURES/UPDATES ---------------- * Bug fixes version 1.2.1 - Fixed bugs in points-to analysis which misses points-to relationship when passing a whole global array as a parameter. - Fixed incorrect and inefficient use of alias analysis during data dependence analysis. - Fixed incorrect transformation in the following normalizing passes. Single-call transformation (-tsingle-call) Loop-normalization transformation (-normalize-loops) - Improved stability of the inline expansion transformation. - Several bug fixes in OpenMP-to-CUDA translator (see readme.omp2gpu). version 1.2 - Minimal support for GCC __asm__ extension. - K&R-style functions can be preserved in the output code with a command-line option. * New flags -alias=N Specify level of alias analysis =0 disable alias analysis =1 advanced interprocedural analysis (default) Uses interprocedural points-to analysis -normalize-return-stmt Normalize return statements for all procedures -range=N Specifies the accuracy of symbolic analysis with value ranges =0 disable range computation (minimal symbolic analysis) =1 enable local range computation (default) =2 enable inter-procedural computation (experimental) -preserve-KR-function Preserves K&R-style function declaration * Updated flags -ddt=N Perform Data Dependence Testing =1 banerjee-wolfe test (default) =2 range test -reduction=N Perform reduction variable analysis =1 enable only scalar reduction analysis (default) =2 enable array reduction analysis as well * Removed flags -argument-noalias -> merged into -alias flag -argument-noalias-global -> merged into -alias flag -no-alias -> merged into -alias flag -no-side-effect -> obsolete -normalize -> renamed as -normalize-loops -loop-interchange -> not active -loop-tiling -> not active * Experimental flags -tinline-expansion * Updates in cetus.hir package - Identifier and Symbol interface We found that management of identifiers and symbols in the previous version may introduce IR inconsistency when a transformation pass makes low-level modifications to the program IR, resulting in a descent amount of increase in development time. To alleviate this problem, we decided to choose consistency over flexibility in the Cetus IR. One important consistency-enhancing change is to protect low-level modifications related to symbol and identifiers. The followings list the outstanding differences from the previous Cetus IR. 1. Construction of an Identifier object from a string name is prohibited. An Identifier object should be created from a Symbol object that has been created before the Identifier is being created. 2. A new class, NameID, is used in place of Identifier when it needs direct name creation. Declaring variables, functions, and user types falls to this situation. 3. The link to the corresponding Symbol object is stored in an Identifier object, not in an IDExpression object. 4. Direct modification to the symbol look-up table in a SymbolTable object is prohibited. It is still possible to access the list of declarations and symbols through the newly added interface methods SymbolTable.getSymbols() and SymbolTable.getDeclarations(). - Protection of IR We also found many modification operations may allow reuse of a Traversable object that is already in the program IR, which should not be allowed. Typical examples of such operations are constructors and high-level modifiers of the IR classes. We revisited the implementation of such operations and provided a safety net by making them throw exceptions when they encounter such attempts. - IR comparison The comparison semantics of the base classes were clarified. We have been using Traversable objects in a collection without explicitly defined comparison methods. We provided implementation of equals() and hashCode() methods in the four base classes, Declaration, Declarator, Expression, and Statement. Expression is the only base IR that performs contents comparison, with the others performing identity comparison. - Comprehensive list of changes in cetus.hir package 1. Added NameID.java (see "Identifier and Symbol interface") 2. IDExpression.getSymbol() .setSymbol() were moved to Identifier.java 3. SymbolTable.getTable() was removed 4. Added containsSymbol(), containsDeclaration(), getSymbols(), and getDeclarations() in SymbolTable.java 5. Added getDeclaration() and setName() in Symbol.java 6. Added missing equals() and hashCode() methods in the base classes 7. Disabled addition of a DeclarationStatement object to a CompoundStatement object (respecting the C language) 8. Separated Tools.java into DataFlowTools, IRTools, PrintTools, SymbolTools, and Tools, following their semantics. Access to Tools method is still allowed but will throw "deprecated" warnings. 9. Added StandardLibrary.java for minimal support of standard library calls. * New analysis passes - Interprocedural analysis (IPA) Basic tools for performing interprocedural analysis are provided. The tools include call-graph/workspace generation and a set of simple solvers. The call-graph utility is implemented in IPAGraph, IPANode, and CallSite classes in the cetus.analysis package, and those classes represent a call graph, a node in the graph, and a call site in the graph respectively. Base framework for IPA is implemented in IPAnalysis, from which pass writers can instantiate their own IPA passes. The current version of Cetus uses this common framework to increase the capability of Range analysis and Points-to analysis. - Points-to analysis Cetus now provides a powerful pointer analysis framework through its implementation of an interprocedural points-to analyzer based on the design described in: "A practice interprocedural alias analysis for an optimizing/parallelizing C compiler", M. Emami, McGill University, 1993. PointsToAnalysis implements an intraprocedural flow-sensitive driver for this analyzer. Pointer relationships are created at every program point i.e. every Statement, through iterative work-list based traversal of the control flow graph provided by CFGraph. Data structure information and functionality for representing and handling these pointer relationships can be found in PointsToDomain, PointsToRel, UniverseDomain and the Symbol interface. The output of the intraprocedural analysis which is a map from Statement to PointsToDomain (set of points-to information), is used by the interprocedural analyzer. The interprocedural analysis of points-to relation was built upon the common interprocedural framework introduced in the current version. The role of the interprocedural analysis is to reflect the effect of entering or returning from a called procedure, by appropriately renaming the variables that appear in the points-to relations. The renaming algorithm is quite similar to one that appears in the reference implementation, but we adjusted the interprocedural driver so that it works on top of our common IPA framework. Currently, the IPA points-to analysis does not support full context sensitivity and gives up analysis of programs containing function calls through function pointers. Currently, we have extensively tested and verified the results of the points-to analysis framework on the SPEC OMP2001 (except ammp) and NPB benchmark suites. * Updates to Alias Analysis Cetus originally provided a simple conservative alias analysis pass that was flow and context insensitive. This analysis was supported by command-line flags that allowed manual input in order to improve interprocedural handling of alias information. With the addition of an interprocedural points-to analyzer to Cetus, the default for generating alias information is via the result provided by points-to analysis. Changes are reflected in the update to input flags outlined above. The API for accessing alias information via the analysis pass remains the same, and provides results whose accuracy is based on that provided by the points-to analyzer. * Automatic Parallelization updates 1. Improved alias information As outlined above, advanced interprocedural points-to analysis is used to provide more accurate 'statement-specific' alias information. This is used to its advantage by the dependence analysis framework, thus increasing the chances of disambiguation via alias information. The result is a significant increase in the number of loops identified by Cetus as parallel. 2. Field access disambiguation Cetus handles scalar dependences through the information provided by the privatization and reduction analysis passes. This release of Cetus handles disambiguation of fields inside aggregate structures more accurately, thus providing better loop parallelization. 3. Parallelization results Automatic interprocedural alias information significantly improves parallelization capabilities of Cetus. This is reflected strongly in the number of loops automatically parallelized using the Cetus infrastructure. * Normalize Return Statements This pass is a simple transformation added to this release of Cetus in order to normalize return statements inside procedures. This transformation simplifies one or more return statements inside the procedure by introducing a return variable. All expressions inside a return statement are then moved to an assignment to the new variable before the return statement. This ensures a simple return statement that does not modify program state and is specifically used in the interprocedural points-to analyzer in this release. NOTE: This transformation is different from the pre-existing SingleReturn pass in Cetus. * Deprecated features - cetus.analysis.NormalExpression - replaced by cetus.hir.Symbolic - cetus.hir.Simplifier - obsolete - cetus.hir.Tools - separated into five classes (see above) * OpenMP-to-CUDA Translation This release includes the alpha version of OpenMP-to-CUDA translator, which is built on top of Cetus compiler infrastructure. The current version of the translator is invoked separately with a customized driver, but we envision a Cetus driver that invokes the translator as one of translation passes in a future release. More information can be found in readme.omp2gpu file. CONTENTS -------- This Cetus release has the following contents. src - Cetus source code lib - Archived classes (jar) api - JAVA documents build.sh - Command line build script build.xml - Build configuration for Apache Ant readme - this file readme.omp2gpu - readme file for OpenMP-to-CUDA translator license - Cetus license REQUIREMENTS ------------ * JAVA 2 SDK, SE 1.5.x (or later) * ANTLRv2 * GCC INSTALLATION ------------ * Obtain Cetus distribution The latest version of Cetus can be obtained at: http://cetus.ecn.purdue.edu/ * Unpack Users need to unpack the distribution before installing Cetus. $ cd $ gzip -d cetus.tar.gz | tar xvf - * Build There are several options for building Cetus: - For Apache Ant users The provided build.xml defines the build targets for Cetus. The available targets are "compile", "jar", "clean" and "javadoc". Users need to edit the location of the Antlr tool. - For Linux/Unix command line users. Run the script build.sh after defining system-dependent variables in the script. - For SDK (Eclipse, Netbeans, etc) users Follow the instructions of each SDK. RUNNING CETUS ------------- Users can run Cetus in the following ways: $ java -classpath= cetus.exec.Driver The "user_class_path" should include the class paths of Antlr and Cetus. "build.sh" and "build.xml" provides a target that generates a wrapper script for Cetus users. TESTING ------- We have tested Cetus successfully using the following benchmark suites: * SPECCPU2006 More information about this suite available at www.spec.org * SPECOMP2001 More information about this suite available at www.spec.org * NPB3.0 More information about NAS Parallel Benchmarks at www.nas.nasa.gov/Software/NPB/ September 10, 2010 The Cetus Team URL: http://cetus.ecn.purdue.edu EMAIL: cetus@ecn.purdue.edu