GCC Middle and Back End API Reference
graphite-optimize-isl.c File Reference

Functions

static isl_union_set * scop_get_domains ()
static isl_union_map * scop_get_dependences ()
static isl_basic_map * getTileMap ()
static isl_union_map * getScheduleForBand ()
static isl_map * getPrevectorMap (isl_ctx *ctx, int DimToVectorize, int ScheduleDimensions, int VectorWidth)
static isl_union_map * getScheduleForBandList ()
static isl_union_map * getScheduleMap ()
static int getSingleMap ()
static void apply_schedule_map_to_scop ()
bool optimize_isl ()

Variables

static bool DisableTiling = false
static bool EnablePollyVector = false
static const int CONSTANT_BOUND = 20

Function Documentation

static void apply_schedule_map_to_scop ( )
static
static isl_map* getPrevectorMap ( isl_ctx *  ctx,
int  DimToVectorize,
int  ScheduleDimensions,
int  VectorWidth 
)
static
   Create a map that pre-vectorizes one scheduling dimension.
  
   getPrevectorMap creates a map that maps each input dimension to the same
   output dimension, except for the dimension DimToVectorize. DimToVectorize is
   strip mined by 'VectorWidth' and the newly created point loop of
   DimToVectorize is moved to the innermost level.
  
   Example (DimToVectorize=0, ScheduleDimensions=2, VectorWidth=4):
  
   | Before transformation
   |
   | A[i,j] -> [i,j]
   |
   | for (i = 0; i < 128; i++)
   |    for (j = 0; j < 128; j++)
   |      A(i,j);
  
     Prevector map:
     [i,j] -> [it,j,ip] : it % 4 = 0 and it <= ip <= it + 3 and i = ip
  
   | After transformation:
   |
   | A[i,j] -> [it,j,ip] : it % 4 = 0 and it <= ip <= it + 3 and i = ip
   |
   | for (it = 0; it < 128; it+=4)
   |    for (j = 0; j < 128; j++)
   |      for (ip = max(0,it); ip < min(128, it + 3); ip++)
   |        A(ip,j);
  
   The goal of this transformation is to create a trivially vectorizable loop.
   This means a parallel loop at the innermost level that has a constant number
   of iterations corresponding to the target vector width.
  
   This transformation creates a loop at the innermost level. The loop has a
   constant number of iterations, if the number of loop iterations at
   DimToVectorize can be devided by VectorWidth. The default VectorWidth is
   currently constant and not yet target specific. This function does not reason
   about parallelism.  
     assert (0 <= DimToVectorize && DimToVectorize < ScheduleDimensions);
     Create an identity map for everything except DimToVectorize and map
     DimToVectorize to the point loop at the innermost dimension.  
     it % 'VectorWidth' = 0  
     it <= ip 
     ip <= it + ('VectorWidth' - 1) 
static isl_union_map* getScheduleForBand ( )
static
     It does not make any sense to tile a band with just one dimension.  
static isl_union_map* getScheduleForBandList ( )
static
   getScheduleForBandList - Get the scheduling map for a list of bands.
    
   We walk recursively the forest of bands to combine the schedules of the
   individual bands to the overall schedule. In case tiling is requested,
   the individual bands are tiled.  
static isl_union_map* getScheduleMap ( )
static

References scop::bbs, and poly_bb::domain.

static int getSingleMap ( )
static
static isl_basic_map* getTileMap ( )
static
   getTileMap - Create a map that describes a n-dimensonal tiling.
  
   getTileMap creates a map from a n-dimensional scattering space into an
   2*n-dimensional scattering space. The map describes a rectangular tiling.
  
   Example:
     scheduleDimensions = 2, parameterDimensions = 1, tileSize = 32
 
    tileMap := [p0] -> {[s0, s1] -> [t0, t1, s0, s1]:
                         t0 % 32 = 0 and t0 <= s0 < t0 + 32 and
                         t1 % 32 = 0 and t1 <= s1 < t1 + 32}
 
   Before tiling:
 
   for (i = 0; i < N; i++)
     for (j = 0; j < M; j++)
        S(i,j)
 
   After tiling:
 
   for (t_i = 0; t_i < N; i+=32)
     for (t_j = 0; t_j < M; j+=32)
        for (i = t_i; i < min(t_i + 32, N); i++)  | Unknown that N % 32 = 0
          for (j = t_j; j < t_j + 32; j++)        |   Known that M % 32 = 0
            S(i,j)
     We construct

     tileMap := [p0] -> {[s0, s1] -> [t0, t1, p0, p1, a0, a1]:
                        s0 = a0 * 32 and s0 = p0 and t0 <= p0 < t0 + 32 and
                        s1 = a1 * 32 and s1 = p1 and t1 <= p1 < t1 + 32}

     and project out the auxilary dimensions a0 and a1.  
         sX = aX * tileSize; 
         pX = sX; 
         tX <= pX 
         pX <= tX + (tileSize - 1) 
     Project out auxiliary dimensions.

     The auxiliary dimensions are transformed into existentially quantified ones.
     This reduces the number of visible scattering dimensions and allows Cloog
     to produces better code.  
bool optimize_isl ( )
static isl_union_set* scop_get_domains ( )
static
@verbatim 

A scheduling optimizer for Graphite Copyright (C) 2012-2013 Free Software Foundation, Inc. Contributed by Tobias Grosser tobia.nosp@m.s@gr.nosp@m.osser.nosp@m..es.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.

References scop::bbs, scop::context, and poly_bb::domain.


Variable Documentation

const int CONSTANT_BOUND = 20
static
bool DisableTiling = false
static
   getScheduleForBand - Get the schedule for this band.
  
   Polly applies transformations like tiling on top of the isl calculated value.
   This can influence the number of scheduling dimension. The number of
   schedule dimensions is returned in the parameter 'Dimension'.  
bool EnablePollyVector = false
static