From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 171CA3858D1E; Wed, 24 Jan 2024 15:00:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 171CA3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706108425; bh=2fwfTsOs1aUIcMSjOUbh+CHwrnFyAXRbkTWizptvPmM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=S0eRyebiW7T2OJ90BPkZJ3c/9p3m24G1mHrcKEtTt2H4BU4vpHX7yh4dVCI+Ead8P ae2mDTE6jUneO1hdT7AEXT2TpxmohUjWJvQt3ZPxQBGDNsJcTUx/+LNLlWK4CKLx6j vMQdw4Sz1DnxtS9bNNnDBcOW4w7ufqoOyCgx4tQ0= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113583] Main loop in 519.lbm not vectorized. Date: Wed, 24 Jan 2024 15:00:24 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai X-Bugzilla-Status: UNCONFIRMED 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113583 --- Comment #3 from JuzheZhong --- Ok I see. If we change NN into 8, then we can vectorize it with load_lanes/store_lanes with group size =3D 8: https://godbolt.org/z/doe9c3hfo We will use vlseg8e64 which is RVVM1DF[8] =3D=3D RVVM1x8DFmode. Here there is report: /app/example.c:47:21: missed: no array mode for RVVM1DF[20] /app/example.c:47:21: missed: no array mode for RVVM1DF[20] I believe we enable vec_load_lanes/vec_store_lanes for RVVM1DF[20] which RVVM1x20DF mode, then we can vectorize it. But it's not reasonable and not general way to do that. This code require a= rray size =3D 20. How about other codes, we may have codes require array size = =3D 21, 22,.. 23, ....etc... The array size can be any number. We can't leverage this approach for infinite array size. So, the idea is that we try to find vec_load_lanes/vec_store_lanes first ch= eck whether it support lanes vectorization for specific array size. If not, we should be able to lower them into multiple gather/scatter or str= ided load/stores.=