From: Andrew MacLeod <amacleod@redhat.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Cc: "hernandez, aldy" <aldyh@redhat.com>,
Jakub Jelinek <jakub@redhat.com>,
Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PATCH 2/2] tree-optimization/108447 - Add VREL_OTHER for FP unsupported relations.
Date: Mon, 23 Jan 2023 12:45:48 -0500 [thread overview]
Message-ID: <50dff5bb-6306-ad20-0d44-7ed308bba85d@redhat.com> (raw)
In-Reply-To: <c60c2794-f726-29cc-45fd-54149ffce169@redhat.com>
Sorry should have mention the PR
On 1/23/23 12:44, Andrew MacLeod wrote:
> This patch adds VREL_OTHER to represent another relation we do not
> understand. It is used to represent the class fo relations arising
> from floating point that are currently not represented. IN GCC 14 we
> will determine exactly how to represent them, but for this release,
> this should prevent us from getting things wrong at least.
>
> if intersection produces UNDEFINED and either of the relations feeding
> it were <, <=, >, or >= then it turns it to VR_OTHER. the prevents
> false sides of branches from combining to produce UNDEFINED when they
> end up being a known NAN.
>
> Union is adjusted such that < >, or <= >= also produce VREL_OTHER. <
> > cannot be properly represented, and <= >= was producing VARYING,
> which is also not correct.
>
> Form the testcase:
>
> <bb 2> :
> cmp1_10 = x_8(D) <= y_9(D);
> cmp2_11 = x_8(D) >= y_9(D);
> _3 = cmp1_10 & cmp2_11;
> if (_3 != 0)
> goto <bb 3>; [INV]
> else
> goto <bb 4>; [INV]
>
> Relational : (x_8(D) == y_9(D))
> <bb 3> :
> // predicted unlikely by early return (on trees) predictor.
> goto <bb 6>; [INV]
>
>
> <bb 4> :
> _4 = ~cmp1_10;
> _5 = ~cmp2_11;
> _1 = cmp1_10 | cmp2_11;
> _6 = ~_1;
> if (_1 != 0)
> goto <bb 6>; [INV]
> else
> goto <bb 5>; [INV]
>
> Relational : (x_8(D) unknown fp y_9(D))
> <bb 5> :
> // predicted unlikely by early return (on trees) predictor.
>
>
> The intersection "fix" is represented by the relation between x and y
> in BB5. Without the patch, ti would be UNDEFINED and we do not want
> that.
>
> The union fix is what prevents us from folding the condition in bb_4.
> Without it, x<=y union x >=y comes out VARYING, when in fact I believe
> it represents everything except a NAN.
>
> So with this fix, all the unrepresentative relations get lumped into
> VREL_OTHER so we at least don't get it wrong. For next release we can
> take the time to figure out exactly how we want to proceed.
>
> This is currently in testing on x86_64-pc-linux-gnu, and assuming it
> bootstraps with no regressions (a combined patch did before splitting
> it in 2), OK for trunk? OR does it need more tweaking?
>
> Andrew
next prev parent reply other threads:[~2023-01-23 17:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 17:44 [PATCH 2/2] " Andrew MacLeod
2023-01-23 17:45 ` Andrew MacLeod [this message]
2023-01-24 8:55 ` Richard Biener
2023-01-24 10:05 ` Jakub Jelinek
2023-01-24 15:57 ` Andrew MacLeod
2023-01-25 11:15 ` Jakub Jelinek
2023-01-25 14:30 ` Andrew MacLeod
2023-01-25 14:48 ` Jakub Jelinek
2023-01-25 16:12 ` Andrew MacLeod
2023-01-25 22:35 ` Jakub Jelinek
2023-01-25 23:23 ` Andrew MacLeod
2023-01-25 23:27 ` Jakub Jelinek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50dff5bb-6306-ad20-0d44-7ed308bba85d@redhat.com \
--to=amacleod@redhat.com \
--cc=aldyh@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).