On 11/03/2010 05:39 PM, Yao Qi wrote:
Hi, I am backporint some patches from FSF mainline, which may improve Linaro 4.5 gcc on thumb2 speed.
The first one is done by Richard E. "Improve optimization to transform TST into LSLS" http://gcc.gnu.org/ml/gcc-patches/2010-06/msg02518.html After it applied to Linaro 4.5 tree, EEMBC speed number downgrades, while code size is reduced to some extent. The code difference is like this,
6801 ldr r1, [r0, #0] f831 3013 ldrh.w r3, [r1, r3, lsl #1] -f413 6f00 tst.w r3, #2048 ; 0x800 -f43f af41 beq.w cc <t_run_test+0xcc> +0518 lsls r0, r3, #20 +f57f af44 bpl.w cc <t_run_test+0xcc> 4610 mov r0, r2
Someone suggests that the slowdown might be caused by usage of r0 in first instruction. Since r0 is used in the first insn, the third insn lsls can't overwrite r0 until first insn ldr is done.
The second patch is Bernd's "Fix an if statement in arm_rtx_costs_1" http://gcc.gnu.org/ml/gcc-patches/2010-07/msg02096.html After this patch applied, EEMBC benchmark number is not changed. Shall we merge this patch to linaro 4.5 tree? I am inclined to merge it, but if you have concerns on this patch, let us discuss here.
As we discussed in the meeting yesterday, the criteria of us picking up upstreams patches is that patches don't slow down speed and don't increase code size.
Code size is not reduced either on A8. I'll re-test this patch on A9. If still no benefit either size or speed, we don't backport it to Linaro 4.5.