------- Comment #19 from eyal at geomage dot com  2008-02-10 07:42 -------
Hi,  
  This is the simplest test I have.

#include <iostream>
#include <stdio.h>
#include <stdlib.h>

typedef float ARRTYPE;

int main ( int argc, char *argv[] )
{
        int m_nSamples = atoi( argv[1] );
        int itBegin = atoi( argv[2] );
        int itEnd = atoi( argv[3] );
        int iSizeMain = atoi( argv[ 4 ] );
        ARRTYPE *pSum1 = new ARRTYPE[ 100000 ];
        ARRTYPE *pSum = new ARRTYPE[ 100000 ];
        for ( int it = 0; it < m_nSamples; it++ )
        {
                pSum[ it ] = it / itBegin;
                pSum1[ it ] = itBegin / ( it + 1 );
        }
        ARRTYPE *pVec1 = (ARRTYPE*) malloc (sizeof(ARRTYPE) *m_nSamples);
        ARRTYPE *pVec2 = (ARRTYPE*) malloc (sizeof(ARRTYPE) *m_nSamples);
        for ( int i = 0; i < m_nSamples - 5; i++ )
        {
            for( int it = itBegin; it < itEnd; it++ )
                pVec1[ it ] += pSum[ it ] + pSum1[ it ];        
        }
        free( pVec1 );
        free( pVec2 );
}

// Test - Vectorized binary, TestNoVec - Non vectorized binary
time ./Test 90000 1 89900 1
real    0m23.273s

time ./TestNoVec 90000 1 89900 1
real    0m24.344s


This is the compiler output I found relevant, please let me know if you need
more information.

Test.cpp:24: note: dependence distance modulo vf == 0 between *D.22310_50 and
*D.22310_50
Test.cpp:24: note: versioning for alias required: can't determine dependence
between *D.22312_54 and *D.22310_50
Test.cpp:24: note: mark for run-time aliasing test between *D.22312_54 and
*D.22310_50
Test.cpp:24: note: versioning for alias required: can't determine dependence
between *D.22314_58 and *D.22310_50
Test.cpp:24: note: mark for run-time aliasing test between *D.22314_58 and
*D.22310_50
Test.cpp:24: note: create runtime check for data references *D.22312_54 and
*D.22310_50
Test.cpp:24: note: create runtime check for data references *D.22314_58 and
*D.22310_50
Test.cpp:24: note: created 2 versioning for alias checks.
Test.cpp:24: note: LOOP VECTORIZED.(get_loop_exit_condition


D.22310_50 = pVec1_37 + D.22309_49;
D.22312_54 = pSum_20 + D.22309_49;
D.22314_58 = pSum1_18 + D.22309_49;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35117

Reply via email to