Changing loop unrolling maximum increment bound highly increase code size.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing loop unrolling maximum increment bound highly increase code size.

435 Views
freerunner
Contributor I

I would like to adopt the loop unrolling with simple "for" statements, with a counter increase upper bound of 18 (instead of using the default: 16) but what I see building my program is that the code size is highly increased instead of decreasing.

 

How can this happen?

 

What i've done is just putting the command "i18" in the project settings of loop unrolling and using #PRAGMA LOOP_UNROLL before the for loop I would like to unroll.

 

Thanks in advance

Labels (1)
0 Kudos
1 Reply

249 Views
NavidadRedivivu
Contributor III

Check how loop unrolling works. The compiler manual contains quite good examples. Wikipedia helps too. What loop unrolling does is to inline each iteration of the loop, giving up the loop control instructions, thus resulting in faster but usually much larger code.

0 Kudos