Example #1
0
/* Vectorize first loop in band that meets criteria */
int pluto_pre_vectorize_band(Band *band, int num_tiling_levels, PlutoProg *prog)
{
    int num, l;

    /* Band has to be the innermost band as well */
    if (!pluto_is_band_innermost(band, num_tiling_levels)) return 0;

    Ploop **loops;

    loops = pluto_get_loops_under(band->loop->stmts, band->loop->nstmts, 
            band->loop->depth + num_tiling_levels*band->width, prog, &num);

    for (l=0; l<num; l++) {
        if (!pluto_loop_is_parallel(prog, loops[l])) continue;
        int s, t, a;
        a = get_num_accesses(loops[l], prog);
        s = get_num_spatial_accesses(loops[l], prog);
        t = get_num_invariant_accesses(loops[l], prog);
        /* Vectorize only if each access has either spatial or temporal
         * reuse */
        /* if accesses haven't been provided, a would be 0 */
        if (a >= 1 && a == s + t) break;
    }

    if (l < num) {
        pluto_make_innermost(loops[l], prog);
        IF_DEBUG(printf("[Pluto] Loop to be vectorized: "););
Example #2
0
/* Vectorize first loop in band that meets criteria */
int pluto_pre_vectorize_band(Band *band, int num_tiling_levels, PlutoProg *prog)
{
    int nloops, l;

    /* Band has to be the innermost band as well */
    if (!pluto_is_band_innermost(band, num_tiling_levels)) return 0;

    Ploop **loops;

    loops = pluto_get_loops_under(band->loop->stmts, band->loop->nstmts, 
            band->loop->depth + num_tiling_levels*band->width, prog, &nloops);

    for (l=0; l<nloops; l++) {
        if (pluto_loop_is_vectorizable(loops[l], prog)) break;
    }

    if (l < nloops) {
        pluto_make_innermost_loop(loops[l], prog);
        IF_DEBUG(printf("[Pluto] Loop to be vectorized: "););