Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is loop unrolling off by default in XCode?

It seems the Unroll Loops optimization settings under the Apple LLVM 8.0 - Code Generation section is turned off by default in the latest XCode, 8.2.1, even for the Release configuration. Any good reason for that? I thought loop unrolling was one of the most basic optimizations.

like image 451
Danra Avatar asked Mar 20 '26 20:03

Danra


1 Answers

It seems it is disabled to avoid increasing the size of the generated code.

Tuning for Performance and Responsiveness

Table 6-1 Compiler optimization options

Faster

The compiler performs nearly all supported optimizations that do not require a space-time tradeoff. The compiler does not perform loop unrolling or function inlining with this option. This option increases both compilation time and the performance of generated code.

Fastest

The compiler performs all optimizations in an attempt to improve the speed of the generated code. This option can increase the size of generated code as the compiler performs aggressive inlining of functions. This option is generally not recommended.

like image 125
lcs Avatar answered Mar 23 '26 08:03

lcs