From: jgreenhalgh Date: Fri, 16 May 2014 08:45:39 +0000 (+0000) Subject: [AArch64 costs 3/18] Wrap aarch64_rtx_costs to dump verbose output X-Git-Tag: accepted/tizen/3.0.2015.q2/common/20150615.160009~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07feae7767448043248726ffdd24791d5d01ab6d;p=platform%2Fupstream%2Fgcc49.git [AArch64 costs 3/18] Wrap aarch64_rtx_costs to dump verbose output git cherry-pick e50295b gcc/ * config/aarch64/aarch64.c (aarch64_rtx_costs_wrapper): New. (TARGET_RTX_COSTS): Call it. Change-Id: I64b8e288ef331266768490df2ba28f57d7015ea6 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210495 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ec97d71..8900efc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2014-05-16 James Greenhalgh + * config/aarch64/aarch64.c (aarch64_rtx_costs_wrapper): New. + (TARGET_RTX_COSTS): Call it. + +2014-05-16 James Greenhalgh + * config/aarch64/aarch64.c (cortexa57_addrcost_table): New. (cortexa57_vector_cost): Likewise. (cortexa57_tunings): Use them. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 4639283..9b4b5c1 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -63,6 +63,7 @@ #include "cfgloop.h" #include "tree-vectorizer.h" #include "config/arm/aarch-cost-tables.h" +#include "dumpfile.h" /* Defined for convenience. */ #define POINTER_BYTES (POINTER_SIZE / BITS_PER_UNIT) @@ -4963,6 +4964,26 @@ aarch64_rtx_costs (rtx x, int code, int outer ATTRIBUTE_UNUSED, return false; } +/* Wrapper around aarch64_rtx_costs, dumps the partial, or total cost + calculated for X. This cost is stored in *COST. Returns true + if the total cost of X was calculated. */ +static bool +aarch64_rtx_costs_wrapper (rtx x, int code, int outer, + int param, int *cost, bool speed) +{ + bool result = aarch64_rtx_costs (x, code, outer, param, cost, speed); + + if (dump_file && (dump_flags & TDF_DETAILS)) + { + print_rtl_single (dump_file, x); + fprintf (dump_file, "\n%s cost: %d (%s)\n", + speed ? "Hot" : "Cold", + *cost, result ? "final" : "partial"); + } + + return result; +} + static int aarch64_register_move_cost (enum machine_mode mode, reg_class_t from_i, reg_class_t to_i)