This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>, Jan Hubicka <jh at suse dot cz>, Richard Henderson <rth at redhat dot com>
- Cc: Jeff Law <law at redhat dot com>, Segher Boessenkool <segher at kernel dot crashing dot org>, Eric Botcazou <ebotcazou at adacore dot com>, Uros Bizjak <ubizjak at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 Feb 2017 15:35:41 +0100
- Subject: Re: [PATCH] Improve ifcvt (PR tree-optimization/79389)
- Authentication-results: sourceware.org; auth=none
- References: <20170223114654.GE1849@tucnak> <a59c1160-ffe7-3ae0-bf2e-883a7d5f3029@redhat.com> <20170223133653.GF1849@tucnak> <a5cdea38-860c-e11e-d393-36e7b1177cd1@redhat.com> <20170223140714.GG1849@tucnak>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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 into:
> > > /* Test for an integer condition, or a floating-point comparison
> > > in which NaNs can be ignored. */
> > > if (CONST_INT_P (arg0)
> > > || (GET_MODE (arg0) != VOIDmode
> > > && GET_MODE_CLASS (mode) != MODE_CC
> > > && !HONOR_NANS (mode)))
> > > return reverse_condition (code);
> > > and thus always return UNKNOWN.
> >
> > So... do you think we could add (in gcc-8, probably, although if it fixes
> > this regression...)
> >
> > else if (GET_MODE (arg0) != VOIDmode
> > && GET_MODE_CLASS (mode) != MODE_CC
> > && HONOR_NANS (mode))
> > return reverse_condition_maybe_unordered (code);
> >
> > to make this work?
>
> Maybe, though I'd feel safer about trying it only in gcc 8. I can certainly
> test such a change on a couple of targets. It would not be sufficient, we'd
> either need to also reverse_condition_maybe_unordered for the UN* codes
> we don't handle yet, or break so that we perhaps reach this spot.
This stuff has been introduced with
http://gcc.gnu.org/ml/gcc-patches/2001-01/msg00454.html
where the initial submission indeed just returned
reverse_condition_maybe_unordered for UNLT etc.
but then Richard complained about that:
http://gcc.gnu.org/ml/gcc-patches/2001-01/msg00470.html
By keeping jump.c as is and just changing ifcvt.c we allow the targets
to say what exactly they do support and what is and what isn't reversible
through REVERSIBLE_CC_MODE and REVERSE_CONDITION macros.
Jakub