Re: [PATCH] Improve var_bound range test opt (PR tree-optimization/81655)

2017-08-03 Thread Richard Biener
On Thu, 3 Aug 2017, Jeff Law wrote: > On 08/03/2017 03:32 AM, Jakub Jelinek wrote: > > On Thu, Aug 03, 2017 at 10:58:07AM +0200, Richard Biener wrote: > >>> The reason why we punt is the unexpected _4 != 1 condition, the code > >>> is prepared to handle just _4 == 0 (or _4 != 0) where _4 == 0 is

Re: [PATCH] Improve var_bound range test opt (PR tree-optimization/81655)

2017-08-03 Thread Jeff Law
On 08/03/2017 03:32 AM, Jakub Jelinek wrote: > On Thu, Aug 03, 2017 at 10:58:07AM +0200, Richard Biener wrote: >>> The reason why we punt is the unexpected _4 != 1 condition, the code >>> is prepared to handle just _4 == 0 (or _4 != 0) where _4 == 0 is equivalent >>> to _4 != 1 for boolean type. >>

Re: [PATCH] Improve var_bound range test opt (PR tree-optimization/81655)

2017-08-03 Thread Jakub Jelinek
On Thu, Aug 03, 2017 at 10:58:07AM +0200, Richard Biener wrote: > > The reason why we punt is the unexpected _4 != 1 condition, the code > > is prepared to handle just _4 == 0 (or _4 != 0) where _4 == 0 is equivalent > > to _4 != 1 for boolean type. > > Hmm, I thought we had code to canonicalize b

Re: [PATCH] Improve var_bound range test opt (PR tree-optimization/81655)

2017-08-03 Thread Richard Biener
On Thu, 3 Aug 2017, Jakub Jelinek wrote: > Hi! > > For the PR81588 testcase, on targets with branch cost 1, we end up with: > b.0_1 = b; > _2 = (long long int) b.0_1; > a.1_3 = a; > _4 = _2 > a.1_3; > _5 = (int) _4; > if (a.1_3 < 0) > goto ; [36.00%] [count: INV] > else > go

[PATCH] Improve var_bound range test opt (PR tree-optimization/81655)

2017-08-03 Thread Jakub Jelinek
Hi! For the PR81588 testcase, on targets with branch cost 1, we end up with: b.0_1 = b; _2 = (long long int) b.0_1; a.1_3 = a; _4 = _2 > a.1_3; _5 = (int) _4; if (a.1_3 < 0) goto ; [36.00%] [count: INV] else goto ; [64.00%] [count: INV] [64.00%] [count: INV]: if (_4 !=