From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0A927385783C; Mon, 12 Oct 2020 02:23:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A927385783C From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/97249] Missing vec_select and subreg optimization Date: Mon, 12 Oct 2020 02:23:08 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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, 12 Oct 2020 02:23:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97249 --- Comment #4 from Hongtao.liu --- (In reply to Richard Biener from comment #3) > Guess you want to figure what built the (vec_select:V8QI (V16QI)) and if > it was appropriately simplified (and simplify_rtx would handle this case). > In any case the vec_select is the same as (subreg:V8QI (V16QI)). For this testcase, simplify_rtx will be omiited since it will be handle in --- for (i =3D 0; i < GET_RTX_LENGTH (code); i++) switch (*format_ptr++) { case 'e': if (XEXP (orig, i) !=3D NULL) { rtx result =3D cselib_expand_value_rtx_1 (XEXP (orig, i), evd, max_depth - 1); if (!result) return NULL; <-----return here. if (copy) XEXP (copy, i) =3D result; } break; --- So could we handle it in cselib_expand_value_rtx_1? --- diff --git a/gcc/cselib.c b/gcc/cselib.c index 53e9603868d..8882ac60f1e 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -1864,6 +1864,18 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd, return scopy; } + /* Handle cases like + (vec_select:V8QI (subreg:V16QI (value:V8QI) 0) + (parallel [(const_int 0) (const_int 1) + (const_int 2) (const_int 3) + (const_int 4) (const_int 5) + (const_int 6) (const_int 7)])), + it should be equal to (value:V8QI). */ + case VEC_SELECT: + { +=20=20=20=20=20=20=20 + } + ---=