This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/4] Set costs for jumps in combine


Hi!

On Wed, Nov 13, 2019 at 02:13:48PM +0100, Bernd Schmidt wrote:
> The combiner is somewhat strange about how it uses costs. If any of the
> insns involved in a comparison have a cost of 0, it does not verify that
> the substitution is cheaper.

"Cost 0" means "unknown cost".  This isn't just combine, it is a property
of insn_cost (and insn_rtx_cost before it).  It does make it impossible
for combine to deal with actual zero cost things.

> Also, it does not compute costs for jump
> insns, so they are always set to zero. As a consequence, any possible
> substitution is performed if a combination into a jump is possible,
> which turns out isn't really desirable on m68k with cbranch patterns.
> 
> This patch simply removes a test for NONJUMP_INSN_P. Bootstrapped and
> tested on the gcc135 machine (powerpc64le-unknown-linux-gnu).

I wonder why that test was there.  It was added in r84513, which is where
insn_rtx_cost was made from combine_insn_cost, which didn't have that
non-jump thing yet.

It is still stage 1, so we'll find out if any target breaks I guess.
Okay for trunk.  Thanks!


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]