summaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-29 20:06:55 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-29 20:06:55 +0000
commitc9a034873fd89eba1a96de59b1ae879bbbe09f0c (patch)
tree8cdfbb3965dc10b464f100060d3e2a0a64d4bd57 /gcc/rtlanal.c
parentba3a9f45a34a94378d50922c16bc77720736b57b (diff)
downloadgcc-c9a034873fd89eba1a96de59b1ae879bbbe09f0c.tar.gz
PR target/40457
* postreload.c (move2add_use_add2_insn): Use full_costs for comparison. (move2add_use_add3_insn): Likewise. (reload_cse_move2add): Likewise. * rtlanal.c (get_full_rtx_cost): New function. * rtl.h (struct full_rtx_costs): New. (init_costs_to_max, init_costs_to_zero, costs_lt_p, costs_add_n_insns): New inline functions. (get_full_rtx_cost): Declare. testsuite/ PR target/40457 * gcc.target/arm/pr40457-3.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164732 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index d34dc806009..930828ac2eb 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3589,6 +3589,17 @@ rtx_cost (rtx x, enum rtx_code outer_code ATTRIBUTE_UNUSED, bool speed)
return total;
}
+
+/* Fill in the structure C with information about both speed and size rtx
+ costs for X, with outer code OUTER. */
+
+void
+get_full_rtx_cost (rtx x, enum rtx_code outer, struct full_rtx_costs *c)
+{
+ c->speed = rtx_cost (x, outer, true);
+ c->size = rtx_cost (x, outer, false);
+}
+
/* Return cost of address expression X.
Expect that X is properly formed address reference.