From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8E33D384C00B; Fri, 21 May 2021 10:36:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E33D384C00B From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100711] Miss optimization for pandn Date: Fri, 21 May 2021 10:36:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status everconfirmed cf_reconfirmed_on Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2021 10:36:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100711 Segher Boessenkool changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2021-05-21 --- Comment #2 from Segher Boessenkool --- (In reply to Richard Biener from comment #1) > I suppose we're confused about the vec_duplicate. Would generally swappi= ng > 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. >=20 > We don't have a generic nand optab so handling this in ISEL on gimple > isn't straight-forward. >=20 > 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 essen= ce 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 possibl= e? Canonical forms hugely reduce the amount of work needed. Compare to how "a= ndc" 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 RT= L). Because only one form is allowed, we only have to check for that one form everywhere. Confirmed.=