Thumb2 code size improvements
Yao Qi
yao.qi at linaro.org
Tue Sep 7 13:01:33 BST 2010
Andrew Stubbs wrote:
> On 06/09/10 07:16, Yao Qi wrote:
>> I've put some ideas in this wiki page,
>> https://wiki.linaro.org/Internal/People/YaoQi/Thumb2Optimize
>
> We probably shouldn't post Internal links to this public list. Is there
> any reason this can't be done in the open?
I've moved this page to a public place
https://wiki.linaro.org/YaoQi/Sandbox/Thumb2SizeOptimize
> Now for the page content ....
>
> I think you should make clear that we're after _size_ optimizations in
> this case, if just for readability's sake.
>
> 1. This example (regardless of correctness) gains no size improvement.
>
OK, I should remove this one.
> 2. This code is clearly an inlined memset. It might be that a branch
> instruction with constants and such is not (much) smaller. We should
> investigate what GCC does for different size writes.
>
Yeah, I agree that we should investigate how gcc does for different size.
> 3. This sounds like a nightmare for register allocation, but if you
> could make it happen then great :)
>
> ....
>
> 6. Is that an EEMBC function? We can't change those in the source. Are
> you proposing a -fwhole-program optimization? (Of course, enabling
> inlining at -Os for trivial functions like this might work without
> -fwhole-program or LTO, if it's in the same TU.)
>
Yes, that is an EEMBC function. Of course, we can't change source code.
It is not related to thumb2 code size optimization. I've moved it to
another section.
> Other ideas:
>
> * https://bugs.launchpad.net/gcc-linaro/+bug/625233
Add it in this wiki page.
> * Investigate reduced alignment constraints?
Any details on this?
More information about the linaro-toolchain
mailing list