Xlanguage



Description of Xlanguage

  • begin/end directives:

    #pragma xlang begin
    for (i=..; i<..; i++) {
    ..
    }
    #pragma xlang end
    They surround the outermost loop where all transformations will apply. All loops must be normalized with an affectation i=.., a condition of the kind i<.. and an increment either like i++ or i=i+..

  • transformations: all loops are identified by their loop counter. All transformations can be put right after the outermost loop and they will be applied in sequence.

    #pragma xlang transform interchange(i,j) interchange loops i and j. Loops i and j must be perfectly nested (either i in j or j in i).

    #pragma xlang transform unroll(i,n) makes a partial unroll of loop i, with unroll factor n (n>0)

    #pragma xlang transform fission(i) fissions loop i. Several fissions are possible if the loop has more than 2 statements. All solutions are explored.

    #pragma xlang transform fusion(i,j) fusions loops i and j that must be in sequence. Lower and upper bounds must be the same (syntactically), and the increment as well.

    #pragma xlang transform stripmine(i,ii,n) strip mines loop i (with factor n) and creates a new inner loop ii.

    #pragma xlang transform tile(i,ii,n) same as strip mine, but the new loop ii is created at the innermost position of the loopnest.

    #pragma xlang transform [ transformation1, ... ] applies one of the transformations of the list (this is an OR). Transformations can be one of the previous ones (unroll(i,n), fission(i,j),fusion(i,j)...).

    #pragma xlang transform nop does nothing. Useful for OR construct

  • parameters

    #pragma xlang parameter X [val1,val2,...] defines X with possible values val1,val2...

    #pragma xlang parameter X [lowerval:upperval:stride] defines X with all possible values lowerval, lowerval+stride, ..., upperval

    There must be one parameter and one transform pragma.
    The xc compiler is built on top of tcc (tiny C compiler, from Fabrice Bellard). The compiler generates from a C file "filename.c" a file "filename_kernel.c" containing all versions explored. These are C files that can be compiled by a production compiler.
  • Documentation

    Description of Xlanguage can be found in the following papers. The downloadable version has only a subset of the features presented in these papers.

    Combining Experimental Search and Performance Model for Adaptive Optimization. Julien Jaeger and Denis Barthou. In Hipeac Workshop on Statistical and Machine Learning Approaches to Architectures and compilation, Paphos, Cyprus, January 2009. [ bib | .pdf ]

    Loop Optimization using Adaptive Compilation and Kernel Decomposition. Denis Barthou, Sebastien Donadio, Alexandre Duchateau, Patrick Carribault, and William Jalby. In ACM/IEEE Int. Symp. on Code Optimization and Generation, pages 170-184, San Jose, California, March 2007. IEEE Computer Society. [ bib | .pdf ]

    Iterative Compilation with Kernel Exploration. Denis Barthou, Sebastien Donadio, Alexandre Duchateau, William Jalby, and Eric Courtois. In Int. Workshop on Languages and Compilers for Parallel Computing, volume 4382 of Lect. Notes in Computer Science, pages 173-189, New Orleans, November 2006. Springer-Verlag. [ bib | .pdf ]

    A Language for the Compact Representation of Multiple Program Versions. Sebastien Donadio, James Brodman, Thomas Roeder, Kamen Yotov, Denis Barthou, Albert Cohen, Maria Garzaran, David Padua, and Keshav Pingali. In Int. Workshop on Languages and Compilers for Parallel Computing, volume 4339 of Lect. Notes in Computer Science, pages 136-151, Hawthorne, New York, October 2005. Springer-Verlag. [ bib | .pdf ]

    Download and installation

    xc-0.1.2.tgz

    xc-0.1.1.tgz

    xc-0.1.0.tgz

    Installation on a Linux machine:

    Install swiprolog, at least version 5.6.62 The executable "pl" must be called "pl" and be in your path.

    ./configure --pl-includepath={path of SWI-Prolog.h}
    make
    make install

    By default, xc will be installed in /usr/local/bin XC is distributed under the GNU Lesser General Public License (see COPYING file).