The compiler schedules instructions most efficiently within extended basic blocks. These are code sequences which can contain conditional branches but have no entry points other than the first instruction. Specifically, minimize the use of branching instructions for the following:
To explicitly inform the compiler that none of your code will set errno, compile with the -qignerrno compiler option (automatically set with -O3 ).
To explicitly inform the compiler that none of your code will throw any exceptions, and therefore, that no exception-handling code needs to be generated, compile with the -qnoeh compiler option.
In addition, the optimal basic blocks remove dependencies between computations, so that the compiler sees each statement as entirely independent. You can construct a basic block as a series of independent statements or as a loop that repeatedly computes the same basic block with different arguments.
If you specify the -qhot=simd option, along with a minimum optimization level of -O2, the compiler can then vectorize these loops by applying various transformations, such as unrolling and software pipelining. See Removing possibilities for aliasing (C/C++), for additional strategies for removing data dependencies.