Following on from:
http://gcc.gnu.org/ml/gcc/2011-08/msg00306.html
this patch stops the ARM and Thumb-2 rtx costs from giving SETs a base
cost of COSTS_N_INSNS (4). In current trunk, the main effect is to stop
ivopts from being excessively conservative in the number of ivopts that
it creates.
I measured the effect on an embedded benchmark, which showed some nice
improvements. (Results sent to Ramana privately.)
Tested on arm-linux-gnueabi. OK to install?
Richard
gcc/
* config/arm/arm.c (arm_rtx_costs_1): Don't modify the costs of SET.
(arm_size_rtx_costs): Likewise.
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c 2011-08-18 13:37:31.564814162 +0100
+++ gcc/config/arm/arm.c 2011-08-18 14:00:46.459791433 +0100
@@ -7399,6 +7399,9 @@ arm_rtx_costs_1 (rtx x, enum rtx_code ou
*total = COSTS_N_INSNS (4);
return true;
+ case SET:
+ return false;
+
default:
*total = COSTS_N_INSNS (4);
return false;
@@ -7746,6 +7749,9 @@ arm_size_rtx_costs (rtx x, enum rtx_code
*total = COSTS_N_INSNS (1) + 1;
return true;
+ case SET:
+ return false;
+
default:
if (mode != VOIDmode)
*total = COSTS_N_INSNS (ARM_NUM_REGS (mode));