This is the mail archive of the
mailing list for the GCC project.
Re: combiner: how to compute cost for bit insertion?
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 10 Jul 2017 16:40:20 -0500
- Subject: Re: combiner: how to compute cost for bit insertion?
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
On Mon, Jul 10, 2017 at 05:10:03PM +0200, Georg-Johann Lay wrote:
> Any ideas for a sane approach?
You could change insn_rtx_cost to actually calculate the cost of the
insn, not just set_src_cost of a single set. This will need checking
on a great many targets, not in the least because most target's cost
functions are, uh, not so good. Big project, but hopefully well worth
Or you change your cost function to on a QImode shift assume it is an
insert instruction. Not correct of course (but neither is the currently
calculated cost), but perhaps it gives good results in practice?