Re: [PATCH] Improve debug info in ivopts optimized loops (PR debug/90231)

2019-10-23 Thread Bin.Cheng
On Tue, Oct 22, 2019 at 3:32 PM Jakub Jelinek wrote: > > On Mon, Oct 21, 2019 at 01:24:30PM +0200, Jakub Jelinek wrote: > > So I wonder if for correctness I don't need to add: > > > > if (!use->iv->no_overflow > > && !cand->iv->no_overflow > > && !integer_pow2p (cstep)) > > retur

Re: [PATCH] Improve debug info in ivopts optimized loops (PR debug/90231)

2019-10-22 Thread Jakub Jelinek
On Mon, Oct 21, 2019 at 01:24:30PM +0200, Jakub Jelinek wrote: > So I wonder if for correctness I don't need to add: > > if (!use->iv->no_overflow > && !cand->iv->no_overflow > && !integer_pow2p (cstep)) > return NULL_TREE; > > with some of the above as comment explaining why. >

Re: [PATCH] Improve debug info in ivopts optimized loops (PR debug/90231)

2019-10-21 Thread Jakub Jelinek
On Mon, Oct 21, 2019 at 06:41:46PM +0800, Bin.Cheng wrote: > The overflow check is difficult, IIUC, checks on bit precision in the > patch is not enough? Considering an unsigned 64-bit candidate with I think it can cover some cases, especially on 64-bit targets, but will leave other cases out. I

Re: [PATCH] Improve debug info in ivopts optimized loops (PR debug/90231)

2019-10-21 Thread Bin.Cheng
On Sat, Oct 19, 2019 at 2:27 PM Jakub Jelinek wrote: > > Hi! > > As mentioned in the PR, the following patch attempts to address two issues. > In remove_unused_ivs we first find the best iv_cand (we prefer primarily the > same step, next same mode and lastly constant base) and only then call > get

Re: [PATCH] Improve debug info in ivopts optimized loops (PR debug/90231)

2019-10-19 Thread Jakub Jelinek
On Sat, Oct 19, 2019 at 08:27:31AM +0200, Jakub Jelinek wrote: > And as questioned in the PR, are there other cases where we can safely > assume no wrap (e.g. use it if use->iv->no_overflow && cand->iv->no_overflow > without those extra precision checks)? Like, is there a way to find out if an iv_

[PATCH] Improve debug info in ivopts optimized loops (PR debug/90231)

2019-10-18 Thread Jakub Jelinek
Hi! As mentioned in the PR, the following patch attempts to address two issues. In remove_unused_ivs we first find the best iv_cand (we prefer primarily the same step, next same mode and lastly constant base) and only then call get_computation_at to determine the replacement expression. Unfortuna