diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2025-04-15 06:08:36 +0200 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2025-04-17 05:09:36 +0200 |
commit | a4f81e168e02b0b1f8894070c6552b85672d4ee5 (patch) | |
tree | bd5e397e479fe26a239c1094321982633aa38139 /gcc | |
parent | ac31e41c584c59f8f2e381d545235a32b7c9e406 (diff) | |
download | gcc-a4f81e168e02b0b1f8894070c6552b85672d4ee5.zip gcc-a4f81e168e02b0b1f8894070c6552b85672d4ee5.tar.gz gcc-a4f81e168e02b0b1f8894070c6552b85672d4ee5.tar.bz2 |
combine: Correct comments about combine_validate_cost
Fix misleading comments. That function only determines whether
replacements cost more; it doesn't actually *validate* costs as being
cheaper.
For example, it returns true also if it for various reasons cannot
determine the costs, or if the new cost is the same, like when doing
an identity replacement. The code has been the same since
r0-59417-g64b8935d4809f3.
* combine.cc: Correct comments about combine_validate_cost.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/combine.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/combine.cc b/gcc/combine.cc index 5f08518..e118608 100644 --- a/gcc/combine.cc +++ b/gcc/combine.cc @@ -815,7 +815,7 @@ do_SUBST_LINK (struct insn_link **into, struct insn_link *newval) #define SUBST_LINK(oldval, newval) do_SUBST_LINK (&oldval, newval) /* Subroutine of try_combine. Determine whether the replacement patterns - NEWPAT, NEWI2PAT and NEWOTHERPAT are cheaper according to insn_cost + NEWPAT, NEWI2PAT and NEWOTHERPAT are more expensive according to insn_cost than the original sequence I0, I1, I2, I3 and undobuf.other_insn. Note that I0, I1 and/or NEWI2PAT may be NULL_RTX. Similarly, NEWOTHERPAT and undobuf.other_insn may also both be NULL_RTX. Return false if the cost @@ -4129,8 +4129,8 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, } } - /* Only allow this combination if insn_cost reports that the - replacement instructions are cheaper than the originals. */ + /* Reject this combination if insn_cost reports that the replacement + instructions are more expensive than the originals. */ if (!combine_validate_cost (i0, i1, i2, i3, newpat, newi2pat, other_pat)) { undo_all (); |