public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/110932] [14 Regression] Dead Code Elimination Regression since r14-2230-g7e904d6c7f2
Date: Sat, 19 Aug 2023 14:01:27 +0000	[thread overview]
Message-ID: <bug-110932-4-yfei7Fzg7B@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110932-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110932

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> So the general rule is:
> (simplify
>  (eq:c @0 (convert (cmp @1 @2)))
>  (if (bitwise_equal_p (@0, @1))
>  (with {
>     bool zeroalwaystrue = ...
>     bool zeroalwaysfalse = ...
>     bool onealwaystrue = ...
>     bool onealwaysfalse = ...
>   }
>   (switch
>    (if (zeroalwaystrue && onealwaystrue)
>     (le @0:unsigned { one(unsigned); } )) // @0 == 0 | @0 == 1
>    (if (zeroalwaysfalse && onealwaysfalse )
>     { false_bool; }) // false
>    (if (zeroalwaystrue && onealwaysfalse)
>     (eq @0 { zero(TREE_TYPE(@0)); })) // @0 == 0
>    (if (onealwaystrue && onealwaysfalse)
>     (eq @0 { one(TREE_TYPE(@0)); })) // @0 == 1

If we want to do this only in VRP, we could just use match to match the
sequence and then handle the comparison there ...

  parent reply	other threads:[~2023-08-19 14:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 10:42 [Bug tree-optimization/110932] New: " theodort at inf dot ethz.ch
2023-08-07 12:08 ` [Bug tree-optimization/110932] " rguenth at gcc dot gnu.org
2023-08-19 13:59 ` pinskia at gcc dot gnu.org
2023-08-19 14:01 ` pinskia at gcc dot gnu.org [this message]
2024-03-07 23:25 ` law at gcc dot gnu.org
2024-05-07  7:41 ` [Bug tree-optimization/110932] [14/15 " rguenth at gcc dot gnu.org

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=bug-110932-4-yfei7Fzg7B@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).