2.10. Optimization (Vector)

The following sections describe vector optimization options.

2.10.1. -h [no]ivdep (CC, cc Commands)

Default option: 

-h noivdep

The -h ivdep option instructs the compiler to ignore vector dependencies for all loops. This is useful for vectorizing loops that contain pointers. With -h noivdep, loop dependencies inhibit vectorization. To control loops individually, use the #pragma ivdep directive, as discussed in Section 4.7.1.

This option can also be used with "vectorization-like" optimizations on UNICOS/mk systems. See Section 4.7, for more information.

Caution
caution

This option should be used with extreme caution because incorrect results can occur if there is a vector dependency within a loop. Combining this option with inlining is dangerous because inlining can introduce vector dependencies.

2.10.2. -h vectorn (CC, cc Commands)

Default option: 

-h vector2

The -h vectorn option specifies the level of automatic vectorizing to be performed. Vectorization results in dramatic performance improvements with a small increase in object code size. Vectorization directives are unaffected by this option.

On UNICOS/mk systems, the C/C++ compiler can do "vectorization-like" optimizations on loops that contain calls to certain functions. These optimizations are enabled/disabled with this option. See Section 4.7, for more information on these optimizations.

Argument n can be one of the following:

n 

Description

0 

No automatic vectorization.

1 

Conservative automatic vectorization. On UNICOS systems, automatic vectorization is performed. Search loops and reduction loops are not vectorized.

2 

Moderate automatic vectorization. On UNICOS systems, automatic vectorization is performed as with vector1, and vectorization of search loops and reduction loops is added.

3 

Aggressive automatic vectorization. Automatic vectorization is performed as with vector2 and restructuring of loops is done to improve vectorization. Also, the aliasing assumptions specified in the standard are used (for example, it is assumed that no aliasing will occur between two pointers to different structure types). On UNICOS/mk systems, "vectorization-like" optimizations are performed. See Section 4.7, for more information.

Vectorization directives are described in Section 4.7.

2.10.3. -h [no]vsearch (CC, cc Commands)

Default option: 

-h vsearch

(UNICOS systems) The -h vsearch option enables vectorization of all search loops. With -h novsearch, the default vectorization level applies. The novsearch directive is discussed in Section 4.7.3. This option is affected by the -h vectorn option (see Section 2.10.2).