Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2025-07-26 Thread Jeff Law
On 11/7/24 10:36 AM, Robin Dapp wrote: I think it'd be better if I abstain from this. I probably disagree too much with the current structure and the way that the code is developing. I won't object if anyone else approves it though. It's not that I'm happy with the current state either and

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-11-07 Thread Robin Dapp
> I think it'd be better if I abstain from this. I probably disagree too > much with the current structure and the way that the code is developing. > I won't object if anyone else approves it though. It's not that I'm happy with the current state either and I thought about how to rewrite it more

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-11-07 Thread Richard Sandiford
"Robin Dapp" writes: >>> If the problem is tracking liveness, wouldn't it be better to >>> iterate over the "then" block in reverse order? We would start >>> with the liveness set for the join block and update as we move >>> backwards through the "then" block. This liveness set would >>> tell us

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-11-07 Thread Robin Dapp
>> If the problem is tracking liveness, wouldn't it be better to >> iterate over the "then" block in reverse order? We would start >> with the liveness set for the join block and update as we move >> backwards through the "then" block. This liveness set would >> tell us whether the current instru

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-08-25 Thread Jeff Law
I think Manolis's patches are all in, time to revisit this one? On 6/12/24 1:54 AM, Robin Dapp wrote: Hmm, ok. The bit that confused me most was: if (last_needs_comparison != -1) { end_sequence (); start_sequence (); ... } which implied that the second at

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-12 Thread Robin Dapp
> Hmm, ok. The bit that confused me most was: > > if (last_needs_comparison != -1) > { > end_sequence (); > start_sequence (); > ... > } > > which implied that the second attempt was made conditionally. > It seems like it's always used and is an inherent part of the >

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-11 Thread Richard Sandiford
Robin Dapp writes: >> I was looking at the code in more detail and just wanted to check. >> We have: >> >> int last_needs_comparison = -1; >> >> bool ok = noce_convert_multiple_sets_1 >> (if_info, &need_no_cmov, &rewired_src, &targets, &temporaries, >> &unmodified_insns, &last_needs

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-11 Thread Robin Dapp
> I was looking at the code in more detail and just wanted to check. > We have: > > int last_needs_comparison = -1; > > bool ok = noce_convert_multiple_sets_1 > (if_info, &need_no_cmov, &rewired_src, &targets, &temporaries, > &unmodified_insns, &last_needs_comparison); > if (!ok) >

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-11 Thread Richard Sandiford
Robin Dapp writes: > The attached v3 tracks the use of cond_earliest as you suggested > and adds its cost in default_noce_conversion_profitable_p. > > Bootstrapped and regtested on x86 and p10, aarch64 still > running. Regtested on riscv64. > > Regards > Robin > > Before noce_find_if_block proce

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-11 Thread Robin Dapp
The attached v3 tracks the use of cond_earliest as you suggested and adds its cost in default_noce_conversion_profitable_p. Bootstrapped and regtested on x86 and p10, aarch64 still running. Regtested on riscv64. Regards Robin Before noce_find_if_block processes a block it sets up an if_info st

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-10 Thread Richard Sandiford
Robin Dapp writes: >> Is there any way we can avoid using pattern_cost here? Using it means >> that we can make use of targetm.insn_cost for the jump but circumvent >> it for the condition, giving a bit of a mixed metric. >> >> (I realise there are existing calls to pattern_cost in ifcvt.cc, >>

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-07 Thread Robin Dapp
> Is there any way we can avoid using pattern_cost here? Using it means > that we can make use of targetm.insn_cost for the jump but circumvent > it for the condition, giving a bit of a mixed metric. > > (I realise there are existing calls to pattern_cost in ifcvt.cc, > but if possible I think we

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-03 Thread Richard Sandiford
Robin Dapp writes: > Hi, > > before noce_find_if_block processes a block it sets up an if_info > structure that holds the original costs. At that point the costs of > the then/else blocks have not been added so we only care about the > "if" cost. > > The code originally used BRANCH_COST for that

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-06-01 Thread Stefan Schulze Frielinghaus
On Fri, May 31, 2024 at 10:05:55PM -0600, Jeff Law wrote: > > > On 5/31/24 9:03 AM, Robin Dapp wrote: > > Hi, > > > > before noce_find_if_block processes a block it sets up an if_info > > structure that holds the original costs. At that point the costs of > > the then/else blocks have not been

Re: [PATCH] ifcvt: Clarify if_info.original_cost.

2024-05-31 Thread Jeff Law
On 5/31/24 9:03 AM, Robin Dapp wrote: Hi, before noce_find_if_block processes a block it sets up an if_info structure that holds the original costs. At that point the costs of the then/else blocks have not been added so we only care about the "if" cost. The code originally used BRANCH_COST

[PATCH] ifcvt: Clarify if_info.original_cost.

2024-05-31 Thread Robin Dapp
Hi, before noce_find_if_block processes a block it sets up an if_info structure that holds the original costs. At that point the costs of the then/else blocks have not been added so we only care about the "if" cost. The code originally used BRANCH_COST for that but was then changed to COST_N_INS