public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/100711] Miss optimization for pandn
Date: Tue, 25 May 2021 05:40:19 +0000	[thread overview]
Message-ID: <bug-100711-4-vPNtszoB7S@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100711-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---


(In reply to Segher Boessenkool from comment #2)
> (In reply to Richard Biener from comment #1)
> > I suppose we're confused about the vec_duplicate.  Would generally swapping
> > the duplicate and the bit_not be profitable?  Eventually it's a
> > simplification
> > combine could try - I belive it has some cases where it tries variants of the
> > original instructions when combining.  Adding a combine helper pattern
> > looks like putting too much burden on the backend IMHO.
> > 
> > We don't have a generic nand optab so handling this in ISEL on gimple
> > isn't straight-forward.
> > 
> > But combine and/or forwprop could do this.
> 
> Combine never tries anything.  Combine makes *one* result; if that does not
> work,
> it does not do the combination.  (This is not completely true, but in essence
> that is how it works, and it has to to not have exponential complexity).
> 
> It would be good to define a canonical form for anything vec_duplicate.  It
> probably is a good idea to pull the vec_duplicate as far outside as possible?
> 
> Canonical forms hugely reduce the amount of work needed.  Compare to how
> "andc"
> is represented (canonically with the inverted input first), or how "nand" is
> (we
> write that as an "orcc", an "or" with both inputs inverted, in canonical
> RTL).
> Because only one form is allowed, we only have to check for that one form
> everywhere.
> 
> Confirmed.

Even w/ canonical RTL, i think a combine splitter is also needed here, the
canonical RTL only helps combine/forwprop to match more possibility but won't
split patterns by itselies.

  parent reply	other threads:[~2021-05-25  5:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21  2:22 [Bug target/100711] New: " crazylht at gmail dot com
2021-05-21  6:42 ` [Bug target/100711] " rguenth at gcc dot gnu.org
2021-05-21 10:36 ` segher at gcc dot gnu.org
2021-05-25  5:40 ` crazylht at gmail dot com [this message]
2021-05-25  6:52 ` crazylht at gmail dot com
2021-05-25 10:09 ` segher at gcc dot gnu.org
2021-11-30  8:37 ` cvs-commit at gcc dot gnu.org
2021-11-30  8:46 ` crazylht at gmail dot com
2023-05-24  8:42 ` jbeulich at suse dot com
2023-05-25  6:52 ` crazylht at gmail dot com
2023-05-25  8:36 ` jbeulich at suse dot com
2023-05-25  8:50 ` crazylht at gmail dot com
2023-05-27  9:28 ` cvs-commit at gcc dot gnu.org
2023-07-05  7:49 ` cvs-commit at gcc dot gnu.org
2023-07-05  7:49 ` cvs-commit at gcc dot gnu.org
2023-07-05  7:49 ` cvs-commit 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-100711-4-vPNtszoB7S@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).