diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2015-01-06 05:24:45 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2015-01-06 05:24:45 +0100 |
commit | 2f48c66c9deb7c5f008c8c6152aee28d18d4126a (patch) | |
tree | 9e4cdfb89303c96b905f1156e38dc42d40741a1d /gcc | |
parent | 0964f8458a88c8ce7ba37f6be05017933ac04fd0 (diff) | |
download | gcc-2f48c66c9deb7c5f008c8c6152aee28d18d4126a.zip gcc-2f48c66c9deb7c5f008c8c6152aee28d18d4126a.tar.gz gcc-2f48c66c9deb7c5f008c8c6152aee28d18d4126a.tar.bz2 |
combine.c (combine_validate_cost): Do not count the cost of a split I2 twice.
* combine.c (combine_validate_cost): Do not count the cost of a
split I2 twice. Do not display it twice in the dump, either.
From-SVN: r219216
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/combine.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b6c3be..e85a9fd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-05 Segher Boessenkool <segher@kernel.crashing.org> + + * combine.c (combine_validate_cost): Do not count the cost of a + split I2 twice. Do not display it twice in the dump, either. + 2015-01-05 Sandra Loosemore <sandra@codesourcery.com> Revert parts of r219199. diff --git a/gcc/combine.c b/gcc/combine.c index 6bdb3f4..8e78e18 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -885,6 +885,12 @@ combine_validate_cost (rtx_insn *i0, rtx_insn *i1, rtx_insn *i2, rtx_insn *i3, i1_cost = i0_cost = 0; } + /* If we have split a PARALLEL I2 to I1,I2, we have counted its cost twice; + correct that. */ + if (old_cost && i1 && INSN_UID (i1) == INSN_UID (i2)) + old_cost -= i1_cost; + + /* Calculate the replacement insn_rtx_costs. */ new_i3_cost = insn_rtx_cost (newpat, optimize_this_for_speed_p); if (newi2pat) @@ -924,14 +930,14 @@ combine_validate_cost (rtx_insn *i0, rtx_insn *i1, rtx_insn *i2, rtx_insn *i3, reject ? "rejecting" : "allowing"); if (i0) fprintf (dump_file, "%d, ", INSN_UID (i0)); - if (i1) + if (i1 && INSN_UID (i1) != INSN_UID (i2)) fprintf (dump_file, "%d, ", INSN_UID (i1)); fprintf (dump_file, "%d and %d\n", INSN_UID (i2), INSN_UID (i3)); fprintf (dump_file, "original costs "); if (i0) fprintf (dump_file, "%d + ", i0_cost); - if (i1) + if (i1 && INSN_UID (i1) != INSN_UID (i2)) fprintf (dump_file, "%d + ", i1_cost); fprintf (dump_file, "%d + %d = %d\n", i2_cost, i3_cost, old_cost); |