diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2014-11-20 15:54:56 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2014-11-20 15:54:56 +0100 |
commit | 43ae6da22f75cc705ce870c29e1bb7cc542020e0 (patch) | |
tree | f1ac1bac9afa5c63f149b1deda90d9630ae6c529 /gcc | |
parent | ddce04b8b9370d128bc890e27de8888c84250c5b (diff) | |
download | gcc-43ae6da22f75cc705ce870c29e1bb7cc542020e0.zip gcc-43ae6da22f75cc705ce870c29e1bb7cc542020e0.tar.gz gcc-43ae6da22f75cc705ce870c29e1bb7cc542020e0.tar.bz2 |
combine.c (combine_validate_cost): Always print the insn costs to the dump file.
* combine.c (combine_validate_cost): Always print the insn costs
to the dump file.
From-SVN: r217864
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/combine.c | 63 |
2 files changed, 30 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c6a04d..e8e6817 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-11-20 Segher Boessenkool <segher@kernel.crashing.org> + + * combine.c (combine_validate_cost): Always print the insn costs + to the dump file. + 2014-11-20 Richard Henderson <rth@redhat.com> PR target/63977 diff --git a/gcc/combine.c b/gcc/combine.c index 6a7d16b..d2415f8 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -914,48 +914,35 @@ combine_validate_cost (rtx_insn *i0, rtx_insn *i1, rtx_insn *i2, rtx_insn *i3, /* Disallow this combination if both new_cost and old_cost are greater than zero, and new_cost is greater than old cost. */ - if (old_cost > 0 && new_cost > old_cost) - { - if (dump_file) - { - if (i0) - { - fprintf (dump_file, - "rejecting combination of insns %d, %d, %d and %d\n", - INSN_UID (i0), INSN_UID (i1), INSN_UID (i2), - INSN_UID (i3)); - fprintf (dump_file, "original costs %d + %d + %d + %d = %d\n", - i0_cost, i1_cost, i2_cost, i3_cost, old_cost); - } - else if (i1) - { - fprintf (dump_file, - "rejecting combination of insns %d, %d and %d\n", - INSN_UID (i1), INSN_UID (i2), INSN_UID (i3)); - fprintf (dump_file, "original costs %d + %d + %d = %d\n", - i1_cost, i2_cost, i3_cost, old_cost); - } - else - { - fprintf (dump_file, - "rejecting combination of insns %d and %d\n", - INSN_UID (i2), INSN_UID (i3)); - fprintf (dump_file, "original costs %d + %d = %d\n", - i2_cost, i3_cost, old_cost); - } + int reject = old_cost > 0 && new_cost > old_cost; - if (newi2pat) - { - fprintf (dump_file, "replacement costs %d + %d = %d\n", - new_i2_cost, new_i3_cost, new_cost); - } - else - fprintf (dump_file, "replacement cost %d\n", new_cost); - } + if (dump_file) + { + fprintf (dump_file, "%s combination of insns ", + reject ? "rejecting" : "allowing"); + if (i0) + fprintf (dump_file, "%d, ", INSN_UID (i0)); + if (i1) + fprintf (dump_file, "%d, ", INSN_UID (i1)); + fprintf (dump_file, "%d and %d\n", INSN_UID (i2), INSN_UID (i3)); - return false; + fprintf (dump_file, "original costs "); + if (i0) + fprintf (dump_file, "%d + ", i0_cost); + if (i1) + fprintf (dump_file, "%d + ", i1_cost); + fprintf (dump_file, "%d + %d = %d\n", i2_cost, i3_cost, old_cost); + + if (newi2pat) + fprintf (dump_file, "replacement costs %d + %d = %d\n", + new_i2_cost, new_i3_cost, new_cost); + else + fprintf (dump_file, "replacement cost %d\n", new_cost); } + if (reject) + return false; + /* Update the uid_insn_cost array with the replacement costs. */ INSN_COST (i2) = new_i2_cost; INSN_COST (i3) = new_i3_cost; |