From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7CE22384400A; Fri, 28 May 2021 06:13:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CE22384400A From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99398] Miss to optimize vector permutation fed by CTOR and CTOR/CST Date: Fri, 28 May 2021 06:13:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: linkw 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: Fri, 28 May 2021 06:13:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99398 --- Comment #3 from CVS Commits --- The master branch has been updated by Kewen Lin : https://gcc.gnu.org/g:4a9f2306cb39a3cf265eeb6f8f3a8bbaf230c4c8 commit r12-1103-g4a9f2306cb39a3cf265eeb6f8f3a8bbaf230c4c8 Author: Kewen Lin Date: Fri May 28 01:11:45 2021 -0500 forwprop: Enhance vec perm fed by CTOR and CTOR/CST [PR99398] VEC_PERM_EXPR requires the number of MASK elements must be the same with the number of elements in operands V0 and V1. In some cases, like with Power altivec built-in function vec_perm, VIEW_CONVERT_EXPR has to be used to guarantee this requirement, but it can prevent some simplifications which don't consider this well. For the cases that the permutated operands of vector permutation are from two same type CTOR and CTOR, or one CTOR and one VECTOR CST, this patch is to enhance forwprop to look through intermediate VIEW_CONVERT_EXPR and further simplify them if possible. Bootstrapped/regtested on powerpc64le-linux-gnu P9, powerpc64-linux-gnu P8, x86_64-redhat-linux and aarch64-linux-gnu. gcc/ChangeLog: PR tree-optimization/99398 * tree-ssa-forwprop.c (simplify_permutation): Optimize some cas= es where the fed operands are CTOR/CST and propagated through VIEW_CONVERT_EXPR. Call vec_perm_indices::new_shrunk_vector. * vec-perm-indices.c (vec_perm_indices::new_shrunk_vector): New function. * vec-perm-indices.h (vec_perm_indices::new_shrunk_vector): New declare. gcc/testsuite/ChangeLog: PR tree-optimization/99398 * gcc.target/powerpc/vec-perm-ctor-run.c: New test. * gcc.target/powerpc/vec-perm-ctor.c: New test. * gcc.target/powerpc/vec-perm-ctor.h: New test.=