From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E87133858423; Mon, 7 Feb 2022 07:59:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E87133858423 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/104401] [x86] Failure to recognize min/max pattern using pcmp+pblendv Date: Mon, 07 Feb 2022 07:59:18 +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: enhancement X-Bugzilla-Who: rguenth 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: 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: Mon, 07 Feb 2022 07:59:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104401 --- Comment #5 from Richard Biener --- (In reply to Andrew Pinski from comment #3) > On a slightly different subject, I wish VCOND would print out the tree co= de > symbolically rather than just a number. It would be easier to understand > what the condition exec is really. Feel free to add a // comment after it ;) Btw, forwprop1 sees : _12 =3D VIEW_CONVERT_EXPR(value_3(D)); _13 =3D VIEW_CONVERT_EXPR(input_4(D)); _14 =3D _12 < _13; _15 =3D VEC_COND_EXPR <_14, { -1, -1, -1, -1 }, { 0, 0, 0, 0 }>; _16 =3D VIEW_CONVERT_EXPR<__m128i>(_15); _6 =3D VIEW_CONVERT_EXPR(_15); _5 =3D VIEW_CONVERT_EXPR(value_3(D)); _8 =3D VIEW_CONVERT_EXPR(input_4(D)); _9 =3D _6 < { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; _10 =3D VEC_COND_EXPR <_9, _5, _8>; _11 =3D VIEW_CONVERT_EXPR<__m128i>(_10); return _11; the difficulty #1 is the v16qi mode blend vs. the v4si mode compare so we'd have to pattern match the blend to be done on v4si based on the _15 value range.=