Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)

2017-02-23 Thread Bernd Schmidt
On 02/23/2017 10:27 PM, Jakub Jelinek wrote: Now successfully bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? LGTM. Bernd

Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)

2017-02-23 Thread Jakub Jelinek
On Thu, Feb 23, 2017 at 03:07:14PM +0100, Jakub Jelinek wrote: > On Thu, Feb 23, 2017 at 02:47:11PM +0100, Bernd Schmidt wrote: > > On 02/23/2017 02:36 PM, Jakub Jelinek wrote: > > > and both UNLT and GE can be reversed. But if the arguments of the > > > condition > > > are canonicalized, we run

Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)

2017-02-23 Thread Jakub Jelinek
On Thu, Feb 23, 2017 at 03:07:14PM +0100, Jakub Jelinek wrote: > On Thu, Feb 23, 2017 at 02:47:11PM +0100, Bernd Schmidt wrote: > > On 02/23/2017 02:36 PM, Jakub Jelinek wrote: > > > and both UNLT and GE can be reversed. But if the arguments of the > > > condition > > > are canonicalized, we run

Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)

2017-02-23 Thread Jakub Jelinek
On Thu, Feb 23, 2017 at 02:47:11PM +0100, Bernd Schmidt wrote: > On 02/23/2017 02:36 PM, Jakub Jelinek wrote: > > and both UNLT and GE can be reversed. But if the arguments of the condition > > are canonicalized, we run into: > > /* Test for an integer condition, or a floating-point comparison >

Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)

2017-02-23 Thread Bernd Schmidt
On 02/23/2017 02:36 PM, Jakub Jelinek wrote: and both UNLT and GE can be reversed. But if the arguments of the condition are canonicalized, we run into: /* Test for an integer condition, or a floating-point comparison in which NaNs can be ignored. */ if (CONST_INT_P (arg0) || (GE

Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)

2017-02-23 Thread Jakub Jelinek
On Thu, Feb 23, 2017 at 02:26:24PM +0100, Bernd Schmidt wrote: > On 02/23/2017 12:46 PM, Jakub Jelinek wrote: > > But as soon as we only have the (unlt (reg:DF 100) (reg:DF 97)), > > reversed_comparison_code fails on it: > > case UNLT: > > case UNLE: > > case UNGT: > > case UNGE: >

Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)

2017-02-23 Thread Bernd Schmidt
On 02/23/2017 12:46 PM, Jakub Jelinek wrote: But as soon as we only have the (unlt (reg:DF 100) (reg:DF 97)), reversed_comparison_code fails on it: case UNLT: case UNLE: case UNGT: case UNGE: /* We don't have safe way to reverse these yet. */ return UNKNOWN; I do ha

[PATCH] Improve ifcvt (PR tree-optimization/79389)

2017-02-23 Thread Jakub Jelinek
Hi! Uros noted in the PR that in many cases with floating point comparisons ifcvt fails to RTL if-convert or end up being RTL if-converted in worse way than it could be (e.g. something that ought to be noce_try_addcc optimizable is only if-converted using noce_try_cmove_arith, resulting in worse p