From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6BC553858409; Thu, 13 Jan 2022 09:02:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BC553858409 From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103771] [12 Regression] Missed vectorization under -mavx512f -mavx512vl after r12-5489 Date: Thu, 13 Jan 2022 09:02:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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: 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: Thu, 13 Jan 2022 09:02:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103771 --- Comment #4 from Hongtao.liu --- (In reply to Hongtao.liu from comment #3) > for patt_42 =3D () patt_40; >=20 > vectype_in (QImode:nunits 4) >=20 > type size > unit-size > align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type > 0x7fffea18ddc8 precision:1 min max > > > QI size unit-size 0x7fffea2e2e58 1> > align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type > 0x7fffea18de70 nunits:4> >=20 > vectype_out(HImode) >=20 > type size > unit-size > align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type > 0x7fffea18ddc8 precision:1 min max > > > HI > size bitsizetype> constant 16> > unit-size sizetype> constant 2> > align:16 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type > 0x7fffea18df18 nunits:16> >=20 > And =E2=80=98vec_pack_sbool_trunc_m=E2=80=99 only handle situation when i= nput and output > have same mode. And GCC vectorizer only handle 2X elements, but not 4X,8X,... /* For scalar masks we may have different boolean vector types having the same QImode. Thus we add additional check for elements number. */ if (known_eq (TYPE_VECTOR_SUBPARTS (vectype) * 2,=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 TYPE_VECTOR_SUBPARTS (narrow_vectype)))=