Changing loop unrolling maximum increment bound highly increase code size.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Changing loop unrolling maximum increment bound highly increase code size.

1,029 次查看
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

标签 (1)
0 项奖励
回复
1 回复

843 次查看
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 项奖励
回复