From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7B32D3858C1F; Mon, 7 Nov 2022 08:17:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B32D3858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667809029; bh=EDgFK5bV02p6PNs/pS+IvUBFcs/nYL+BN2KMTmZveG8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lza4XsTwUs4hpvRsKBkCwSXJqCenGPwv1l2O8FvX78WELJk886SuR6d7L2PMFrBv6 t9KEx+76Pfr/xufYJlfsy5aDfDCokTHbwOQ/qadzbneUZ5gPHcNNGxqWkcmfkyn9o+ mBYqFb/EewN1ZR+u+diucabGEOrjxCZiyRrwGS9E= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107412] Miss to fold LEN_{LOAD,STORE} when the specified length equal to vector length Date: Mon, 07 Nov 2022 08:17:08 +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: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107412 --- Comment #4 from CVS Commits --- The master branch has been updated by Kewen Lin : https://gcc.gnu.org/g:8408120fecc56385b316dafec1bdfe3aac61fc05 commit r13-3716-g8408120fecc56385b316dafec1bdfe3aac61fc05 Author: Kewen Lin Date: Mon Nov 7 02:07:27 2022 -0600 vect: Fold LEN_{LOAD,STORE} if it's for the whole vector [PR107412] As the test case in PR107412 shows, we can fold IFN .LEN_{LOAD, STORE} into normal vector load/store if the given length is known to be equal to the length of the whole vector. It would help to improve overall cycles as normally the latency of vector access with length in bytes is bigger than normal vector access, and it also saves the preparation for length if constant length can not be encoded into instruction (such as on power). PR tree-optimization/107412 gcc/ChangeLog: * gimple-fold.cc (gimple_fold_mask_load_store_mem_ref): Rename = to ... (gimple_fold_partial_load_store_mem_ref): ... this, add one parameter mask_p indicating it's for mask or length, and add some handlin= gs for IFN LEN_{LOAD,STORE}. (gimple_fold_mask_load): Rename to ... (gimple_fold_partial_load): ... this, add one parameter mask_p. (gimple_fold_mask_store): Rename to ... (gimple_fold_partial_store): ... this, add one parameter mask_p. (gimple_fold_call): Add the handlings for IFN LEN_{LOAD,STORE}, and adjust calls on gimple_fold_mask_load_store_mem_ref to gimple_fold_partial_load_store_mem_ref. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr107412.c: New test. * gcc.target/powerpc/p9-vec-length-epil-8.c: Adjust scan times = for folded LEN_LOAD.=