Developer Guide and Reference

ID 767253
Date 10/31/2024
Public
Document Table of Contents

fvec-allow-scalar-stores, Qvec-allow-scalar-stores

Ensures vectorization of an explicit simd loop.

Syntax

Linux:

-fvec-allow-scalar-stores

-fno-vec-allow-scalar-stores

Windows:

/Qvec-allow-scalar-stores

/Qvec-allow-scalar-stores-

Arguments

None

Default

-fno-vec-allow-scalar-stores
or /Qvec-allow-scalar-stores-

Vectorization of explicit simd loops is not ensured.

Description

This option ensures vectorization of an explicit simd loop, such as one specified by #pragma omp simd.

This vectorization will occur even if the simd loop contains a store to a scalar variable that is not marked as private, lastprivate, or reduction.

The OpenMP* specification indicates that any store to a scalar variable in an explicit simd loop must be identified in the corresponding directive as either private, lastprivate, or reduction. Vectorization of a loop where this rule is violated may result in incorrect code being generated, especially if the scalar variable is reused within the loop. It is highly recommended that you follow the specification. However, if you are confident that this loop is safe to vectorize (i.e., you have received an incorrect error message), you can force vectorization to occur by specifying this option.

IDE Equivalent

None

Alternate Options

None

Examples

The following shows examples of using this option:

Linux

icpx -O3 -c -fvec-allow-scalar-stores simd.cpp -o simd.o

Windows

icx /O3 /c /Qvec-allow-scalar-stores simd.cpp -o simd.o