Skip to content

PRF001 loop-not-vectorized ​

info opt-in

gfortran could not vectorise a loop (-fopt-info-vec-missed).

Why ​

A loop the compiler could not vectorise runs one element per instruction. The reason the compiler gives (a dependence, a non-contiguous access, a call it cannot inline) is reported with the finding. Many loops are not worth vectorising: this rule is informational and off by default; select it when tuning a hot spot. Reported only with fobis lint --compiler-feedback LOG (see the linting guide).

Reported ​

fortran
do i = 2, n
  y(i) = y(i) * y(i-1)      ! gfortran: missed: couldn't vectorize loop
end do

Suppressing ​

For one occurrence, with the reason on the same line (or alone on the line before the statement):

fortran
! fobis: ignore[PRF001] <why this occurrence is fine>

For the whole project, ignore = PRF001 in the fobos [lint] section.