Incorrect vectorization with -fpe0

Incorrect vectorization with -fpe0

I have already submitted this to support (6000054324) but wanted to post it here in case any one else runs across this.

The decision to vectorize a loop is dependent upon whether -fpe0 is included on the compile line.  The incorrect decision is made to vectorize the loop on line 24 when -fpe0 is present.  This is causing incorrect answers in our main code (this loop should not be vectorized), but the sample code provides correct answers.  The decision to not vectorize this loop has been made correctly with other versions of the Intel compiler (12, 13).  This happens in 14.01, 14.0.2 and 14.0.3.
 

For now I am using the work around of putting !DEC$ NOVECTOR before the loop.

If I compile the attached code with

$ ifort -c -vec-report3 vectortest.f90 -fpe0
vectortest.f90(15): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(16): (col. 5) remark: loop was not vectorized: vectorization possible but seems inefficient
vectortest.f90(17): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(18): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(19): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(20): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(20): (col. 5) remark: loop was not vectorized: not inner loop
vectortest.f90(24): (col. 5) remark: LOOP WAS VECTORIZED

If I compile with

$ ifort -c -vec-report3 vectortest.f90
vectortest.f90(15): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(16): (col. 5) remark: loop was not vectorized: vectorization possible but seems inefficient
vectortest.f90(17): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(18): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(19): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(20): (col. 5) remark: LOOP WAS VECTORIZED
vectortest.f90(20): (col. 5) remark: loop was not vectorized: not inner loop
vectortest.f90(24): (col. 5) remark: loop was not vectorized: existence of vector dependence
vectortest.f90(34): (col. 7) remark: vector dependence: assumed ANTI dependence between  line 34 and  line 34

AttachmentSize
Download vectortest.f90992 bytes
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Thank you for reporting this.  We'll investigate and follow up.

Patrick

This does appear to be a regression in the 14.0 compiler series, WRT 13.x or earlier compilers.  Somehow with -fpe0, the 14.0 has lost the ability to see the vector dependence for the loop at line 24.

 

As far as I can tell, this is an unknown issue.  I'll report it to the developers.

 

Patrick

Reported to compiler engineering with tracking ID DPD200357441.  Besides !DEC$ NOVECTOR, another workaround is to compile at -O1 or lower.

 

Patrick

Leave a Comment

Please sign in to add a comment. Not a member? Join today