From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B1CCD3858032; Wed, 19 Jan 2022 03:30:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1CCD3858032 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/104049] [12 Regression] vec_select to subreg lowering causes superfluous moves Date: Wed, 19 Jan 2022 03:30:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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: Wed, 19 Jan 2022 03:30:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104049 --- Comment #6 from Andrew Pinski --- Before my patch we had on the gimple level: vect_sum_26.13_38 =3D VIEW_CONVERT_EXPR(vect__7.9_48); _36 =3D (vector(4) unsigned int) vect_sum_26.13_38; _35 =3D .REDUC_PLUS (_36); _34 =3D (int) _35; _44 =3D .REDUC_PLUS (vect__7.9_48); _20 =3D _34 & 65535; _10 =3D (unsigned int) _20; _12 =3D _44 >> 16; _13 =3D _10 + _12; _14 =3D _13 >> 1; _23 =3D (int) _14; After we get: _43 =3D .REDUC_PLUS (vect__7.11_47); _37 =3D _43 & 65535; _12 =3D _43 >> 16; _13 =3D _12 + _37; _14 =3D _13 >> 1; _23 =3D (int) _14; Which is obviously better really. So there is nothing to be done on the gim= ple level really. the only thing I can think of is how reducative plus is implemented.=