# GAP Message (Diagnostic ID 30506)

### Note

This feature is only available for ifort.

## Message

If the following operations(s) can be safely performed unconditionally, the loop at line %d will be vectorized by adding a "%s ivdep" statement right before the loop: %s.

## Advice

Add "!DIR$ IVDEP" before the specified loop.

This directive enables the vectorization of the loop at the specified line. Insure that any conditional divide, sqrt, and inverse sqrt operations will not alter the exception semantics expected by the program when they are performed unconditionally.

## Example

Consider the following:

    subroutine foo(a, n)
      integer n
      real a(n)
      do i=1,n
        if (a(i) .gt. 0) then
          a(i) = 1 / a(i)
        endif
      enddo
    end

In this case, the compiler is unable to vectorize the loop since the condition "a(i) .gt. 0" may be guarding floating-point exceptions for the divide.

If you determine it is safe to do so, you can add the directive as follows:

    subroutine foo(a, n)
      integer n
      real a(n)
    !dir$ ivdep
      do i=1,n
        if (a(i) .gt. 0) then
          a(i) = 1 / a(i)
        endif
      enddo
    end

## Verify

Confirm that the program operands have safe values for all iterations.

Parent topic: Guided Auto Parallelism Messages